954,595 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Open new window in ASP.Net

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.

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>"
davidegan
Newbie Poster
2 posts since Oct 2008
Reputation Points: 10
Solved Threads: 0
 

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'); } } }
reach_yousuf
Junior Poster
195 posts since Sep 2007
Reputation Points: 12
Solved Threads: 38
 

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)

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>"
davidegan
Newbie Poster
2 posts since Oct 2008
Reputation Points: 10
Solved Threads: 0
 

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.

serkan sendur
Postaholic
Banned
2,062 posts since Jan 2008
Reputation Points: 854
Solved Threads: 127
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You