| | |
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:
Solved Threads: 0
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.
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.
ASP.NET Syntax (Toggle Plain Text)
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>"
•
•
Join Date: Sep 2007
Posts: 79
Reputation:
Solved Threads: 14
Hi,
pls. look at this code below. it might help u
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');
}
}
}
•
•
Join Date: Oct 2008
Posts: 2
Reputation:
Solved Threads: 0
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)
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)
ASP.NET Syntax (Toggle Plain Text)
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>"
•
•
Join Date: Jan 2008
Posts: 2,052
Reputation:
Solved Threads: 118
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.
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.
![]() |
Similar Threads
- PHP and JAVA vs .NET (IT Professionals' Lounge)
- Button to open a new browser window (ASP.NET)
- Problem with ASP.Net control or JavaScript ??? (ASP.NET)
- Open In New Window Php (PHP)
- Can't Open Web Pages where ASP.net (Web Browsers)
- Printing using Web Control Print button VB.NET (JavaScript / DHTML / AJAX)
Other Threads in the ASP.NET Forum
- Previous Thread: My graduation project...
- Next Thread: insert into a db
| Thread Tools | Search this Thread |
.net 2.0 3.5 ajax appliances application asp asp.net beginner box browser businesslogiclayer button c# c#gridviewcolumn cac checkbox child class compatible confirmationcodegeneration content contenttype control countryselector courier css database datagrid datagridview datalist deadlock deployment development dgv dialog dropdownmenu dynamic dynamically edit embeddingactivexcontrol feedback fileuploader fill findcontrol flash flv form forms grid gridview gudi homeedition hosting iis image javascript jquery list menu mssql multistepregistration nameisnotdeclared novell objects opera order problem ratings redirect registration relationaldatabases rotatepage search security select serializesmo.table sessionvariables silverlight smoobjects sql ssl tracking treeview typeof validatedate validation vb.net virtualdirectory vista visual-studio visualstudio vs2008 web webapplications webarchitecture webdevelopment wizard xml xsl






