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! :confused:
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)
Re: User Control Event [VS 2005]
Have you given your properties the Browsable attribute?
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.
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.
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.
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?
1 Attachment(s)
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?
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)
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)
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