473,408 Members | 2,813 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

Problem with custom LinkButton and AddAttributesToRender

Hi,

I'm trying to design a custom LinkButton.
It inherits LinkButton as I need the implementation of the Click event (and
I don't know how to rewrite it).
I have to use AddAttributesToRender to render all the style attributes and
properties.
But as I want to specifie my own href attribute, I can't use LinkButton's
default AddAttributesToRender as it automatically adds its own href
attribute.
It would be great if I could call only WebControl's AddAttributesToRender
(LinkButton's parent class) but it doesn't seem possible to call it from my
class as it inherits LinkButton.
So do I need to rewrite completely WebControl's AddAttributesToRender
implementation to get rid of the href attribute added by LinkButton?
Do you have any solution?
Thanks

Henri

Nov 18 '05 #1
2 2727
Hi, Henri,

Most probably it will be possible to achieve what you need to do using
Attributes.Add("onclick", "...") on the instance instead of altering the
href attribute.

Hope this helps
Martin
"Henri" <hm********@hotmail.com> wrote in message
news:eR**************@TK2MSFTNGP09.phx.gbl...
Hi,

I'm trying to design a custom LinkButton.
It inherits LinkButton as I need the implementation of the Click event (and I don't know how to rewrite it).
I have to use AddAttributesToRender to render all the style attributes and
properties.
But as I want to specifie my own href attribute, I can't use LinkButton's
default AddAttributesToRender as it automatically adds its own href
attribute.
It would be great if I could call only WebControl's AddAttributesToRender
(LinkButton's parent class) but it doesn't seem possible to call it from my class as it inherits LinkButton.
So do I need to rewrite completely WebControl's AddAttributesToRender
implementation to get rid of the href attribute added by LinkButton?
Do you have any solution?
Thanks

Henri

Nov 18 '05 #2
Thanks Martin

"Martin Dechev" <de*******@hotmail.com> a écrit dans le message de
news:eT*************@TK2MSFTNGP11.phx.gbl...
Hi, Henri,

Most probably it will be possible to achieve what you need to do using
Attributes.Add("onclick", "...") on the instance instead of altering the
href attribute.

Hope this helps
Martin
"Henri" <hm********@hotmail.com> wrote in message
news:eR**************@TK2MSFTNGP09.phx.gbl...
Hi,

I'm trying to design a custom LinkButton.
It inherits LinkButton as I need the implementation of the Click event

(and
I don't know how to rewrite it).
I have to use AddAttributesToRender to render all the style attributes and properties.
But as I want to specifie my own href attribute, I can't use LinkButton's default AddAttributesToRender as it automatically adds its own href
attribute.
It would be great if I could call only WebControl's AddAttributesToRender (LinkButton's parent class) but it doesn't seem possible to call it from

my
class as it inherits LinkButton.
So do I need to rewrite completely WebControl's AddAttributesToRender
implementation to get rid of the href attribute added by LinkButton?
Do you have any solution?
Thanks

Henri



Nov 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: The Alchemist | last post by:
I am having a problem with a dynamically-generated Datagrid. It is important to point out that this problem does not exist with a design-time created Datagrid, but only with a dynamically generated...
1
by: Andrea | last post by:
Well, I've tried to create a stupid custom validator to validate a checked checkbox. Really simple, really stupid, but it's just for trying to do something better than standard validator, that...
0
by: Walter | last post by:
Hi, can someone please help me with my custom control viewstate problem....I haven't slept for hours trying to get this fixed. I am making two custom controls which will be included on a single...
0
by: OceanBreeze | last post by:
I have added a LinkButton to a table cell programmatically inside the Page_Load method. I also added a custom event to that link button. The same custom event is valid for all the link buttons. The...
8
by: =?Utf-8?B?QXNo?= | last post by:
Hi, I have an object, for example User. User contains various properties which i have been able to bind to successfully using wizards and the form view. However if the class User has a property...
4
by: Rick | last post by:
Hello, I built a composite web control that has a textbox and a date control. added my custom control on a webform where there are other standard controls. Each control on the form has a...
3
by: Tomasz J | last post by:
Hello Developers, I have a control derived from System.Web.UI.WebControls.WebControl. Control has this property: public string Value { set { _value = value; } get { return _value; }
7
by: =?Utf-8?B?V2ViQnVpbGRlcjQ1MQ==?= | last post by:
I'm adding subheadings to a gridview. Each sub head has a few link buttons. I'm adding the controls in the rowdatabound event code follows: sorry about the length here. I have to be missing...
16
by: pupilstuff | last post by:
hi guys i just want to perform custom paging in which at the footer of the grid view ,there must be a pager 'pervious/next with numeric' this is what i did in aspx page <asp:GridView...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.