Re: Get Value of Non-ASP.NET Control
- From: "Mark Rae [MVP]" <mark@xxxxxxxxxxxxxxxxx>
- Date: Fri, 2 Jan 2009 00:12:08 -0000
"Jonathan Wood" <jwood@xxxxxxxxxxxxxxxx> wrote in message news:esUwKPGbJHA.1272@xxxxxxxxxxxxxxxxxxxxxxx
I'm rendering a listbox from code rather than using the ASP.NET ListBox control. So I write <select> and <option> tags to the output.
Hmm - any particular reason...?
Yes, the one I described in my original post.
Assuming all you're trying to achieve is to indent the text portions of the list options, there's no need to do any of this...
Were you just going to express disbelief, or did you have a comment?
The latter...
I really think I have addressed this more than you are giving me credit for.
OK...
I'm happy to post some specific part of the code if you ask.
Now we're getting somewhere...
// Note: We need to render listbox manually do allow unencoded " "
No we don't...
<asp:ListBox ID="lstTest" runat="server" />
lstTest.Items.Add(new ListItem("Please choose a category for this submission...", "-1"));
lstTest.Items.Add(new ListItem(HttpUtility.HtmlDecode(" ") + "First option", "1"));
lstTest.Items.Add(new ListItem(HttpUtility.HtmlDecode(" ") + "Second option", "2"));
lstTest.Items.Add(new ListItem(HttpUtility.HtmlDecode(" ") + "Third option", "3"));
lstTest.Items.Add(new ListItem(HttpUtility.HtmlDecode(" ") + "Fourth option", "4"));
--
Mark Rae
ASP.NET MVP
http://www.markrae.net
.
- Follow-Ups:
- Re: Get Value of Non-ASP.NET Control
- From: Jonathan Wood
- Re: Get Value of Non-ASP.NET Control
- References:
- Get Value of Non-ASP.NET Control
- From: Jonathan Wood
- Re: Get Value of Non-ASP.NET Control
- From: Mark Rae [MVP]
- Re: Get Value of Non-ASP.NET Control
- From: Jonathan Wood
- Re: Get Value of Non-ASP.NET Control
- From: Mark Rae [MVP]
- Re: Get Value of Non-ASP.NET Control
- From: Jonathan Wood
- Get Value of Non-ASP.NET Control
- Prev by Date: Re: Gridview Select Row Question
- Next by Date: Re: Gridview Select Row Question
- Previous by thread: Re: Get Value of Non-ASP.NET Control
- Next by thread: Re: Get Value of Non-ASP.NET Control
- Index(es):
Relevant Pages
|