Click here to Skip to main content
15,910,981 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
In my projects use same text box may pages show i want same validation in every where
any Suggestion How Maintain.
Posted

just put them in a usercontrol and put the same usercontrol everywhere
and to get the text of the textbox use this in the page code where added the usercontrol
C#
((TextBox)this.usercontolid.FindControl('the_text_box_id')).Text
 
Share this answer
 
You can move the scripts into separate js file & you can call that every page. Or if you are using Validation controls then you may create user controls.
 
Share this answer
 
By using this technique you can solve your problem

here txt_my_control is your <b>control Id</b>
TextBox box1 = (TextBox)Gridview1.Rows[i].Cells[2].FindControl("txt_my_control");
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900