Please try to add client mode attribute in text box and grid view.
ClientIDMode="Static"
and here is a simple function from where you can get all values of text box
<script type = "text/javascript">
function GetAllVaues()
{
var grid = document.getElementById("<%=GridView1.ClientID%>"); // whatever the gridview id is
var inputs = grid.getElementsByTagName("input"); // or you can get by id
for(var i=0;i<inputs.length;i++)
{
if(inputs[i].type =="text")
{
alert(inputs[i].value);
}
}
}
</script>
if you want the specific row text box value then you can use
grid.cells[2].getElementsByTagName("input")[0];
Hope it helps.
If my solution works for you, please mark it as answer! It will help others.
Get more information: http://codemovement.pk
MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue.
If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.
Member
399 Points
1101 Posts
how to find my control
Nov 01, 2016 12:18 PM|asp.ambur|LINK
hello
This is my code
but in client side it changed ct_103, So is any other best option to find my control. I use TAQ inside master page with updatepanel
need proper code
Thanks
Participant
1222 Points
371 Posts
Re: how to find my control
Nov 01, 2016 12:28 PM|shivigupta31web|LINK
Hi asp.ambur,
To get the asp controls in javascript you will have to use the tags <%=%>
where txtAQ is the name of the textbox provided.
Hope this helps.
Stay humble.
Member
399 Points
1101 Posts
Re: how to find my control
Nov 01, 2016 01:43 PM|asp.ambur|LINK
My Page is in Master Page & Inside update panel there is gridview in gridview one item template texbox "txtAQ"
so need the right query to find the control
Thanking You
Contributor
3310 Points
868 Posts
Re: how to find my control
Nov 01, 2016 02:00 PM|senthilwaits|LINK
Please refer this for Master page
https://forums.asp.net/t/2034467.aspx?Accessing+controls+via+jQuery+when+using+master+pages
You can add a CSS class to your control and find the control inside Gridview as mentioned in the following thread
http://stackoverflow.com/questions/10944630/find-textbox-in-gridview-in-jquery
Senthil Kumar Sundaram
Member
399 Points
1101 Posts
Re: how to find my control
Nov 01, 2016 02:14 PM|asp.ambur|LINK
will you please give me the code of javascript
It would be helpful for me
Thanks lot
Contributor
2340 Points
807 Posts
Re: how to find my control
Nov 01, 2016 03:12 PM|codemovement.pk|LINK
HI,
Please try to add client mode attribute in text box and grid view.
and here is a simple function from where you can get all values of text box
if you want the specific row text box value then you can use
Hope it helps.
Get more information: http://codemovement.pk
Thanks,
Contributor
3310 Points
868 Posts
Re: how to find my control
Nov 01, 2016 03:20 PM|senthilwaits|LINK
Please try with this
Senthil Kumar Sundaram
Member
399 Points
1101 Posts
Re: how to find my control
Nov 01, 2016 03:42 PM|asp.ambur|LINK
Contributor
2340 Points
807 Posts
Re: how to find my control
Nov 01, 2016 03:52 PM|codemovement.pk|LINK
I think you need value, but i give you code for both
Also refer below mentioned example
Get more information: http://codemovement.pk
Thanks,
Member
399 Points
1101 Posts
Re: how to find my control
Nov 01, 2016 04:10 PM|asp.ambur|LINK
still control not accessing any other method..
Thanks
Contributor
2990 Points
1210 Posts
Re: how to find my control
Nov 02, 2016 02:43 AM|Deepak Panchal|LINK
Hi asp.ambur,
did you try something like mentioned below.
Regards
Deepak
Please remember to click "Mark as Answer" the responses that resolved your issue.
If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.