473,394 Members | 1,761 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Open Webform..?

Hi all,

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

/Kent J.
Nov 17 '05 #1
7 3675
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
----------------------------------
Making waves on the Web
"Kent Johnson" <08********@telia.com> wrote in message
news:i3*******************@newsb.telia.net...
Hi all,

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

/Kent J.

Nov 17 '05 #2
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

"Kent Johnson" <08********@telia.com> дÈëÓʼþ
news:i3*******************@newsb.telia.net...
Hi all,

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

/Kent J.

Nov 17 '05 #3
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

"Kent Johnson" <08********@telia.com> дÈëÓʼþ
news:i3*******************@newsb.telia.net...
Hi all,

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

/Kent J.

Nov 17 '05 #4
Check out this article, this might help you.
http://www.microsoft.com/india/msdn/...ndarinASP.aspx

--
Saravana
Microsoft MVP - ASP.NET
www.extremeexperts.com

"Kent Johnson" <08********@telia.com> wrote in message
news:i3*******************@newsb.telia.net...
Hi all,

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

/Kent J.

Nov 17 '05 #5
Check out this article, this might help you.
http://www.microsoft.com/india/msdn/...ndarinASP.aspx

--
Saravana
Microsoft MVP - ASP.NET
www.extremeexperts.com

"Kent Johnson" <08********@telia.com> wrote in message
news:i3*******************@newsb.telia.net...
Hi all,

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

/Kent J.

Nov 17 '05 #6
use Server.Transfer("url.aspx")
or Response.Redirect("url.aspx")
-----Original Message-----
Hi all,

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

/Kent J.
.

Nov 17 '05 #7
use Server.Transfer("url.aspx")
or Response.Redirect("url.aspx")
-----Original Message-----
Hi all,

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

/Kent J.
.

Nov 17 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Sarah Bram | last post by:
Hi, I have created an ASP.NET app / page with Microsoft Visual Studio .NET 2003 using C# But, when I closed VS and re-opened it later, I see all files in my project, except the webform I had...
4
by: Ivan Sammut | last post by:
Hi, I have 2 webform Webform1 & WebForm2 In Webform1 I have a button that when I click I want to first set a variable in WebForm2 & then open the Page. This is the code I have now which...
2
by: Ivan Sammut | last post by:
Hi, I have a webform (Webform2) for data input which is called from another webform (Webform1) by using the server.transport command and this works fine. Now I would like to open Webform2 in a...
1
by: Raul M. Colon | last post by:
Hi. Im new in C# and I'm migrating a few Win Applications to Web Applications. So far the only commands I know to navigate between webforms are Server.Tranfer and Response.Redirect. Is there any...
2
by: Roby SGM | last post by:
Hi. In a webform (VB.NET) how can I open a new instance of the browser ? Thank you Roby
3
by: Kent Johnson | last post by:
Hi all, How can I open a second Webform from the first Webform with a Button_onlick event? /Kent J.
2
by: mg | last post by:
window.open (URLTarget, windowName, height=720,width=975,resizable=yes, ... lets me open a new WebForm with a specified size using JavaScript. Is there a way of doing this from code behind;...
3
by: ram | last post by:
how do I open a word document within a webform? I need to open the document within the form so the user can edit the document and then click on a button on the form (so that the document is...
4
by: Nad | last post by:
Hello, When I click on a linkbutton of a datagrid on a web form I open another web form on the same page within an iframe. The page within the iframe has a datagrid also and when I click on a...
2
by: Luqman | last post by:
How can I open another WebForm in ASP.Net / VS 2005 without closing the Current Webform. I tried using Server.Transfer("Form2.Aspx",True) on Button_Click of Form1 but it close the current web...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.