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




ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
Ad


Need Dot Net Interview Questions?
Ask ExamGuru, Inc. for advice and help on Passing .Net Interviews
.Net Projects
Best-of-breed application framework for .NET projects, developed by ExamGuru, Inc. and ExamGuru IT
Free .net Help
Commission ExamGuru, Inc. and his team for your next bespoke software project
FogBUGZ
The only bug tracking system carefully crafted with one goal in mind: helping teams create great software.
Awesome Tools
If you don't know about these, you're missing out... IT Certification Questions
IT Interview Questions
Free Oracle 10g Training
MCSE Boortcamp
Cisco Study Guides
Cheap Study Guides
Exact Questions
Dot Net Interview Questions
Oracle OCP
Cheap Travel
Designer Perfumes - Wholesale Prices
Free Programming Tutorials
 
ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
 Copyright © ExamGuru, Inc. 2001-2006
Contact Us - Terms of Use - Privacy Policy - www.dot-net-guru.com - www.examguru.net - www.oraclesource.net - www.itinterviews.net - www.examguru.net/ITCertification