open popup in new window

 

Hi, I am using following code to make table and with linmks,and when the link is clicked,file is opened.But now i want file to be opened in a new window.

var tblBodyObj = window.opener.document.getElementById("maintable").tBodies[0];

var newCell=tblBodyObj.rows[0].insertCell(-1);

var doc = window.opener.document;

var link = doc.createElement('a');

link.href = '../UploadedFilesByUser/'+fname[j]+'';var img= doc.createElement('img');

ext[j]= fname[j].slice(-3)

img.setAttribute(
"src",'../images/'+ext[j]+'.PNG');

newCell.appendChild(img);

link.appendChild(doc.createTextNode(fname[j]));

newCell.appendChild(link);

j++;

 

Please help.

thanks

Prachi

0
prachikaushik07
5/5/2009 3:56:39 AM
asp.net.web-forms 93655 articles. 2 followers. Follow

3 Replies
2320 Views

Similar Articles

[PageSpeed] 2

link.setAttribute("target","_blank")

 

 


Plz remember to click "Mark as Answer" if this helped you.
1
Ugly
5/5/2009 4:20:33 AM

Add the Target property and that will open it in a new window:

img.setAttribute("target",'_blank');

Other options are:

_blank - will open a new browser window with no name.
_self - will replace the current html page, so if it is in a frame or frameset it will load within that frame. If it is the full browser, it will open to replace the page in the full browser.
_parent - will replace the html page it came from.
_top - will load in the current browser by replacing anything within the browser such as a frameset


Sincerely,
Malcolm Sheridan
Microsoft Certified Solution Developer
Please remember to click "Mark as Answer" on the post that helps you, and to click "Unmark as
Answer" if a marked post does not actually answer your question.
1
malcolms
5/5/2009 5:04:07 AM

 Try with this:

img.setAttribute("../images/'+ext[j]+'.PNG","_blank");


Ahsan Murshed
__________________________
Please "Mark as Answered" if helpful for you.
ASP BOSS
0
ahsanm
5/5/2009 5:23:28 AM
Reply:

Similar Artilces:

Entering data in old aspx form only after saving data in new web form opened in new window
Dear all, i am facing a problem. please solve it. i have created two .aspx pages, say, page1.aspx and page2.aspx. with the help of client-side javascript i am opening page2.aspx from page1.aspx in a new window. So, page1.aspx and page2.aspx remains open at the same time. what i want is, i don't want the user to able to activate or enter data in page1.aspx without saving data in page2.aspx. regards subhajit use window.showModalDialog() instead of window.open() when the child window is closed, in this case, program execution continues on the next line after the showModalDialog...

How to open a new web form in a new window?
How to open a new web form in a new window when we click on a button? Ex: I Have a Webform1.aspx which has a button and a few other controls. When click on the button i need to open a small window with Webform2.aspx which has a few other controls, the user enters the data and clicks on ok when we need to save and close webform2 and go back to webform1.aspx. How to do this? Any suggestions will be appreciated. Thanks. Check out these articles: http://www.codeproject.com/aspnet/Modal_Dialog.asp http://www.c-sharpcorner.com/Code/2003/Sept/ModalPopupInASP.NET.asp Darrell Norton, M...

Modal Popup window opens new window when form posted
I am having trouble with modal dialog.  I have a web page PopupTestParent.aspx and popup.aspx.  When I click button on popupTestParent.aspx, it opens modal dialog as exptected, when I click button on Popup.aspx, and form gets posted, it opens a new window, instead of using same window as the form.  code for both pages is given below.. Any clue, how to get over this? <%@ Page Language="C#" AutoEventWireup="true" CodeFile="PopupTestParent.aspx.cs" Inherits="PopupTestParent" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 ...

Open a web form in a new window
Hi everyone, I am using  Responde.Redirect(url) to to move from one page to another. I would like to open the new page in a new window. How can I do that?Any help will be very appreciate. Thank you Response.Redirect is a serverside method call. Opening things in a new window is a client side thing. So no, you cannot do this from your serverside code. You'd have to use the Javascript window.open method. Or specify the TARGET attribute in your link. Cheers, Wim Wim Hollebrandse---http://www.zealandit.com Thanks but I do not want to use Jscript and I dont use Hyperlinks,...

