Active Server Pages Programming (ASP)/ASP.Net & IE

Advertisement


Question
Hello Srini

I am trying to figure out a way to have an ASP.Net application start in a new IE window rather than replace the currently veiwed IE Window.

Is there a way to accomadate this in ASP.Net?

Thanks for your time.

Dave

Answer
Hi

I was away thats why i was not able to reply imdtly... Here is my reply

Use this javascript function
<script language="JavaScript">

function new_window(url) {

link = window.open(url,"Link","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=600,height=500,left=40,top=50");

}
</script>

Then you can either use a button to open it

btnOpen.Attributes.Add ("onClick", "new_window('test.aspx')") - this should be on your code behind

or hyperlink

<asp:HyperLink id="lnkOpen" runat="server">Open</asp:HyperLink
lnkOpen.Attributes.Add("onClick", "new_window('test.aspx')")

Happy Programming!

-Srini

Active Server Pages Programming (ASP)

All Answers


Answers by Expert:


Ask Experts

Volunteer


Srini Nagarajan

Expertise

I can answer any kind of questions in ASP.NET, C#, VB.NET, SharePoint 2007, ASP, Coldfusion, Powerbuilder 7.00 / 8.00, JAVA servlets, MS SQL 2000 / MSSQL7, Sybase

Experience

Contact me if you need any custom development on ASP.NET, ASP, SharePoint 2007, Coldfusion, Powerbuilder.

©2012 About.com, a part of The New York Times Company. All rights reserved.