473,408 Members | 2,477 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,408 software developers and data experts.

Show some web form

Hello.
Sorry me, if it's some basic question, but I'm new in ASP.NET:)
How do I show the othe web form from my code?
I mean I have a button on form "A" and I want to go to form "B" when I click
on the button on form "A"?

Thank You.
Nov 18 '05 #1
4 2170
Hi,

You need to create a click event for your button and do a
Response.Redirect():

Private Sub Button1_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles btnButton1.Click
Response.Redirect("PageB.aspx")
End Sub

Good luck! Ken.

--
Ken Dopierala Jr.
For great ASP.Net web hosting try:
http://www.webhost4life.com/default.asp?refid=Spinlight

"Dave" <da*********@hotmail.com> wrote in message
news:%2***************@TK2MSFTNGP15.phx.gbl...
Hello.
Sorry me, if it's some basic question, but I'm new in ASP.NET:)
How do I show the othe web form from my code?
I mean I have a button on form "A" and I want to go to form "B" when I click on the button on form "A"?

Thank You.

Nov 18 '05 #2
you can use response.redirect("PageB.aspx") if the button runs at server or
alternatively call a javascript function which makes location.href =
"pageB.aspx".

HTH
srini

"Dave" wrote:
Hello.
Sorry me, if it's some basic question, but I'm new in ASP.NET:)
How do I show the othe web form from my code?
I mean I have a button on form "A" and I want to go to form "B" when I click
on the button on form "A"?

Thank You.

Nov 18 '05 #3
OK, it's work :)
But now I have one more question:
I want to make message window what I mean:
I want to creat some form "B" and put a label on it, then from form "A" I
want to show form "B" with my text on label, I must to be able to set the
text of label on form "B" from form "A".
How ca I do this?

Than You.

"Ken Dopierala Jr." <kd*********@wi.rr.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
Hi,

You need to create a click event for your button and do a
Response.Redirect():

Private Sub Button1_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles btnButton1.Click
Response.Redirect("PageB.aspx")
End Sub

Good luck! Ken.

--
Ken Dopierala Jr.
For great ASP.Net web hosting try:
http://www.webhost4life.com/default.asp?refid=Spinlight

"Dave" <da*********@hotmail.com> wrote in message
news:%2***************@TK2MSFTNGP15.phx.gbl...
Hello.
Sorry me, if it's some basic question, but I'm new in ASP.NET:)
How do I show the othe web form from my code?
I mean I have a button on form "A" and I want to go to form "B" when I

click
on the button on form "A"?

Thank You.


Nov 18 '05 #4
Hi,

The easiest way is to have a textbox on your form "A". Then in the button
code put this:

Session("MyText") = Textbox1.Text

Then in the Form_Load() event of your form "B" set your label:

Label1.Text = CStr(Session("MyText"))
Session("MyText") = Nothing 'Clears the session to release server resources.

Alternately you could send it via a QueryString:

In the button code:

Response.Redirect("PageB.aspx?MyText=" + Textbox1.Text)

In the Form_Load()
Label1.Text = CStr(Request("MyText"))

For now I would use the Session object until you learn how to Encode query
strings that include spaces and special characters. Good luck! Ken.

--
Ken Dopierala Jr.
For great ASP.Net web hosting try:
http://www.webhost4life.com/default.asp?refid=Spinlight

"Dave" <da*********@hotmail.com> wrote in message
news:O$****************@tk2msftngp13.phx.gbl...
OK, it's work :)
But now I have one more question:
I want to make message window what I mean:
I want to creat some form "B" and put a label on it, then from form "A" I
want to show form "B" with my text on label, I must to be able to set the
text of label on form "B" from form "A".
How ca I do this?

Than You.

"Ken Dopierala Jr." <kd*********@wi.rr.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
Hi,

You need to create a click event for your button and do a
Response.Redirect():

Private Sub Button1_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles btnButton1.Click
Response.Redirect("PageB.aspx")
End Sub

Good luck! Ken.

--
Ken Dopierala Jr.
For great ASP.Net web hosting try:
http://www.webhost4life.com/default.asp?refid=Spinlight

"Dave" <da*********@hotmail.com> wrote in message
news:%2***************@TK2MSFTNGP15.phx.gbl...
Hello.
Sorry me, if it's some basic question, but I'm new in ASP.NET:)
How do I show the othe web form from my code?
I mean I have a button on form "A" and I want to go to form "B" when I

click
on the button on form "A"?

Thank You.



Nov 18 '05 #5

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

Similar topics

3
by: dp | last post by:
I am new to VB.NET and I have a simple question. How do I show a form from a command button click event? The code I have below is not working. I am trying to show the form frmAgent. What am I...
13
by: genetic.error | last post by:
I'm moving from Vb6 to VB.Net. I have a feeling this has come up before... The VS.Net MSDN file seems to state that the following should work: Form1.Show Form1.Visible = True Form1.Hide...
2
by: Ajai Kumar .R | last post by:
Hai all, I've two or more forms on my app. My requirement is, Have to show the first form asa the user press a button have to hide the first form and show the second form. If the user press the...
20
by: WindAndWaves | last post by:
Hi Gurus I was wondering if you can send me in the right direction: I have a table with about 300 rows. I want to make all of them invisible and when a user enters a code in a form then make...
1
by: cefrancke | last post by:
I have set the Startup properties to the following... All menus, toolbars, etc are turned off plus these are unchecked Allow Full Menus Allow Built-in Toolbars Allow Default Shortcut Menus...
0
by: Homa | last post by:
Hi I'm working on a program that will have 3 forms: a main form, a status form and a sub-form. The main form and status form are always appear, and my sub-form is a singleton (for performance...
13
by: Tim Smallwood | last post by:
Hi, This is probably a stupid question, but I can't seem to get a form to show / load? In the older versions of VB I'd use frmMyform.show / load myForm, etc? I looked at the help file and it...
3
by: yzi | last post by:
I have a list form and a detail form . Before, I open the List form, use form.showDialog(),then I click List Item and open the Detail Form by form.show(). now , user need when the list form...
22
by: Zytan | last post by:
I have public methods in a form. The main form calls them, to update that form's display. This form is like a real-time view of data that is changing. But, the form may not exist (it is...
4
by: Delphiscn | last post by:
How to show a ABOUT Form???????? Hello Everyone: I use C# want to Create a Project. In my project. there are two forms. One is main form, and another is a about form. In the about form there...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
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...
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.