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
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Deepak Kumar ChoudharyRank #4,523 · 339 reputationPosted Sep 23, 2014, 12:45 AM EDT
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.
Prasham SabadraRank #116 · 19.3K reputationPosted Sep 23, 2014, 12:46 AM EDT
Just high level approach:
- You can have QueryString parameter
- In the user control event where actual code is, just verify that if query string parameter value say login then only execute the code
- If it is log out the skip the user control code.
- This means your user control will be always there in master page.
I hope this will give an some idea to implement.Thanks!
Abhishek KumarRank #510 · 4.8K reputationPosted Sep 23, 2014, 1:19 AM EDT
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