Postback

C

Chris Wilmot

Can anyone help with this one.

I have a Text box called txt_Query and when I do a postback on the page I
want to grab the text from this box as it contains criteria that I need to
run the appropriate Query

I have tried without Success
Dim Query As String = Request.Params.Item("txt_Query")

Can anyone tell me how to get the value of this text field

Thanks in advance

Chris Wilmot
 
K

Kevin Spencer

Hi Chris,

Try Request.Form("TextBoxName") - Note that I put "Name" in there, because
the id property is not passed back in the Request.Form collection; the name
property is.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
http://www.takempis.com
Neither a follower nor a lender be.
 
J

John Saunders

Chris Wilmot said:
Unfortunatly that does not work as it is within the onload section and has
not assigned the text to the text box at that point, also the value may be
posted through from the previous page.

txt_Query.Text should work in OnLoad.

Are you loading the data within a "if (!IsPostBack)" block?
 

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

Forum statistics

Threads
473,787
Messages
2,569,631
Members
45,338
Latest member
41Pearline46

Latest Threads

Top