Open Webform..?

  • Thread starter Thread starter Kent Johnson
  • Start date Start date
K

Kent Johnson

Hi all,

How can I open a second Webform from the first Webform with a Button_onlick
event?

/Kent J.
 
You can't really do that with server side code. A URL once on the server
cannot go to a new window (well there are hacks)...

The best way to do that is to use some JavaScript onClick handler to open a
new window and load the other Web Form that way.

--

Rick Strahl
West Wind Technologies
http://www.west-wind.com/
http://www.west-wind.com/wwHelp
 
void Button1_Click(object src,EventArgs e){
System.Text.StringBuilder sb=new System.Text.StringBuilder(400);
sb.Append("<script Language=\"Javascript\">");
sb.Append("window.open(\"mypage.aspx\")");
sb.Append("<").Append("/").Append("script>");
if(!Page.IsClientScriptRegistered("myscript"))
Page.RegisterClientScript("myscript",sb.ToString());
}

This will open the link in a new window!!Hope it helps!Thanks
 
void Button1_Click(object src,EventArgs e){
System.Text.StringBuilder sb=new System.Text.StringBuilder(400);
sb.Append("<script Language=\"Javascript\">");
sb.Append("window.open(\"mypage.aspx\")");
sb.Append("<").Append("/").Append("script>");
if(!Page.IsClientScriptRegistered("myscript"))
Page.RegisterClientScript("myscript",sb.ToString());
}

This will open the link in a new window!!Hope it helps!Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top