Suppose I have 5 textbox named txtRate1,txtRate2,txtRate3,txtRate3,txtRate3
all are asp control.
I want to get values using for loop .
for(int i=1; i<=5; i++)
{
string s= ("txtRate"+i).Text;
}
it gives error .
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
VulpesPosted Jul 4, 2013, 4:46 AM
";
Ravi ShekharPosted Jul 5, 2013, 2:39 AM
Can i get value of dropdown list using Request.Form["ddl"]???
Iftikar HussainPosted Jul 4, 2013, 4:25 AM
Yes, you can get value by using Request.Form["textBox1"]
Regards,
Iftikar
Ravi ShekharPosted Jul 4, 2013, 4:15 AM
Iftikar HussainPosted Jul 4, 2013, 2:22 AM
You can do this by
");
Regards,
Iftikar
Sunny SharmaPosted Jul 4, 2013, 2:11 AM
You want to do this server side or client side. If it's client side then I suggest you use JavaScript or jQuery. And if it's server side, then just loop through all the control in parent container and check if it's a textbox.
Reply back if any clarification required.
Cheers!