Question asked by one of interviewer in panal is given
below:
We have 2 user control on same page ,1st user control
contains textbox and a button while 2nd user control have
label.
when ever we click on button click of 1st custom control
button the value of the textBox will get updated into Label
of 2nd custom control.

How to do this.Your help will be appreciated.

Answer Posted / magesh

ControlA ctrlA =
(ControlA)Page.FindControl("<usercontrolname>");
TextBox textBoxA=(TextBox)ctrlA.FindControl("<Textbox name>");

ControlB ctrlB =
(ControlB)Page.FindControl("<usercontrolname>");
Label labelB=(Label )ctrlB.FindControl("<Textbox name>");
Label.Text=TextBox.Text;

Is This Answer Correct ?    9 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What parameters can you pass in the url of the api? Can get and post use the same url?

560


What's the difference between viewstate and sessionstate?

574


What does uri mean?

503


What is application state?

518


Explain how viewstate is being formed?

544






What is difference between session and cookies?

553


How can you dynamically add user controls to a page?

519


How to use push notification?

606


Explain one critical mapping?

568


What is a form tag?

513


How Session use Cookies in State Management?

615


What is ashx file in asp.net?

553


What is a server cookie?

503


What is a SESSION and APPLICATION object?

584


Explain the use of errorprovider control in .net?

513