what is usercontrol how we can use acess the controls that
are present in the usercontrol in the aspx page
suppose we have 2 text boxes in a user control how u can
acess the 2 textboxs in the aspx page
Answer Posted / om shivaya namaha
user control purpose is when ever a group of controls that
used in most of the pages then we can define those controls
as a user control
user.ascx page :-2 textboxes it is containing
textbox1
textbox2
default.aspx:- thes aspx page is going to use the user control
in design default.aspx:-
<@register tagname="User" tageprefix="US" src="user.ascx">
<table>
<tr>
<td><US:User id="Usercont" runat="server" ></td>
</tr></table>
in serverside default page:-
textbox tx=new textbox();
tx= (textbox)Usercont.findcontrol("textbox1");
| Is This Answer Correct ? | 1 Yes | 1 No |
Post New Answer View All Answers
What type of code, client-side or server-side, is found in a code-behind file of a Web page?
What are the best practices to follow to secure connection strings in an ASP.NET web application?
Why Unload event of MasterPage Calls first in ASP.net ?
How about the security in Activex DLL and Activex EXE ?
What is the difference between table and query?
Describe how ASP.NET maintains process isolation for each Web application?
How do you hide the columns?
How many types of controls are there in asp.net?
What is difference between mvc and asp.net? : Asp.Net MVC
What are the new login controls in asp.net 2.0?
What is the difference between web config and machine config files?
Can you explain autopostback?
Differentiate between namespace and assembly.
In early binding will the method invoked on com component will verify it?s existance in the system or not ?
Explain diff. Between friend and protected friend?