Not working selected check ispostback

Como pueden ver abajo, ocupe un mismo ejemplo que encontré en el foro, pero nada, lo he intentado de varias formas. 

Captura de pantalla 2021-11-28 204702.jpgCaptura de pantalla 2021-11-28 205200.jpg


1 Reply

KR Keerthana Rajendran Syncfusion Team November 29, 2021 07:30 AM UTC

Hi Cesar, 
 
Thanks for contacting Syncfusion support.  
 
We checked the reported error by rendering ejDropDownList with the shared code. We suspect that you are trying to update the label text based on the text selected from ejDropDownList. However, the given code works fine in our end.  
 
Refer to the complete code used in our end. 
 
<ej:DropDownList ID="brandSelect" runat="server" DataIdField="ID" DataTextField="Text" MultiSelectMode="Delimiter" DelimiterChar="-" ShowCheckbox="true" DataSourceCachingMode="ViewState"></ej:DropDownList> 
    <br /> 
    Selected value after post back: 
    <br /> 
    <asp:Label runat="server" ID="lbl"></asp:Label><br /> 
    <asp:Button runat="server" Text="PostBack" ID="btn1" OnClick="btn1_Click" /> 
 
Aspx.cs: 
  protected void Page_Load(object sender, EventArgs e) 
        { 
            List<Data> DropdownData = new List<Data>(); 
            DropdownData.Add(new Data { ID = "1", Text = "Top brand" }); 
            DropdownData.Add(new Data { ID = "2", Text = "Fashion brand" }); 
            DropdownData.Add(new Data { ID = "3", Text = "Latest brand" }); 
            DropdownData.Add(new Data { ID = "4", Text = "High quality" }); 
            DropdownData.Add(new Data { ID = "5", Text = "Low price" }); 
            brandSelect.DataSource = DropdownData; 
        }       
        protected void btn1_Click(object sender, EventArgs e) 
        { 
            lbl.Text = ""; 
            foreach (string val in brandSelect.Text.Split(',')) 
            { 
                lbl.Text = val + ","; 
            } 
        } 
    } 
 
The selected values are updated for labels as shown below. 
 
 
 
We have attached a sample for your reference in the following link. 
 
 
Kindly check the above sample and if the issue persists, modify the sample to replicate the exact issue along with the product version to serve you better. 
 
 
Please let us know if you need further assistance. 
 
Regards, 
Keerthana R. 


Loader.
Up arrow icon