Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > General Computer Discussion > General Computer Support > VB .NET: How to extract the value of a textbox in a GridView TemplateField?

Reply
Thread Tools

VB .NET: How to extract the value of a textbox in a GridView TemplateField?

 
 
k3nz0 k3nz0 is offline
Junior Member
Join Date: Feb 2009
Posts: 2
 
      02-25-2009
Hi All,

I have a GridView and inside this GridView I only have one TemplateField. Inside this TemplateField, I have plenty of textboxes. Values of these textboxes are extracted from the database.

One of the textboxes is called txt_CarFeatures (this is the ID). Value of this textbox is extracted from the database, using Bind("CarFeatures"). There is no problem populating the value into the textbox.

My problem is how to get the value from the textbox.
I am trying to get the value from this txt_CarFeatures textbox and use it for something else.
For example: after getting populated, txt_CarFeatures has "abcd123" in it. I am trying to get this "abcd123" and use it for something else.

I did some research and found some information about FindControl. But I have no idea how to use it and not sure whether this is the solution.

Please advise. Thanks.
 
Reply With Quote
 
 
 
 
k3nz0 k3nz0 is offline
Junior Member
Join Date: Feb 2009
Posts: 2
 
      03-01-2009
Resolved. I used the following:
Dim test As TextBox test= CType(gridView_SearchResultDetails.Rows(0).Cells(0 ).FindControl("txt_Test1"), TextBox)
Hope this is useful for those who have smilar issue.
 
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
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
Pass value from activex textbox to webform textbox AGSHAR ASP .Net 1 05-31-2008 12:00 PM
How do i extract vidios when winrar wont extract them??? help plzzzzzzzz smuttdog@sc.rr.com Computer Support 2 12-23-2007 07:03 AM
Loop Form - extract display 'value' as well as form value? ASP General 2 02-20-2006 09:36 PM
ASP.NET textbox loses text value in composite control but Textbox subclass doesn't!? ErwinP ASP .Net Web Controls 1 08-19-2005 01:50 PM



Advertisments