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



what is usercontrol how we can use acess the controls that are present in the usercontrol in the as..

Answer / 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

More ASP.NET Interview Questions

What are the major built-in objects in ASP.NET?

0 Answers   MindCracker,


Can you explain what inheritance is and give an example of when you might use it?

1 Answers  


What?s the difference between Codebehind="MyCode.aspx.cs" and Src="MyCode.aspx.cs"?

1 Answers   Getit, Siebel, Visual Soft,


What are the differences between the response.write() and response.output.write()?

0 Answers  


Explain diff. Betn dataset and recordset?

0 Answers  






What r the asp.net list controls and difference between them?

0 Answers  


Which is better session or viewstate?

0 Answers  


Advantage of data Reader?

2 Answers  


Describe the role of inetinfo.exe, aspnet_isapi.dll and aspnet_wp.exe in the page loading process

1 Answers   HCL, Siebel Systems, Visual Soft,


Can the validation occurs in server-side or client-side? If the validation occurs why should we do?

0 Answers   Siebel,


Which is better union or union all?

0 Answers  


How can you implement encapsulation in asp.net?

6 Answers   TCS,


Categories