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: Wed, 6 Jun 2007 11:36:20 -0500,    posted on: microsoft.public.dotnet.framework.aspnet.buildingcontrols        back       

Thread Index
  1    TS am
          2    TS am
          3    (Walter Wang [MSFT])
          4    TS am
          5    TS am
          6    (Walter Wang [MSFT])


Overriding renderBeginTag is bad?   
If i have a control that inherits from a class in Webcontrols (ie textbox)
and then overrides RenderBeginTag, isn't this not recommended since the
UI/Browser specific web attributes won't get set by framework? I always read
that you should override renderContents instead of the combination of
renderBeginTag, Render, RenderEndTag for this reason.

Does anyone agree or disagree?

thanks!
Date:Wed, 6 Jun 2007 11:36:20 -0500   Author:  

Re: Overriding renderBeginTag is bad?   
I guess maybe if you call the base implementation inside the render methods,
these UI/browser attributes would get set and no issues would be seen?


"TS" <manofsteele1@nospam.nospam> wrote in message
news:OQRCSjFqHHA.3888@TK2MSFTNGP05.phx.gbl...

> If i have a control that inherits from a class in Webcontrols (ie textbox)
> and then overrides RenderBeginTag, isn't this not recommended since the
> UI/Browser specific web attributes won't get set by framework? I always
read
> that you should override renderContents instead of the combination of
> renderBeginTag, Render, RenderEndTag for this reason.
>
> Does anyone agree or disagree?
>
> thanks!
>
>
Date:Wed, 6 Jun 2007 11:41:44 -0500   Author:  

Re: Overriding renderBeginTag is bad?   
Hi TS,

I think this will depend on what's the design objective of your control. 
The default implementation of RenderBeginTag will render the control's open 
tag. If you need to completely control how the resulting HTML, feel free to 
override it.

Please feel free to let me know your detailed requirement of the control so 
that we can further discuss it. Thanks.

Regards,
Walter Wang (wawang@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
Date:Thu, 07 Jun 2007 05:39:28 GMT   Author:  

Re: Overriding renderBeginTag is bad?   
well my point is that i am just curious whether UI/Browser specific web
attributes won't get set by framework in this implementation

"Walter Wang [MSFT]"  wrote in message
news:BH2eQZMqHHA.3892@TK2MSFTNGHUB02.phx.gbl...

> Hi TS,
>
> I think this will depend on what's the design objective of your control.
> The default implementation of RenderBeginTag will render the control's
open
> tag. If you need to completely control how the resulting HTML, feel free
to
> override it.
>
> Please feel free to let me know your detailed requirement of the control
so
> that we can further discuss it. Thanks.
>
> Regards,
> Walter Wang (wawang@online.microsoft.com, remove 'online.')
> Microsoft Online Community Support
>
> ==================================================
> When responding to posts, please "Reply to Group" via your newsreader so
> that others may learn and benefit from your issue.
> ==================================================
>
> This posting is provided "AS IS" with no warranties, and confers no
rights.
>
Date:Thu, 7 Jun 2007 13:09:25 -0500   Author:  

Re: Overriding renderBeginTag is bad?   
can you confirm this statement in my last post?


"TS" <manofsteele1@nospam.nospam> wrote in message
news:eopO87SqHHA.4768@TK2MSFTNGP02.phx.gbl...

> well my point is that i am just curious whether UI/Browser specific web
> attributes won't get set by framework in this implementation
>
> "Walter Wang [MSFT]"  wrote in message
> news:BH2eQZMqHHA.3892@TK2MSFTNGHUB02.phx.gbl...
> > Hi TS,
> >
> > I think this will depend on what's the design objective of your control.
> > The default implementation of RenderBeginTag will render the control's
> open
> > tag. If you need to completely control how the resulting HTML, feel free
> to
> > override it.
> >
> > Please feel free to let me know your detailed requirement of the control
> so
> > that we can further discuss it. Thanks.
> >
> > Regards,
> > Walter Wang (wawang@online.microsoft.com, remove 'online.')
> > Microsoft Online Community Support
> >
> > ==================================================
> > When responding to posts, please "Reply to Group" via your newsreader so
> > that others may learn and benefit from your issue.
> > ==================================================
> >
> > This posting is provided "AS IS" with no warranties, and confers no
> rights.
> >
>
>
Date:Mon, 11 Jun 2007 07:48:08 -0500   Author:  

Re: Overriding renderBeginTag is bad?   
Hi TS,

Sorry for the delay. 

Based on my understanding, your question is actually about how ASP.NET 
renders differently for different browser/device. 

If you take a look at the WebControl.RenderBeginTag using Reflector 
(http://www.aisto.com/roeder/dotnet/), you will see it's calling into the 
HtmlTextWriter.RenderBeginTag to do the rendering. The default 
HtmlTextWriter renders HTML 4.0-compliant markup; and the Html32TextWriter, 
which renders HTML 3.2-compliant markup. (The Html32TextWriter class is 
derived from the HtmlTextWriter class)

When the Page class enters its render stage, it starts by creating a new 
HtmlTextWriter instance. It determines what class instance to create - 
HtmlTextWriter or Html32TextWriter - by inspecting the TagWriter property 
of the Browser object. The Browser object contains read-only properties 
that provides information about the browser that was used to request the 
page. A web browser is identified by its User-Agent string.

Whenever a Web browser requests a page, it sends along a User-Agent string 
in the HTTP headers that is used to identify the browser. The ASP.NET 
engine examines the User-Agent string to determine the value for the 
Browser's properties. 

Therefore for your original question about overriding 
WebControl.RenderBeginTag, as long as you're using the HtmlTextWriter 
reference to output the text, it should still be adaptive for different 
browser/device.

Hope this helps. Please feel free to let me know if there's anything 
unclear. Thanks.


Regards,
Walter Wang (wawang@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
Date:Tue, 12 Jun 2007 11:42:39 GMT   Author:  

Google
 
Web dotnetnewsgroup.com


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