3
Answers

Add user control

Photo of renuga krishnan

renuga krishnan

10y
1.2k
1
Hi,
   I have one master page and home page. When clicking login button in master page i have to add one web user control into home page. When clciking logout buttton in master page, to hide the usercontrol.  Anyone help me.
Thanks 

Answers (3)

0
Photo of Abhishek Kumar
292 6.3k 2.7m 10y
Hi,

Please find a nice article according to your requirement.

http://www.c-sharpcorner.com/UploadFile/ishbandhu2009/how-bind-user-control-data-on-button-click-with-modal-popup/

Abhishek
0
Photo of Prasham Sabadra
NA 22.3k 3.2m 10y
Hi, 


Just high level approach:

  1. You can have QueryString parameter
  2. In the user control event where actual code is, just verify that if query string parameter value say login then only execute the code
  3. If it is log out the skip the user control code.
  4. This means your user control will be always there in master page.
I hope this will give an some idea to implement.

Thanks!


0
Photo of Deepak Kumar Choudhary
NA 376 58k 10y

Attachment website8.zip

Dear,
         I m attaching demo website  accourding to your requiremet i hope it will helpful for    you.Find the attached files.



I am using QueryString and WebUserControl properties to do that.