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


Please Help Members By Posting Answers For Below Questions

What is event bubbling?

608


What is custom attribute?

571


Explain the different types of directives in .net?

521


Which namespace is used by ado.net?

566


Why is asp.net so popular?

511






Define the steps to set up validation control.

582


How you can stop the validation of ASP.NET controls from client side?

530


What is the use of response redirect in asp.net?

579


Explain cookies with example.

558


WSDL means?

667


Is asp.net is a programming language?

494


Is asp net front end or backend?

530


What is the difference between localization and globalization?

563


Elaborate differentiation between Cache and Application?

539


what is meant by sitemapnode ?

1505