Not a problem, though usually you will have better luck on this list...

http://groups.yahoo.com/group/AspNetAnyQuestionIsOK/

You can reference the Html select control server-side, but you need to: a)
give it an ID

<select id="boroughDDL">
<option value="1234">
<option... and so forth.
</select>

and b) declare a reference to it (if you are using code-behind)...

private System.Web.UI.HtmlControls.HtmlSelect boroughDDL;

and then this should do the trick...

public void funcDDL() {
string val = boroughDDL.Items[boroughDDL.SelectedIndex].Value;
.....
....
}

Note that the ASP:DropDownList ultimately renders as an Html select control
at the browser, so from the code you've shown it's not clear why you are
using the select control directly.

HTH,

Dean Fiala
-----------------------------
Very Practical Software, Inc.
http://www.vpsw.com/links.aspx





-----Original Message-----
From: Dhaval [mailto:[EMAIL PROTECTED]
Sent: Wednesday, May 19, 2004 5:20 PM
To: [EMAIL PROTECTED]
Subject: [AspNetMetroArea] (unknown)


I actually need help with some coding issues - not sure if anyone can
help or is this the right group to post to:

---------------------------------------
I have HTML DDL with values. And I have a button for executing.
<form runat="server" name="DDL">
<select>
<option value="1234">
<option... and so forth.
</select>
<button onclick="funcDDL()"><img></button>
</form>

---------------
C# ->

public void funcDDL() {
string val = DDL.boroughDDL.items.selectedIndex;
.....
....
}

And here is the error:

The type or namespace name 'DDL' could not be found (are you missing
a using directive or an assembly reference?)

I can do it using ASP:DropDownList control but it needs to be done in
the above manner. Is it possible and if yes - could someone help
please...Thanks.






Yahoo! Groups Links









------------------------ Yahoo! Groups Sponsor ---------------------~-->
Yahoo! Domains - Claim yours for only $14.70
http://us.click.yahoo.com/Z1wmxD/DREIAA/yQLSAA/X1EolB/TM
---------------------------------------------------------------------~->

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
     http://groups.yahoo.com/group/AspNetMetroArea/

<*> To unsubscribe from this group, send an email to:
     [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
     http://docs.yahoo.com/info/terms/
 

Reply via email to