Problem with html list box control

G

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

--------------------------------------------------------------------------------------------------------

in message 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
 
F

Frank Mamone

Can you post the Page_Load server-side code?

-Frank M.
in message 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
 
H

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
 
H

http://www.visual-basic-data-mining.net/forum

Thanks a lot, Grant,

I appreciate your response
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,816
Latest member
SapanaCarpetStudio

Latest Threads

Top