By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,669 Members | 2,546 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,669 IT Pros & Developers. It's quick & easy.

Show some web form

P: n/a
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
Share this Question
Share on Google+
4 Replies


P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.