Open new window in ASP.Net

Please support our ASP.NET advertiser: Intel Parallel Studio Home
Thread Solved

Join Date: Oct 2008
Posts: 2
Reputation: davidegan is an unknown quantity at this point 
Solved Threads: 0
davidegan davidegan is offline Offline
Newbie Poster

Open new window in ASP.Net

 
0
  #1
Oct 10th, 2008
This is my first forum post ever, so I'm not sure exactly how it works.
I'm looping through the code below to create a list of links that will open a new window with information about an event. The code below seems to work fine in firefox but displays very odd in IE. It seems like I may have some single or double quotes out of place. Can anyone tell by the code below if my single and double quotes are correct?

Thanks you in advance. I've been struggling with this for two days now.

  1.  
  2. lblTitle.Text = "<br/><font size=1><a href=""javascript: window.open('EventDetails.aspx?ID_Num=" + CStr(dr("ID_Num")) + "','',config='height=500,width=500,scrollbars=yes','status=no'); void('');"" '>" + dr("EventName") + "</a></font>"
Reply With Quote Quick reply to this message  
Join Date: Sep 2007
Posts: 79
Reputation: reach_yousuf is an unknown quantity at this point 
Solved Threads: 14
reach_yousuf reach_yousuf is offline Offline
Junior Poster in Training

Re: Open new window in ASP.Net

 
0
  #2
Oct 11th, 2008
Hi,

pls. look at this code below. it might help u

function openCalendar(XX)
{
if (XX.disabled==false){
voidValdiate = true;
// this mean that the page is opened via a Model Dialog
if (window.dialogArguments != null && (typeof(dialogArguments.window) != 'undefined')){
var win =dialogArguments.window.open(webApplicationName + '/HR_Common/DecisionsUCForms/Popups/frmOverTimeDate.aspx?obj=' + XX.id ,'_blank','height=300,width=300,top=200,left=250,status=no,toolbar=no,menubar=no,location=no,titlebar=no');
// give pages name
win.name = '__HGSChildWindow';
window.name = '__HGSParentWindow';
// set the Parent, Opener for (window.open)
win.parentWindow = window;
win.opener = window;
// set the Parent, Opener for dialogArgument
window.parentWindow = dialogArguments.window;
window.opener= dialogArguments.window;
}
else
{
window.open(webApplicationName + '/HR_Common/DecisionsUCForms/Popups/frmOverTimeDate.aspx?obj=' + XX.id ,'_blank','height=300,width=300,top=200,left=250,status=no,toolbar=no,menubar=no,location=no,titlebar=no');
}
}
}
Reply With Quote Quick reply to this message  
Join Date: Oct 2008
Posts: 2
Reputation: davidegan is an unknown quantity at this point 
Solved Threads: 0
davidegan davidegan is offline Offline
Newbie Poster

Re: Open new window in ASP.Net

 
0
  #3
Oct 14th, 2008
Thank you for your suggestion.

If anyone is interested, I did finally figure out my problem. Below is the correct code. I was missing the double quote after javscript:void(0)

  1.  
  2. lblTitle.Text = "<br/><font size=1><a href=""javascript:void(0)"" onClick=""window.open('EventDetails.aspx?ID_Num=" + CStr(dr("ID_Num")) + "','','height=400,width=600','scrollbars=yes','status=no')"" >" + dr("EventName") + "</a></font>"
Reply With Quote Quick reply to this message  
Join Date: Jan 2008
Posts: 2,052
Reputation: serkan sendur is a glorious beacon of light serkan sendur is a glorious beacon of light serkan sendur is a glorious beacon of light serkan sendur is a glorious beacon of light serkan sendur is a glorious beacon of light serkan sendur is a glorious beacon of light 
Solved Threads: 118
Featured Poster
serkan sendur serkan sendur is offline Offline
Postaholic

Re: Open new window in ASP.Net

 
0
  #4
Oct 15th, 2008
instead of doing this in the code behind file, you can seperate the javascript code and only use the function name in your server control. better than that, you can create a javascript function named like OpenWindow
and put that into a seperate .js file along with your other useful javascript functions, then register the file within script tags, so this way you will reuse your code and be more organized. try to seperate client side functionality from server side ones.
Due to lack of freedom of speech, i no longer post on this website.
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the ASP.NET Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC