PDA

View Full Version : HtmlSelect


Internet Explorer 7 install problem
December 5th 05, 09:20 PM
I'm trying to convert a control I created programatically to a string format
so I place the created control to my page. I tried placeholder and it worked
fine, but I need to "render" the control to string format. I'm using
ASP.NET. Here's what I have.

Dim htmlSelect As New HtmlControls.HtmlSelect
htmlSelect.ID = "stage"
htmlSelect.DataSource = ds.Tables("approvalusers")
htmlSelect.DataValueField = "fname"
htmlSelect.DataBind()

' This line below does NOT work
Resonse.Write(htmlSelect)

Thanks!

Winux P
December 5th 05, 09:26 PM
microsoft.public.dotnet.framework.aspnet

Good luck with it.

- Winux P

"Internet Explorer 7 install problem"
oft.com> wrote in message
...
: I'm trying to convert a control I created programatically to a string
format
: so I place the created control to my page. I tried placeholder and it
worked
: fine, but I need to "render" the control to string format. I'm using
: ASP.NET. Here's what I have.
:
: Dim htmlSelect As New HtmlControls.HtmlSelect
: htmlSelect.ID = "stage"
: htmlSelect.DataSource = ds.Tables("approvalusers")
: htmlSelect.DataValueField = "fname"
: htmlSelect.DataBind()
:
: ' This line below does NOT work
: Resonse.Write(htmlSelect)
:
: Thanks!
:
:

Internet Explorer 7 install problem
December 6th 05, 04:43 PM
Function cts(ByVal c As Control) As String

Dim sw As New System.IO.StringWriter
Dim tw As New Html32TextWriter(sw)
c.RenderControl(tw)
cts = sw.ToString()

End Function



"Winux P" wrote:

>
> microsoft.public.dotnet.framework.aspnet
>
> Good luck with it.
>
> - Winux P
>
> "Internet Explorer 7 install problem"
> oft.com> wrote in message
> ...
> : I'm trying to convert a control I created programatically to a string
> format
> : so I place the created control to my page. I tried placeholder and it
> worked
> : fine, but I need to "render" the control to string format. I'm using
> : ASP.NET. Here's what I have.
> :
> : Dim htmlSelect As New HtmlControls.HtmlSelect
> : htmlSelect.ID = "stage"
> : htmlSelect.DataSource = ds.Tables("approvalusers")
> : htmlSelect.DataValueField = "fname"
> : htmlSelect.DataBind()
> :
> : ' This line below does NOT work
> : Resonse.Write(htmlSelect)
> :
> : Thanks!
> :
> :
>
>
>

Google