Solved

How to get HTML ID and value in C# codefile

Posted on 2006-07-22
1
1,561 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
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.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

752 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