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>"

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 namewin.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');
}
}
}

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>"

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.