DotNetNewsgroup.com  
web access to complete list of Microsoft.NET newsgroups
   home   |   control panel login   |   archive  |  
 
  carried group
academic
adonet
aspnet
aspnet.announcements
aspnet.buildingcontrols
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
assignment_manager
datatools
dotnet.distributed_apps
dotnet.general
dotnet.myservices
dotnet.nternationalization
dotnet.scripting
dotnet.security
dotnet.vjsharp
dotnet.vsa
dotnet.xml
dotnetfaqs
framework
framework.clr
framework.compactframework
framework.component_services
framework.controls
framework.databinding
framework.drawing
framework.enhancements
framework.interop
framework.odbcnet
framework.performance
framework.remoting
framework.sdk
framework.setup
framework.webservices
framework.windowsforms
framework.wmi
frwk.windowsforms.designtime
lang.csharp
lang.jscript
lang.vb
lang.vb.controls
lang.vb.data
lang.vb.upgrade
lang.vc
lang.vc.libraries
  
 
start date: Tue, 24 Jul 2007 23:04:49 +0800,    posted on: microsoft.public.dotnet.framework.aspnet.webcontrols        back       

Thread Index
  1    jiatiejun
          2    Steve C. Orr [MCSD, MVP, CSM, ASP Insider]


derived custom controls from Button or ImageButton   
I want write a custom controls (Button or ImageButton derived)

and want set the "name" tag to my custom value

use this.Attributes["name"] = "MyNameValue";

or writer.AddAttribute(HtmlTextWriterAttribute.Name, "MyNameValue");

asp.net add my "name" tag

but itself name tag still exists

result HTML code:

<input type="submit" name="MyButton1" value="" id="MyButton1" 
name="MyNameValue" />
---------------------------^^^^^^^^^ Button base class 
+^^^^^^^^^^^ I add name tag
-------------------------------------------------------------------+

how to remove Button base class name tag ?


thanks
Date:Tue, 24 Jul 2007 23:04:49 +0800   Author:  

Re: derived custom controls from Button or ImageButton   
Try this:

In the control's constructor, set  this.Name = "MyNameValue";

You may also want to explore using the TagPrefix attribute and the 
ToolboxData attribute.
Here's more info on those:
http://msdn2.microsoft.com/en-us/library/system.web.ui.tagprefixattribute(VS.71).aspx
http://msdn2.microsoft.com/en-us/library/system.web.ui.toolboxdataattribute(VS.71).aspx

-- 
I hope this helps,
Steve C. Orr,
MCSD, MVP, CSM, ASPInsider
http://SteveOrr.net


"jiatiejun"  wrote in message 
news:%23ISj9PgzHHA.4928@TK2MSFTNGP03.phx.gbl...

>I want write a custom controls (Button or ImageButton derived)
>
> and want set the "name" tag to my custom value
>
> use this.Attributes["name"] = "MyNameValue";
>
> or writer.AddAttribute(HtmlTextWriterAttribute.Name, "MyNameValue");
>
> asp.net add my "name" tag
>
> but itself name tag still exists
>
> result HTML code:
>
> <input type="submit" name="MyButton1" value="" id="MyButton1" 
> name="MyNameValue" />
> ---------------------------^^^^^^^^^ Button base class +^^^^^^^^^^^ I add 
> name tag
> -------------------------------------------------------------------+
>
> how to remove Button base class name tag ?
>
>
> thanks
>
>
> 
Date:Wed, 25 Jul 2007 07:22:02 -0700   Author:  

Google
 
Web dotnetnewsgroup.com


COPYRIGHT ?2005, EUROFRONT WORLDWIDE LTD., ALL RIGHT RESERVE  |   Contact us