Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Re: Retrieving value from a textbox in another web form

Thread Tools

Re: Retrieving value from a textbox in another web form

Steve C. Orr, MCSD
Posts: n/a
Here's a nice, simple way to pass values from one page to another:
(VB.NET code)

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

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, 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 several good articles on the subject to help you decide.

I hope this helps,
Steve C. Orr, MCSD

"Justin" <(E-Mail Removed)> wrote in message
news:047201c34feb$80ede8d0$(E-Mail Removed)...
> hi, thanks for reading this msg. I got a problem here.
> There are 2 webforms, one is the login and the other is
> the result page after login. After a user sucessfully
> login, i need the user's ID which were entered from the
> textbox in the login page to display its relevant data...
> I tried:
> 1. using property, it worked well if the result page just
> load the data out, but currently in my result page the
> users need to select some option first before showing the
> data. If I use this method, error:
> Public ReadOnly Property Property1() As String
> Get
> Return tbStaffID.Text
> End Get
> End Property
> 2. I also tried using querystring...but i can't refer the
> value in the textbox to the querystring even I use a
> variabe
> Server.Transfer("Results.aspx?tbStaffID&tbName")
> - What are your comments regrading the codes or do u hav
> any better suggestion on other ways how to solve it? Thank
> you

Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Retrieving IIS Web Site Property Value during Application_Start in ASP.NET Web app. Jordan S. ASP .Net 3 04-19-2008 05:54 PM
passing values from one web form to another web form ASP .Net 5 06-12-2007 05:50 AM
Another basic question: How to call and show one Web Form from another Web Form? Rob R. Ainscough ASP .Net Web Controls 3 06-14-2005 03:56 PM
pass the control value from one web form to another form tom ASP .Net 4 11-13-2003 06:16 PM
Display in another window and retrieving value J ASP .Net Building Controls 0 09-09-2003 02:24 PM