In the above code I used the javascript to display textbox value in label.
And I added the mycontrol1 to the controls id’s(textbox,label) to execute javascript. Here mycontrol1 is web control id in pages where you are using this user control.
Using the Web User control in Pages:
To use web user control in our pages,first we need to Register that control.
By using Register dirictive we can register web user control.
Nextline to the Page dirictive we need to register our control.
<%@ Register TagPrefix="usercontrol" TagName="mycontrol" Src="~/MyControl.ascx" %>
In this way we Register web user control. Here any names for tagprefix and tagname. Src reuires path of the web user control.
After Registering our Web user control, we can use this control in our code with in the page.
<usercontrol:mycontrol ID="mycontrol1" runat="Server" />
Note: Observer id of user control i.e, "mycontrol". Remember we prefixed with same name in our usercontrol javascript.
<< Previous Download source code here
Subscribe
Filter by APML