Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > TextBox control not accepting Information typed in..

Reply
Thread Tools

TextBox control not accepting Information typed in..

 
 
Mad Bull
Guest
Posts: n/a
 
      07-16-2006
I am a newbie. I have created a page which upon load connects to SQL
Server and runs a stored procedure. The data returned from this is
assigned to some asp:labels and asp:textbox controls.
This all works fine.
The user then updated the textbox controls and clicks an asp:button to
execute an event procedure. The event procedure is supposed to set some
session variables useing the information stored in the asp:textbox's
..Text property and call another webpage. Unfortunately, even though the
user has put information into the textbox, the .text property is
showing up as an empty string and that is what gets stored in the
Session Variable.
Why would this happen? How do I correct it?

 
Reply With Quote
 
 
 
 
Rob Meade
Guest
Posts: n/a
 
      07-17-2006
"Mad Bull" wrote ...

> Why would this happen? How do I correct it?


Are you creating that text box programmitically in your code? If so,
perhaps this is happening regardless of a page postback, thus creating a new
control each time the page loads and therefore clearing any text that was in
it.

Regards

Rob


 
Reply With Quote
 
 
 
 
Mad Bull
Guest
Posts: n/a
 
      07-17-2006

Rob Meade wrote:
> "Mad Bull" wrote ...
>
> > Why would this happen? How do I correct it?

>
> Are you creating that text box programmitically in your code? If so,
> perhaps this is happening regardless of a page postback, thus creating a new
> control each time the page loads and therefore clearing any text that was in
> it.
>
> Regards
>
> Rob


Lets see... the textbox control is set up in the aspx page, like this:

<asp:textbox id="v_ExtDirAdLine" columns="1000" width="301px"
runat="server"></asp:textbox>

In the aspx.vb page, there is a definition for the textbox, like this:

Protected WithEvents v_ExtDirAdLine as
System.Web.UI.WebControls.TextBox

The above definition is at the class level, rather than being within a
procedure.

Thats all there is for definition. I do set the value of the textbox in
the page_load procedure, and then I type in a value. It seems the value
that is set in the page_load is always kept... that may be the reason.
I will put the initialisation code into an "If Not PostBack Then" block
and see what happens...

Yes that was it! Thanks much...

 
Reply With Quote
 
Rob Meade
Guest
Posts: n/a
 
      07-20-2006
"Mad Bull" wrote ...

> Yes that was it! Thanks much...


hehe, no worries )

Rob


 
Reply With Quote
 
 
 
Reply

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
mix statically typed with dynamically typed Yingjie Lan Python 4 01-29-2010 08:50 AM
Problem in Accepting Xml Data in TextBox Sandeep Singh Sekhon ASP .Net 3 07-07-2006 08:24 AM
Accepting certain tags in a textbox =?Utf-8?B?dGhlIGZyaWVuZGx5IGRpc3BsYXkgbmFtZQ==?= ASP .Net 2 11-08-2005 11:32 PM
How can I add a row from a typed datatable to another instance of that typed datatable? Ersin Gençtürk ASP .Net 1 10-06-2004 01:11 PM
Accepting date in Webform textbox Bogdan Zamfir ASP .Net 0 08-18-2003 08:52 AM



Advertisments