Thanks Iftikar, Rather than looping through all controls, in the above your example, i want to get only textbox (only server control), is there any thing which i can seperate like.. if ( controltype == html) break; if(controltype == servercontrol) { do something })
No, You will not able to get client controls in ServerSide. You can only those control which are runat="server". You need to loop through only if you don't want to check control by using index in your code behind. otherwise if you know how many server control are exist, in that case you can use like
Iftikar HussainRank #423 · 5.9K reputationPosted Jul 5, 2013, 3:11 AM EDT
You can do like this
");
Regards,
Iftikar
Vishwas Kadamannaya111 reputationPosted Jul 5, 2013, 3:12 AM EDT
Vishwas Kadamannaya111 reputationPosted Jul 5, 2013, 3:13 AM EDT
Iftikar HussainRank #423 · 5.9K reputationPosted Jul 5, 2013, 3:14 AM EDT
aa
you will get out put as
LiteralControl
TextBox
LiteralControl
Button
LiteralControl
Regards,
Iftikar
Vishwas Kadamannaya111 reputationPosted Jul 5, 2013, 3:26 AM EDT
Rather than looping through all controls, in the above your example, i want to get only textbox (only server control), is there any thing which i can seperate like..
if ( controltype == html)
break;
if(controltype == servercontrol)
{ do something })
Thanks
Vish.
Iftikar HussainRank #423 · 5.9K reputationPosted Jul 5, 2013, 3:33 AM EDT
Regards,
Iftikar
Vishwas Kadamannaya111 reputationPosted Jul 5, 2013, 3:39 AM EDT
but is there any way to avoid other controls except , i mean i need to get only those controls start with
In the below case
accept : label
avoid : head,form