Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

passing form values to webPage2

0 views
Skip to first unread message

mobius

unread,
Feb 25, 2003, 3:44:24 PM2/25/03
to
Hey all!
Why am I having so much trouble passing 2 form values (a text box, and
a dropdownList) to my other ASP .NET page ?

this is my set up:

<asp:DropDownList id="searchDropDown" runat="server">
<asp:ListItem>TrackingTag</asp:ListItem>
<asp:ListItem>SerialNumber</asp:ListItem>
</asp:DropDownList>

<asp:TextBox runat="server" id="find" />

<asp:Button id="go" Text="go!" runat="server" OnClick="submitGo"/>

So when I click the <asp:button> by event handler gets called:

sub submitGo(ByVal Source As Object, e As EventArgs)
server.Transfer("webPage2.aspx")
End Sub

but I cant seem to then Response.write() my 2 form values in that
"webPage2.aspx" ....

does anyone know why?

saucer

unread,
Feb 25, 2003, 3:55:07 PM2/25/03
to
see
Passing Values between ASP.NET Web Forms
http://www.dotnetbips.com/displayarticle.aspx?id=79

"mobius" <slap...@hotmail.com> wrote in message
news:dd628886.03022...@posting.google.com...

Steve C. Orr, MCSD

unread,
Feb 25, 2003, 4:08:15 PM2/25/03
to
Here's a nice, simple way to pass values from one page to another:

'Add data to the context object before transferring
Context.Items("myParameter") = x
Server.Transfer("WebForm2.aspx")

Then, in WebForm2.aspx:

'Grab data from the context property
Dim x as Integer = CType(Context.Items("myParameter"),Integer)

Of course there are a number of ways to pass values from one page to
another, such as using the querystring, posting values, cookies, session,
context, saving to a temporary table in the database between each page, etc.
You'll have to decide which technique is best for your application.
Here are a few good articles on the subject to help you decide.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/vbtskpassingvaluesbetweenwebformspages.asp

http://www.dotnetjunkies.com/tutorials.aspx?tutorialid=600

http://www.aspalliance.com/kenc/passval.aspx

--
I hope this helps,
Steve C. Orr, MCSD
http://Steve.Orr.net

"mobius" <slap...@hotmail.com> wrote in message
news:dd628886.03022...@posting.google.com...

David Mobius

unread,
Feb 25, 2003, 4:10:56 PM2/25/03
to

Thanks for the prompt Response!

i will check it out.


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

David Mobius

unread,
Feb 25, 2003, 4:41:02 PM2/25/03
to
thanks steve,
Your example using the Server.Transfer worked really really well.
Exactly what i needed.

Cheers,
DAvid

0 new messages