is there a way to do this...unsure about this concept

G

Guest

hey all,

i have a plain aspx page (page1) with 1 textbox on it, i hardcode sample
text in the textbox. i have 1 button and in the codebehind button click event
i response.redirect to page2.

i try to do a request.form("TextBox1") on page2.aspx and it doesn't have the
contents of the textbox on page1.

can someone please explain this concept to me and what i need to do to make
it work.

thanks,
rodchar
 
S

Scott Mitchell [MVP]

rodchar said:
i have a plain aspx page (page1) with 1 textbox on it, i hardcode sample
text in the textbox. i have 1 button and in the codebehind button click event
i response.redirect to page2.

i try to do a request.form("TextBox1") on page2.aspx and it doesn't have the
contents of the textbox on page1.

Response.Redirect() doesn't send along any information from the sending
page to the receiving page. With Response.Redirect you can only send
along data through the querystring. So, from Page1 you could do:

Response.Redirect("Page2.aspx?TextBoxValue=" & TextBox1.Text)


And then in Page2.aspx you could do:

Dim tbValue as String = Request.QueryString("TextBoxValue")

hth
 
M

Mr Newbie

Doesent the Context.Handler allows you to access public properties on the
preceeding form even when using Response.Redirect. Im sure Ive done this
with code a bit similar to the following in the redirected to form. So lets
say we have form1 and form2 where form 2 is the one we redirect to.

so in form2 page_load event

'// Untested '//
If Not IsPostback then

dim f1 as Form1
f1 = Context.Handler.Form
response.write( f1.PublicPropertyForm1 )

End If






Scott Mitchell said:
rodchar said:
i have a plain aspx page (page1) with 1 textbox on it, i hardcode sample
text in the textbox. i have 1 button and in the codebehind button click
event i response.redirect to page2.

i try to do a request.form("TextBox1") on page2.aspx and it doesn't have
the contents of the textbox on page1.

Response.Redirect() doesn't send along any information from the sending
page to the receiving page. With Response.Redirect you can only send
along data through the querystring. So, from Page1 you could do:

Response.Redirect("Page2.aspx?TextBoxValue=" & TextBox1.Text)


And then in Page2.aspx you could do:

Dim tbValue as String = Request.QueryString("TextBoxValue")

hth

--

Scott Mitchell [ASP.NET MVP]
(e-mail address removed)
http://www.4GuysFromRolla.com/ScottMitchell
 
M

Mr Newbie

Although I have not tried it, I have seen written somewhere that client
calls to the server are possible, so if this is true then it would be
possible to callback to a running clock on the server.

Comments anyone ?


Scott Mitchell said:
rodchar said:
i have a plain aspx page (page1) with 1 textbox on it, i hardcode sample
text in the textbox. i have 1 button and in the codebehind button click
event i response.redirect to page2.

i try to do a request.form("TextBox1") on page2.aspx and it doesn't have
the contents of the textbox on page1.

Response.Redirect() doesn't send along any information from the sending
page to the receiving page. With Response.Redirect you can only send
along data through the querystring. So, from Page1 you could do:

Response.Redirect("Page2.aspx?TextBoxValue=" & TextBox1.Text)


And then in Page2.aspx you could do:

Dim tbValue as String = Request.QueryString("TextBoxValue")

hth

--

Scott Mitchell [ASP.NET MVP]
(e-mail address removed)
http://www.4GuysFromRolla.com/ScottMitchell
 
M

Mr Newbie

SORRY WRONG PLACE FOR THIS POST - MISTAKE!!!

Mr Newbie said:
Although I have not tried it, I have seen written somewhere that client
calls to the server are possible, so if this is true then it would be
possible to callback to a running clock on the server.

Comments anyone ?


Scott Mitchell said:
rodchar said:
i have a plain aspx page (page1) with 1 textbox on it, i hardcode sample
text in the textbox. i have 1 button and in the codebehind button click
event i response.redirect to page2.

i try to do a request.form("TextBox1") on page2.aspx and it doesn't have
the contents of the textbox on page1.

Response.Redirect() doesn't send along any information from the sending
page to the receiving page. With Response.Redirect you can only send
along data through the querystring. So, from Page1 you could do:

Response.Redirect("Page2.aspx?TextBoxValue=" & TextBox1.Text)


And then in Page2.aspx you could do:

Dim tbValue as String = Request.QueryString("TextBoxValue")

hth

--

Scott Mitchell [ASP.NET MVP]
(e-mail address removed)
http://www.4GuysFromRolla.com/ScottMitchell
 

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

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top