Tuesday, August 27, 2013

Get Jquery value of Dropdownlist in User control created dinamically in placeholder

Get Jquery value of Dropdownlist in User control created dinamically in
placeholder

I have a user control that contain a DropdownList. I use this user control
in a web form using a placeholder. I create this user control dynamically
I need to know, how can I get the selected value in the placeholder from
the dropdownlist in JQuery when the dropdownlist change (Postback)? This
is my user control:
<%@ Control Language="C#" AutoEventWireup="true"
CodeBehind="IVT_DropDownList.ascx.cs"
Inherits="Evi.Sc.Web.Evi.IVT.Sublayouts.IVT_DropDownList" %>
<asp:DropDownList ID="DropDownList" runat="server" AutoPostBack="True">
</asp:DropDownList>
This is the place holder:
<asp:PlaceHolder ID="plhStatusClient" runat="server"></asp:PlaceHolder>
This is the codebehind:
IVT_DropDownList UC_StatusClients =
(IVT_DropDownList)LoadControl("~/Evi/IVT/Sublayouts/IVT_DropDownList.ascx");
IvtStatusClient ivtStatusClient = new IvtStatusClient();
//Get the database to retrieve the information of the status
var lstStatusClients = ivtStatusClient.Get_AllStatusClients();
UC_StatusClients.DataSource = lstStatusClients;
UC_StatusClients.InsertFirstRow = new ListItem("All", "0");
plhStatusClient.Controls.Add(UC_StatusClients);
I'm trying with this , but doesn't works.
$("#plhStatusClient").val()

No comments:

Post a Comment