Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Datagrid Control > Catch TextBox value entered by user into the GridView Templated Field (both created dynamically) on PostBack

Reply
Thread Tools

Catch TextBox value entered by user into the GridView Templated Field (both created dynamically) on PostBack

 
 
Tatyana
Guest
Posts: n/a
 
      06-26-2006
Hello,



I was wondering if anybody knows how to get the values entered by the user
into the GridView Templated Field (both created dynamically) which is a
textbox.

Usually it could be



<asp:TextBox id="textbox1" OnTextChanged="TextBoxTextChanged" runat="server"
/>



and then

protected void TextBoxTextChanged(object sender, EventArgs e)

{TextBox txt_b = (TextBox)sender;

NewText = txt_b.Text;}

The reason that it didn't work is because we have multiple gridviews created
dynamically in code-behind, along with Templated Fields one of them is a
TextBox.

I'm trying to get entered by user data on the PostBack. But I either get the
same text pre-populated on gridviews creation (if I don't check on the
postback) or I'm getting a null for GridView (if I check on PostBack and do
not create all controls again on postback).

I was able to Add the OnTextChanged="TextBoxTextChanged" Attribute to the
TextBox. When text changes on submit button click event is not working.

Thank you,

Tatyana


 
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
how to display textbox entered value and with related values intextare using javascr venkat reddy Javascript 1 07-08-2011 04:17 PM
I need validation to fail on an apostrophe entered into a textbox for my regularexpression validator hamsterchaos@gmail.com ASP .Net 5 11-05-2007 10:48 PM
ASP.NET Templated User Controls - Limit child controls allowable within a templated control JohnyStyles@gmail.com ASP .Net 0 05-29-2006 06:00 PM
windows authentication: how to catch the case a user entered a wrongpassword Dan ASP .Net 2 12-07-2004 01:20 PM
Date entered from textbox becomes null (1/1/1900) when entered into SQL table. TN Bella ASP .Net 1 07-01-2004 02:53 PM



Advertisments