Search:
Namespaces
Discussions
.NET v1.1
Feedback
Problem with html list box control
Messages
Related Types
This message was discovered on
microsoft.public.dotnet.framework.aspnet
.
Post a new message to this list...
http://www.visual-basic-data-mining.net/forum
I have the following problem.
My asp.net page has one html list box control and I made that as "RUN AS SERVER" so that I could access it in client side script as well as server side script. And also I have a 2 buttons in my form one is an html button and the other a server side button. When I click on the html button using client side script I am adding some data to the list box. And when user clicks on the server side button I want to acess the contents of the list box. But the thing is the moment I click on the server side button it clears the contents og the list box (even though I made it run as server). Then I tried to do the same using an HTML text box and it works fine. It's contents never get's cleared. But the list box always clears it's contents. Could any one tell me why is this happening? How can I access the contents of the html list box from server side or how can I stop clearing of the list box contents.
Any help is greatly appriciated
--
forum member
http://www.visual-basic-data-mining.net/forum
Reply to this message...
GrantMagic
you can refer to an html control by specifying the HTML control to
runat=server (like you said you've done) but also giving it an ID to refer
to it by. E.G.
<SELECT runat="server" id="HTMLSelecct"><option></option></SELECT>
Then in the code behind the page, you reference the control with:
protected System.Web.UI.HtmlControls.
HtmlSelect
HTMSelect;
You can then refer to the control in the code with:
HTMSelect.SelectedIndex.ToString();
Not sure why its clearing, perhaps you can attach some of the code
--------------------------------------------------------------------------------------------------------
"
http://www.visual-basic-data-mining.net/forum"
; <
Click here to reveal e-mail address
> wrote
in message news:
Click here to reveal e-mail address
...
I have the following problem.
My asp.net page has one html list box control and I made that as "RUN AS
SERVER" so that I could access it in client side script as well as server
side script. And also I have a 2 buttons in my form one is an html button
and the other a server side button. When I click on the html button using
client side script I am adding some data to the list box. And when user
clicks on the server side button I want to acess the contents of the list
box. But the thing is the moment I click on the server side button it clears
the contents og the list box (even though I made it run as server). Then I
tried to do the same using an HTML text box and it works fine. It's contents
never get's cleared. But the list box always clears it's contents. Could any
one tell me why is this happening? How can I access the contents of the html
list box from server side or how can I stop clearing of the list box
contents.
Any help is greatly appriciated
--
forum member
http://www.visual-basic-data-mining.net/forum
Reply to this message...
http://www.visual-basic-data-mining.net/forum
Thanks a lot, Grant,
I appreciate your response
--
forum member
http://www.visual-basic-data-mining.net/forum
"GrantMagic" <
Click here to reveal e-mail address
> wrote in message
news:
Click here to reveal e-mail address
...
[Original message clipped]
Reply to this message...
Frank Mamone
Can you post the Page_Load server-side code?
-Frank M.
"
http://www.visual-basic-data-mining.net/forum"
; <
Click here to reveal e-mail address
> wrote
in message news:
Click here to reveal e-mail address
...
I have the following problem.
My asp.net page has one html list box control and I made that as "RUN AS
SERVER" so that I could access it in client side script as well as server
side script. And also I have a 2 buttons in my form one is an html button
and the other a server side button. When I click on the html button using
client side script I am adding some data to the list box. And when user
clicks on the server side button I want to acess the contents of the list
box. But the thing is the moment I click on the server side button it clears
the contents og the list box (even though I made it run as server). Then I
tried to do the same using an HTML text box and it works fine. It's contents
never get's cleared. But the list box always clears it's contents. Could any
one tell me why is this happening? How can I access the contents of the html
list box from server side or how can I stop clearing of the list box
contents.
Any help is greatly appriciated
--
forum member
http://www.visual-basic-data-mining.net/forum
Reply to this message...
System.Web.UI.HtmlControls.HtmlSelect
Ad
MBR BootFX
Best-of-breed application framework for .NET projects, developed by Matthew Baxter-Reynolds and MBR IT
Copyright © Matthew Baxter-Reynolds 2001-2008. '.NET 247 Software Development Services' is a trading style of MBR IT Solutions Ltd.
Contact Us
-
Terms of Use
-
Privacy Policy
-
www.dotnet247.com