473,395 Members | 1,608 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,395 software developers and data experts.

adding an attribute to a htmltextwriter tag.

Hi,

I am new to writing a control sorry if this question was answered.

I am writing a control where I override the RenderBeginTag, now in this
method I would like to create a DIV tag and add attributes to it.

writer.RenderBeginTag(HtmlTextWriterTag.Div);
writer.AddAttribute(HtmlTextWriterAttribute.Id, "div1");

when I view the source the DIV has no attributes ID in it, how can I
achieve this, I know I can write this

writer.WriteLine("<div id='div1'>");

Any thoughts or ideas ?

Thanks
Chaprasi

Apr 23 '06 #1
0 827

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

Similar topics

11
by: Steven D'Aprano | last post by:
Suppose I create a class with some methods: py> class C: .... def spam(self, x): .... print "spam " * x .... def ham(self, x): .... print "ham * %s" % x .......
4
by: tfortney | last post by:
I created an iframe HtmlGenericControl that has an ampersand in the "src" attribute..... Dim faxFrame As New HtmlGenericControl("iframe") faxFrame.Attributes.Add("width", "100%")...
2
by: Brian Henry | last post by:
I want to create a web custom control (not a user web control) that I can add a XML translation control into, how would I do this? I am using the web custom control as a template that I can add to...
0
by: dan | last post by:
Hi NG, i am developing an asp.net Custom control which consist of some TextBoxes, Button, ... . To let the user of that control set for example the width of the TextBox, the class has a...
5
by: Web Team | last post by:
Hi All, Can someone please explain how I go about adding a control (Say for example a panel) to a custom web control. I've tried this: Protected Overrides Sub Render(ByVal output As...
8
by: Nathan Sokalski | last post by:
I add a JavaScript event handler to some of my Webcontrols using the Attributes.Add() method as follows: Dim jscode as String = "return (event.keyCode>=65&&event.keyCode<=90);"...
2
by: Chaprasi | last post by:
Hi, I am new to writing a control sorry if this question was answered. I am writing a control where I override the RenderBeginTag, now in this method I would like to create a DIV tag and add...
4
by: wwwmike | last post by:
How can I overwrite the <FORM action=attribute? I can add new attributes with Dim xx As System.Web.UI.HtmlControls.HtmlForm xx = Page.FindControl("form1") xx.Attributes.Add("something",...
0
by: =?Utf-8?B?WFNMZXI=?= | last post by:
I am working with the Wizard class for the first time, it seems like an easy way to setup a sequential series of steps. Current I have a render method for a server control I am writing like this:...
7
by: John | last post by:
Hi there, I have a CSS based menu in a master page that uses class attributes to determine which item is currently selected. So, for example if the Homepage is currently the active page then...
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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.