Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > Best way to render a custom web control

Reply
Thread Tools

Best way to render a custom web control

 
 
DalePres
Guest
Posts: n/a
 
      06-26-2004
I have a custom web control that basically consists of a dynamically created
table and HTML checkboxes. I spent hours typing things like:

writer.AddAttribute(HtmlTextWriterAttribute.SomeAt tribute, "SomeValue");
writer.RenderBeginTag(Td);
writer.Write("Some stuff");
writer.RenderEndTag();

My question is, is there a reason for typing all that? Is there an
advantage to creating the control that way over just using:

writer.Write("<TD SomeAttribute="SomeValue">Some stuff</TD>");

Thanks,

Dale


 
Reply With Quote
 
 
 
 
Scott G.
Guest
Posts: n/a
 
      06-26-2004
A possible advantage of rendering literal HTML using the HtmlTextWriterAttribute is that someday when MS upgrades the framework you might have a better chance conforming to newer web standards -- i.e. UPPER case tags are illegal in XHTML etc.

Scott
"DalePres" <(E-Mail Removed)> wrote in message news:%(E-Mail Removed)...
I have a custom web control that basically consists of a dynamically created
table and HTML checkboxes. I spent hours typing things like:

writer.AddAttribute(HtmlTextWriterAttribute.SomeAt tribute, "SomeValue");
writer.RenderBeginTag(Td);
writer.Write("Some stuff");
writer.RenderEndTag();

My question is, is there a reason for typing all that? Is there an
advantage to creating the control that way over just using:

writer.Write("<TD SomeAttribute="SomeValue">Some stuff</TD>");

Thanks,

Dale


 
Reply With Quote
 
 
 
 
DalePres
Guest
Posts: n/a
 
      06-26-2004
That's a thought, but it's a big investment in time and effort for what may
come in the future.

I wonder if this is another case of Microsoft teaching us all how to use the
functionality just because it's there... Sort of like climbing Mount
Everest... Or, should I say Mount St. Helens... Or using Web Server Controls
when a simple HTML control will work...

Dale

"Scott G." <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
A possible advantage of rendering literal HTML using the
HtmlTextWriterAttribute is that someday when MS upgrades the framework you
might have a better chance conforming to newer web standards -- i.e. UPPER
case tags are illegal in XHTML etc.

Scott
"DalePres" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
I have a custom web control that basically consists of a dynamically created
table and HTML checkboxes. I spent hours typing things like:

writer.AddAttribute(HtmlTextWriterAttribute.SomeAt tribute, "SomeValue");
writer.RenderBeginTag(Td);
writer.Write("Some stuff");
writer.RenderEndTag();

My question is, is there a reason for typing all that? Is there an
advantage to creating the control that way over just using:

writer.Write("<TD SomeAttribute="SomeValue">Some stuff</TD>");

Thanks,

Dale


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Render web custom control Peter Kirk ASP .Net Web Controls 1 12-02-2006 08:20 PM
Page.Render do not render complete page Lau Lei Cheong ASP .Net 1 05-15-2004 04:10 AM
Web Custom Control Render Problem Billy Boy ASP .Net Web Controls 7 03-06-2004 04:01 PM
Using Table control in a custom composite control. Control does not render properly in design time. jb_in_marietta@yahoo.com ASP .Net Building Controls 1 07-02-2003 08:05 AM
Using Table control in a custom composite control. Control does not render properly in design time. jb_in_marietta@yahoo.com ASP .Net 0 07-01-2003 09:26 PM



Advertisments