GetSelectedValue

public static string GetSelectedValue(this System.Web.UI.WebControls.DropDownList ddl)
{
    return System.Web.HttpContext.Current.Request.Form[ddl.UniqueID];
}
Example:
string sValue = ddlSampleDropDown.GetSelectedValue();

Description

Get the selected value of a DropDownList by returning the value stored in the forms collection. This allows you to turn EnableViewState off on a DropDownList and still easily retrieve the selected value

Details

Double click on the code to select all.

 

;