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
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