• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 272
  • Last Modified:

Handle event from Web Custom Control on the Web Form


I have a Web Custom Control that has a Logout button. I would like to include this Web Custom Control on every page of my app. Now,

1) If I include all the code that's in the control on a web form everything works fine
2) If I move all the code from the web form to the Web Custom Control and include this control on the web form when I click on Logout nothing happens.

What am I missing?

  • 2
1 Solution
Please look at the following topic:

Title: Handling User Control Events
URL: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconhandlingpageletevents.asp

Best, Nauman.
There shouldn't be any problem in 2. Check out that the events are attached and getting fired properly.

Also, why are you using Web Custom Control? you should try to use Web User Control instead.

neteleAuthor Commented:
Thanks for the replies. I am using a Web User Control... sorry, got the names confused.

I just can't understand why it isn't working...

Hello netele,

double click on your SignOut button on your WebUserControl and check out that it's pointing to the correct event.

Or paste your code of SignOut.


Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now