Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. using dropdownlist control in update panel control but no selectedindexchange event is firing

using dropdownlist control in update panel control but no selectedindexchange event is firing

Scheduled Pinned Locked Moved ASP.NET
csharpasp-netsysadminhelpannouncement
5 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    developerit
    wrote on last edited by
    #1

    hi iam using asp.net with c# iam using dropdownlist control in update panel control but no selectedindexchange event is firing can you make a change in my code which helps me

    <asp:UpdatePanel ID="pannelupdate" runat="server" ><ContentTemplate><asp:DropDownList ID="ddlconnectivity" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddlconnectivity_SelectedIndexChanged"><asp:ListItem Value="DSL">DSL</asp:ListItem><asp:ListItem Value="Connect">Connect</asp:ListItem><asp:ListItem Value="Not Available">Not Available</asp:ListItem><asp:ListItem Value="Others">Others</asp:ListItem></asp:DropDownList></ContentTemplate><Triggers>
    <asp:AsyncPostBackTrigger ControlID="ddlconnectivity" EventName="SelectedIndexChanged" />
    </Triggers></asp:UpdatePanel>

    protected void ddlconnectivity_SelectedIndexChanged(object sender, EventArgs e)
    {
    if (ddlconnectivity.SelectedValue == "Dsl" || ddlconnectivity.SelectedValue == "Connect" || ddlconnectivity.SelectedValue == "Others")
    {

            txtconnectaccount.Visible=true;
    
        }
        else {
            txtconnectaccount.Visible = false;
        }
    }
    

    when iam selecting any item it is not performing any action and giving message use EnableEventValidation=true in page directive , i have done like this also but even though it is not performing any action. can you help correct the code which helps me

    L T H 3 Replies Last reply
    0
    • D developerit

      hi iam using asp.net with c# iam using dropdownlist control in update panel control but no selectedindexchange event is firing can you make a change in my code which helps me

      <asp:UpdatePanel ID="pannelupdate" runat="server" ><ContentTemplate><asp:DropDownList ID="ddlconnectivity" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddlconnectivity_SelectedIndexChanged"><asp:ListItem Value="DSL">DSL</asp:ListItem><asp:ListItem Value="Connect">Connect</asp:ListItem><asp:ListItem Value="Not Available">Not Available</asp:ListItem><asp:ListItem Value="Others">Others</asp:ListItem></asp:DropDownList></ContentTemplate><Triggers>
      <asp:AsyncPostBackTrigger ControlID="ddlconnectivity" EventName="SelectedIndexChanged" />
      </Triggers></asp:UpdatePanel>

      protected void ddlconnectivity_SelectedIndexChanged(object sender, EventArgs e)
      {
      if (ddlconnectivity.SelectedValue == "Dsl" || ddlconnectivity.SelectedValue == "Connect" || ddlconnectivity.SelectedValue == "Others")
      {

              txtconnectaccount.Visible=true;
      
          }
          else {
              txtconnectaccount.Visible = false;
          }
      }
      

      when iam selecting any item it is not performing any action and giving message use EnableEventValidation=true in page directive , i have done like this also but even though it is not performing any action. can you help correct the code which helps me

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      http://www.eggheadcafe.com/community/aspnet/7/10019953/dropdownlist-in-update-pa.aspx[^] Try it...

      Jinal Desai - LIVE Experience is mother of sage....

      D 1 Reply Last reply
      0
      • D developerit

        hi iam using asp.net with c# iam using dropdownlist control in update panel control but no selectedindexchange event is firing can you make a change in my code which helps me

        <asp:UpdatePanel ID="pannelupdate" runat="server" ><ContentTemplate><asp:DropDownList ID="ddlconnectivity" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddlconnectivity_SelectedIndexChanged"><asp:ListItem Value="DSL">DSL</asp:ListItem><asp:ListItem Value="Connect">Connect</asp:ListItem><asp:ListItem Value="Not Available">Not Available</asp:ListItem><asp:ListItem Value="Others">Others</asp:ListItem></asp:DropDownList></ContentTemplate><Triggers>
        <asp:AsyncPostBackTrigger ControlID="ddlconnectivity" EventName="SelectedIndexChanged" />
        </Triggers></asp:UpdatePanel>

        protected void ddlconnectivity_SelectedIndexChanged(object sender, EventArgs e)
        {
        if (ddlconnectivity.SelectedValue == "Dsl" || ddlconnectivity.SelectedValue == "Connect" || ddlconnectivity.SelectedValue == "Others")
        {

                txtconnectaccount.Visible=true;
        
            }
            else {
                txtconnectaccount.Visible = false;
            }
        }
        

        when iam selecting any item it is not performing any action and giving message use EnableEventValidation=true in page directive , i have done like this also but even though it is not performing any action. can you help correct the code which helps me

        T Offline
        T Offline
        Tej Aj
        wrote on last edited by
        #3

        add UpdateMode ="Conditional" attribute in tag Tej Aj, http://www.opexsolution.com/forum/[^]

        1 Reply Last reply
        0
        • L Lost User

          http://www.eggheadcafe.com/community/aspnet/7/10019953/dropdownlist-in-update-pa.aspx[^] Try it...

          Jinal Desai - LIVE Experience is mother of sage....

          D Offline
          D Offline
          developerit
          wrote on last edited by
          #4

          hi it is giving error when iam selecting items from drop down list no action is performing error ====== Invalid postback or callback argument. Event validation is enabled using <pages enableEventValidation="true"/> in configuration or <%@ Page EnableEventValidation="true" %> in a page. For security purposes, this feature verifies that arguments to postback or callback events originate from the server control that originally rendered them. If the data is valid and expected, use the ClientScriptManager.RegisterForEventValidation method in order to register the postback or callback data for validation. code ====

          <asp:UpdatePanel ID="pannelupdate" runat="server" UpdateMode="Conditional" ><ContentTemplate><asp:DropDownList ID="ddlconnectivity" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddlconnectivity_SelectedIndexChanged"><asp:ListItem Value="DSL">DSL</asp:ListItem><asp:ListItem Value="Connect">Connect</asp:ListItem><asp:ListItem Value="Not Available">Not Available</asp:ListItem><asp:ListItem Value="Others">Others</asp:ListItem></asp:DropDownList></ContentTemplate><Triggers>
          <asp:AsyncPostBackTrigger ControlID="ddlconnectivity" EventName="SelectedIndexChanged" />
          </Triggers></asp:UpdatePanel>

          protected void ddlconnectivity_SelectedIndexChanged(object sender, EventArgs e)
          {
          if (ddlconnectivity.SelectedValue == "Dsl" || ddlconnectivity.SelectedValue == "Connect" || ddlconnectivity.SelectedValue == "Others")
          {

                  txtconnectaccount.Visible=true;
          
              }
              else {
                  txtconnectaccount.Visible = false;
              }
          }
          

          action is not performing can you correct my code where iam going wrong.

          1 Reply Last reply
          0
          • D developerit

            hi iam using asp.net with c# iam using dropdownlist control in update panel control but no selectedindexchange event is firing can you make a change in my code which helps me

            <asp:UpdatePanel ID="pannelupdate" runat="server" ><ContentTemplate><asp:DropDownList ID="ddlconnectivity" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddlconnectivity_SelectedIndexChanged"><asp:ListItem Value="DSL">DSL</asp:ListItem><asp:ListItem Value="Connect">Connect</asp:ListItem><asp:ListItem Value="Not Available">Not Available</asp:ListItem><asp:ListItem Value="Others">Others</asp:ListItem></asp:DropDownList></ContentTemplate><Triggers>
            <asp:AsyncPostBackTrigger ControlID="ddlconnectivity" EventName="SelectedIndexChanged" />
            </Triggers></asp:UpdatePanel>

            protected void ddlconnectivity_SelectedIndexChanged(object sender, EventArgs e)
            {
            if (ddlconnectivity.SelectedValue == "Dsl" || ddlconnectivity.SelectedValue == "Connect" || ddlconnectivity.SelectedValue == "Others")
            {

                    txtconnectaccount.Visible=true;
            
                }
                else {
                    txtconnectaccount.Visible = false;
                }
            }
            

            when iam selecting any item it is not performing any action and giving message use EnableEventValidation=true in page directive , i have done like this also but even though it is not performing any action. can you help correct the code which helps me

            H Offline
            H Offline
            HardikSitapara
            wrote on last edited by
            #5

            try this .... <asp:AsyncPostBackTrigger ControlID ="YourDropDownName" EventName ="YuorEventName" />

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups