Monday, March 12, 2012

Want to display a new page using a button of another page

Hi Everyone,

I am Sabareeswaren doing an in-house project. i need to know that when i click the button in (WebForm1.aspx.cs) page, Another page say (WebForm2.aspx.cs) should appear in a seperate window. i used "Response.Redirect()" but it appears in the same page itself. please do help me!!!!

Thnaks in Advance!!!!

Yours Truly,

Sabareeswaren.

you'll have to pass the call to the clientside events and fire a window.open() or use a target= in a link, again from the client though.

The server code cant do what you are asking.


Here is a example of doing it using inline code. The example uses a asp hyperlink.

<

asp:HyperLinkID="link1"runat="server"><Aonclick="window.open('/Application1/Pop_Ups/popup1.htm','newwindow','width=350,height=400,top=20,left=20,resizable=yes,scrollbars=yes')
;"href="#UM"><spanstyle="text-decoration: underline">Pop Up Link</span></A></asp:HyperLink>

why even wrap an <asp:HyperLink> around that? You already have an <a> tag, that's the same as doing:
<a href...><a href...>text</a></a>

0 comments:

Post a Comment