Ask a Question related to ASP.NET General, Design and Development.
-
Steve C. Orr, MCSD #1
Re: Retrieving value from a textbox in another web form
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
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, 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.
[url]http://msdn.microsoft.com/msdnmag/issues/03/04/ASPNETUserState/default.aspx[/url]
[url]http://www.aspalliance.com/kenc/passval.aspx[/url]
[url]http://www.dotnetjunkies.com/tutorials.aspx?tutorialid=600[/url]
[url]http://www.dotnetbips.com/displayarticle.aspx?id=79[/url]
--
I hope this helps,
Steve C. Orr, MCSD
[url]http://Steve.Orr.net[/url]
"Justin" <yyf_pl@hotmail.com> wrote in message
news:047201c34feb$80ede8d0$a601280a@phx.gbl...> 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
Steve C. Orr, MCSD Guest
-
NEED HELP please! retrieving checked items to a textbox
My datgrid displays the data when the checkbox is checked to a label...can someone help me make it display to textboxes instead? Textboxes are:... -
Problems retrieving data from form
Does anyone see what is wrong with the below code? File Test1.ASP <HTML> <Form action="test2.asp" method="post" ID="frm1"> <input type =... -
retrieving a post form
I have a comments form that when filled in posts the comments from a text field into a database. Due to a bit of duff coding (Doh!) the database... -
[PHP] retrieving form checkbox values
This is not necessary, you can do foreach($_POST as $file) { // ... } George Pitcher wrote: -
retrieving form checkbox values
I have a form which I want to post multiple values from one function to another using checkboxes. Having one value is simple- the form submits the...



Reply With Quote

