Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How to get HTML ID and value in C# codefile

Posted on 2006-07-22
1
Medium Priority
?
1,572 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 200 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Suggested Courses

670 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