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 the exact purpose of http handlers?

564


Demonstrate Render and PreRender?

594


Difference between Response.redirect vs server.transfer?

583


How is it possible for .NET to support many languages?

300


6. Tell us about a time when you failed to meet a deadline. What were the repercussions?

1725






If we remove web.config or machine.config from the application then, is this application will works?

592


How can you send an email message from an asp.net web page?

519


What is the equivalent of date() and time() in asp.net?

513


Give me one example of Web API Routing?

597


What events will occur when a page is loaded?

571


Explain how do you validate the controls in an asp .net page?

516


How to set the pane area to transparent of a scrollPane component.?

559


Explain the concept of MVC Scaffolding?

585


What is event in asp.net?

530


Can we have a web application running without web.config file?

521