Ask a Question related to ASP.NET Building Controls, Design and Development.
-
Mark Gilkes #1
Custom Control rendering
I'm overriding the Render method in a Custom Control that inherits from
WebControl. Some of the ouput code is as follows;
protected override void Render (HtmlTextWriter writer)
{
...
...
...
writer.AddAttribute(HtmlTextWriterAttribute.Class, this.CssClass);
writer.RenderBeginTag(HtmlTextWriterTag.Div);
writer.Write(this.ImageText); //Property text
writer.RenderEndTag();
...
...
}
My problem is that I want the text output to follow on from the div element.
The write method of the HtmlTextWriter seems to insist on inserting the text
on a new line when viewing the source. How can I make the output follow the
div element?
Thanks.
--
MG
Mark Gilkes Guest
-
Rendering Custom HTML in user Control
I want to create my own html in user control, Is this possible or do i have to create a custom control for that situation. If it is possible... -
Rendering Custom Control during design time
Hi, I have been creating simple custom controls that is able to be added to the Visual Studio toolbox and drag & drop to my aspx pages. The main... -
Rendering HTML in custom control
Hi Divya, Do you mean something like replacing the following: output.AddAttribute(HtmlTextWriterAttribute.Onclick,... -
Rendering DataGrid in a custom control at design time
I have built custom controls that inherit from the HtmlTable control so that they will render properly at design time. I am using a designer, since... -
Rendering graphics on a custom control
Hi, Hope someone can help me on this. I like to make an own ASP.NET charting control, so I need to render some graphics in a custom made control.... -
sam #2
Re: Custom Control rendering
Does writer.Write("<div>") instead of RenderBeginTag work?
Mark Gilkes wrote:> I'm overriding the Render method in a Custom Control that inherits from
> WebControl. Some of the ouput code is as follows;
>
> protected override void Render (HtmlTextWriter writer)
> {
> ..
> ..
> ..
> writer.AddAttribute(HtmlTextWriterAttribute.Class, this.CssClass);
> writer.RenderBeginTag(HtmlTextWriterTag.Div);
> writer.Write(this.ImageText); //Property text
> writer.RenderEndTag();
> ..
> ..
> }
>
>
> My problem is that I want the text output to follow on from the div element.
> The write method of the HtmlTextWriter seems to insist on inserting the text
> on a new line when viewing the source. How can I make the output follow the
> div element?
>
> Thanks.
> --
> MGsam Guest



Reply With Quote

