|
-
Jul 29th, 2005, 09:33 AM
#1
Thread Starter
New Member
how do I add attributes to a server control at design time
HI all
I have created a server control that draws out a hyperlink with some extended capabilities like adding a querystring etc. The control raises an event that I handle in the containing page. I do this by adding the "onControlAdded" attribute to the server control as shown below (in bold.)
<cc1:hyperlink onControlAdded="Bindit" runat="server" text="Shopping Cart" navigateurl="shoppingcart.aspx" enableviewstate="false" id=Hyperlink1>
Currently, I drag the control from the toolbox, drop it on the page, and then I have to type in the onControlAdded="Bindit" attribute/value. Is there anyway to automate this so that when the control is dropped on to the page at design time, this attribute/value is automatically added for me?
Any advice is appreciated!
-
Jul 29th, 2005, 10:23 AM
#2
Thread Starter
New Member
Re: how do I add attributes to a server control at design time
Right... figured it out. If anyone is interested, I just added this to my class declaration:
<DefaultProperty("PID"), DefaultEvent("ControlAdded"), ToolboxData("<{0}:HyperLink runat=server onControlAdded=Bindit></{0}:HyperLink>")>
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|