Open web form in new window
I want to know how to open web form in new browser window from a web form using server side code because i want to pass some data using query string in that new window form.   Thanks Parshant kalia   You can't open a window from server-side code, but you can drop client-side code from server-side that will open a new window.  Think window.open(...)... Check following sample and modify it according to your requirement     Public Sub ShowPopupWindow()        Try        &n...

How to open web form in new window ?
How to open web form in new window ? Check my Blog below, I have an article on how to open a new window in asp.net using javascript. regards.Bilal Hadiar, MCP, MCTS, MCPD, MCTMicrosoft MVP - Telerik MVP window.Open using javascript, or if you have a hyperlink, set the target to _blank.Brian"Trust in the Lord and do what is good; dwell in the land and live securely. Take delight in the Lord, and He will give you your heart's desires" (Psalm 37: 3-4). Hi, you need to check this post : view post 818881 regardsBilal Hadiar, MCP, MCTS, MCPD, MCTMicrosoft MVP - Telerik M...

Force a new browser window to be opened from a web form ?
Does anyone know how to force a new browser window to be opened from a web form following Response.BinaryWrite or Response.Write if the data to be displayed is html? Html data is diplayed in the current browser but for non html data the appropriate application is opened e.g. ms-word, excel etc. Effectively, I want html to be treated just like the other mime types.ThanksMajella Majella,Since at the server-end you are going to set the contentType and start streaming the content, you can set a window open to an ASPX Page and in that page (or the same page with a different QueryString Pa...

Open Web Form Using Server.Transfer in New Explorer Window
Hi, I have a requirement to open the form as MODAL using Server.Transfer. It should be opened in New Explorer Windows Any Idea? Regards Atif     hi, I think you had better use javascript window.showModalDialog, cause Server.Transfer cannot open a new window. Hi, Thanks for prompt response. I know how to open the MODAL FORM using Javascript.  If I want to pass let say one variable to Child Form. How do i do this ? ... this variable is transaction id and shouldn't be part of the HTTP Query (Confidential). How can do this ?     ...

windows forms in vb .net into web forms
we are creating a database driven website as part of our project. currently we have forms connecting to the database created in visual basic. these windows forms we need to convert into web forms which are asp .net compatible. can u give me an answer or show me a way. Hi, because of the difference in nature between web and win applications you'll need to reimplement at least the UI part. If you have a multitiered application in which the busines logic and data access are in different parts/assemblies you can reuse them. Grz, Kris.Read my blog. Handy Firefox plugins for web developers.Wor...

Open a new window with window.open()
Hi, =20 in our web application, we try to open a popup-window with window.open(). But instead of opening a new window, a new tab is opened. =20 In the SeaMonkey preferences, we configured it, to open new links in a new tab. With firefox, we had the same preferences, but when window.open() was called, a new window was opened.=20 How can we configure SeaMonkey, so that it has the Firefox behavior when calling window.open() ? =20 Thanks in advance. =20 =20 =20 Artur Zeiler schrieb: > Hi, > > in our web application, we try to open a popup-window wi...

opening new window other than window.open
is there any other way of opening a new window... aside from window.open? window.open has a memory leak so i want to prevent using it as much as possible.Alvin ShihSoftware DeveloperMCP MCTS MCPD Hi window.showmodaldialog() but supports only IE....   Regards Suresh Kumar Goudampally Why dont you avoid pop up windows all together and use an iframe that is positioned over the content? Eric Pascarello.com | Twitter epascarello | LinkedIn Hi,Try Target="_blank" N.P.SenthilSoftware Engineer  Link buttons targer property is set to "_blank"...

superreview granted: [Bug 279495] A link with an URL and additional javascript open shows a popup and an unwanted new window [link with TARGET and onClick=window.open] : [Attachment 172585] Patch
Johnny Stenback <jst@mozilla.jstenback.com> has granted Boris Zbarsky <bzbarsky@mit.edu>'s request for superreview: Bug 279495: A link with an URL and additional javascript open shows a popup and an unwanted new window [link with TARGET and onClick=window.open] https://bugzilla.mozilla.org/show_bug.cgi?id=279495 Attachment 172585: Patch https://bugzilla.mozilla.org/attachment.cgi?id=172585&action=edit ------- Additional Comments from Johnny Stenback <jst@mozilla.jstenback.com> Ugh, I can't explain how this worked... not w/o digging through old code I ...

superreview requested: [Bug 279495] A link with an URL and additional javascript open shows a popup and an unwanted new window [link with TARGET and onClick=window.open] : [Attachment 172585] Patch
Boris Zbarsky <bzbarsky@mit.edu> has asked Johnny Stenback <jst@mozilla.jstenback.com> for superreview: Bug 279495: A link with an URL and additional javascript open shows a popup and an unwanted new window [link with TARGET and onClick=window.open] https://bugzilla.mozilla.org/show_bug.cgi?id=279495 Attachment 172585: Patch https://bugzilla.mozilla.org/attachment.cgi?id=172585&action=edit ------- Additional Comments from Boris Zbarsky <bzbarsky@mit.edu> This basically backs out the "fix" for bug 135811. Now I can't figure out how finding targe...

how to open a web page in form of a popup web page
Hello, I have two web pages, let say. Page A : With a Button on it. PAge B: with some info. Now I need to: When I click on the Button of page A.Page B must open in a pop up window.  I can do this but problem is this when I clicked on the button for first time it does not show me any thing and when I clicked on the button for second time then It shows me Page B .My code is as follow:  1 protected void Page_Load(object sender, EventArgs e) 2 { 3 if (!this.Page.IsPostBack) 4 { 5 6 } 7 else 8...

How to send value form popup window to opener window ??
I have problem and I need everybody help me. I desgning a website using ASP.NET and VB.NET - I want, when user click button as show popup window with list user of system (from database) and click user of list, it's in textbox of opener window. Can you help me code it ??? Thanks a lot !!!  Không học không biết, học rồi sẽ biết  You have to access the window.opener.document object in JavaScript. This will give you access to the DOM. function getOpenerElem(Jb) { return window.opener.document.getElementById(Jb); }  I use this function to access the opening window...

Web resources about - open popup in new window - asp.net.web-forms

Window - Wikipedia, the free encyclopedia
This article is about the part of a building. For the Microsoft operating system, see Microsoft Windows . For other uses, see Window (disambiguation) ...

Microsoft Windows Information, Solutions, Tools - Windows IT Pro
Microsoft Windows information and solutions for IT pros. Topics include cloud computing, Windows Server, Exchange, Outlook, PowerShell, virtualization, ...

The Windows Blog
The Windows Blog is Microsoft's Official Blog for the Windows Operating System.

Microsoft To Only Support New Processors On Windows 10
... support news out of Redmond is particularly surprising. Intel launched it’s 6 th generation Skylake cores back in August, and support on Windows ...

Skylake users given 18 months to upgrade to Windows 10
... die shot. (credit: Intel) If you own a system with an Intel 6th generation Core processor—more memorably known as Skylake—and run Windows 7 ...

Best Windows apps this week
One-hundred and sixty-three in a series. Welcome to this week's overview of the best apps and games released for Windows 8.x and Windows 10 in ...

Why are plane windows round instead of square?
If you've ever traveled by plane, you're likely aware that every airplane window you've ever seen has a round design, whether it be a circle ...

Microsoft has finished rolling out Skype Translator to all Windows users
Microsoft has finished rolling out Skype's much-anticipated real time voice translation service to all of its Windows users, according to a post ...

IDG Contributor Network: Here’s why a jaw-dropping 200 million devices run Microsoft Windows 10
200 million devices are now running Windows 10 all over the world , or almost two-thirds of the entire U.S. population. It’s a bit surprising, ...

Microsoft won't support old Windows versions on new processors
Were you hoping to get a new Windows PC in the office this year without having to move to Windows 10 in the process? You might not have much ...

Resources last updated: 1/17/2016 8:10:05 AM