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 are the best practices to follow to secure connection strings in an ASP.NET web application?
What is asp.net architecture?
What is different in .net 1.1 and .net 2.0?
How Session outproc in Sqlserver stored?
What is the significance of finalize method in .net?
Which control has default post back is enabled(true)?
Define page output caching?
How does u get record no from 5 to 15 from a dataset of 100 records?
Explain the server control events of asp.net ?
How we implement web farm and web garden concept in asp.net?
Explain the difference between inline and code behind - which is best in?
What is cas?
How to fetch a data from one table to another table in asp.net ?
What is asp.net and how it works?
How do u deploy your asp.net application?