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.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
VulpesRank #55 · 29.2K reputationPosted Jul 4, 2013, 12:46 AM EDT
";
Sunny SharmaRank #223 · 11.1K reputationPosted Jul 3, 2013, 10:11 PM EDT
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!
Iftikar HussainRank #423 · 5.9K reputationPosted Jul 3, 2013, 10:22 PM EDT
You can do this by
");
Regards,
Iftikar
Ravi ShekharRank #673 · 3.6K reputationPosted Jul 4, 2013, 12:15 AM EDT
Iftikar HussainRank #423 · 5.9K reputationPosted Jul 4, 2013, 12:25 AM EDT
Yes, you can get value by using Request.Form["textBox1"]
Regards,
Iftikar
Ravi ShekharRank #673 · 3.6K reputationPosted Jul 4, 2013, 10:39 PM EDT
Can i get value of dropdown list using Request.Form["ddl"]???