473,396 Members | 2,154 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,396 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 3676
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.