Solved

How to get HTML ID and value in C# codefile

Posted on 2006-07-22
1
1,522 Views
Last Modified: 2012-05-05
How to get the value of what I have selected in this HTML

<select name="sel_mysel" id="sel_mysel">
<option value="1">Sel1</option>
<option value="2">Sel2</option>
<option value="3">Sel3</option>
</select>

in my c# codefile.... I and using asp.net 2.x



I don't want to use the
<asp:DropDownList ID="DropDownList1" runat="server">
    </asp:DropDownList>
Then I know how to do it
0
Comment
Question by:m-jansen
1 Comment
 
LVL 9

Accepted Solution

by:
jonorossi earned 50 total points
ID: 17160675
If you put a runat="server" on the select element node you can use it like a server control:
<select name="sel_mysel" id="sel_mysel" runat="server">

Example Codebehind:
        if (IsPostBack)
        {
            Response.Write(sel_mysel.Value);
        }
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Lots of people ask this question on how to extend the “MembershipProvider” to make use of custom authentication like using existing database or make use of some other way of authentication. Many blogs show you how to extend the membership provider c…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now