Results 1 to 10 of 10

Thread: User Control Event [VS 2005]

  1. #1

    Thread Starter
    Hyperactive Member VB IT's Avatar
    Join Date
    Feb 2003
    Posts
    381

    Question User Control Event [VS 2005]

    I make User control, make some public event. I can bind/Add event and use it, working fine
    But my event is not showing in properties window!
    How can I make event for user control that will show just like in standard asp control?
    (I not want to bind/Add event every time on every web Page where I use my user control)
    Sorry for Bad English.

  2. #2
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: User Control Event [VS 2005]

    Have you given your properties the Browsable attribute?

  3. #3

    Thread Starter
    Hyperactive Member VB IT's Avatar
    Join Date
    Feb 2003
    Posts
    381

    Re: User Control Event [VS 2005]

    My User Control's properties are browse able in Visual studio, but my Event is not!
    I want to make my events browse able in VSS 2005 just like other standard asp controls.
    Sorry for Bad English.

  4. #4
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: User Control Event [VS 2005]

    Have you defined a delegate for the event that you want to raise? If you have, then the event should show up in that property page automatically.

  5. #5

    Thread Starter
    Hyperactive Member VB IT's Avatar
    Join Date
    Feb 2003
    Posts
    381

    Re: User Control Event [VS 2005]

    Thanks fore reply

    Yes I define delegate and its working in coding by binding event using += on load form. But still not showing on properties windows!

    Quote Originally Posted by mendhak
    Have you defined a delegate for the event that you want to raise? If you have, then the event should show up in that property page automatically.
    Sorry for Bad English.

  6. #6
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: User Control Event [VS 2005]

    Just to confirm, it doesn't show up even when you click on that lightning-bolt button for events, right?

  7. #7

    Thread Starter
    Hyperactive Member VB IT's Avatar
    Join Date
    Feb 2003
    Posts
    381

    Re: User Control Event [VS 2005]

    No event show on clicking

    I attach my solution, you can see

    Quote Originally Posted by mendhak
    Just to confirm, it doesn't show up even when you click on that lightning-bolt button for events, right?
    Attached Files Attached Files
    Sorry for Bad English.

  8. #8
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: User Control Event [VS 2005]

    Ah, that clarified things, I should have read your posts properly, so I do apologize. You're making a web user control, ascx, so the answer is that you can have properties, but you can't have events showing up in the property tab in your Visual Studio IDE even though it exists for you to use in codebehind.

    The only way to do this is if you create an ASP.NET web control. (Not ascx)

  9. #9

    Thread Starter
    Hyperactive Member VB IT's Avatar
    Join Date
    Feb 2003
    Posts
    381

    Unhappy Re: User Control Event [VS 2005]

    What do you mean by ASP .NET control (Not ascx)?

    I used Web User Control Template!

    Please let me know How can I ame ASP .NET control?!

    Quote Originally Posted by mendhak
    Ah, that clarified things, I should have read your posts properly, so I do apologize. You're making a web user control, ascx, so the answer is that you can have properties, but you can't have events showing up in the property tab in your Visual Studio IDE even though it exists for you to use in codebehind.

    The only way to do this is if you create an ASP.NET web control. (Not ascx)
    Sorry for Bad English.

  10. #10
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: User Control Event [VS 2005]

    You may have used web user control template, but your end result is still an .ascx, which means that it's just a 'mini page' for lack of a better term. I believe you'll need to create a custom ASP.NET control. Look at this tutorial:

    http://www.15seconds.com/issue/040421.htm

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width