Postback

  • Thread starter Thread starter Chris Wilmot
  • Start date Start date
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
 
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.
 
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?
 
Back
Top