HOW USE SELECTEDINDEXCHANGED FROM DROPDOWNLIST IN CLIENTSIDE AND SERVERSIDE

Ankita Pandey

Total Post:183

Points:1285
Posted by  Ankita Pandey
 1074  View(s)
Ratings:
Rate this:

In clientside i want call javascript funcition!

 

<script type="text/javascript">

function changeCursor() {

    document.body.style.cursor="progress";

}

</script>

 

<asp:DropDownList ID="DropDownSubject" runat="server" DataTextField="Word" AutoPostBack="True" OnSelectedIndexChanged="SelectedChange">

</asp:DropDownList>

SelectedChange is a name of function in clientside!

Thanks for help!

  1. Sumit Kesarwani

    Post:378

    Points:2694
    Re: How use selectedIndexChanged from dropdownlist in clientSide and ServerSide

    Hi Ankita, 


    In Code behind

    <asp:DropDownList ID="DropDownSubject" runat="server" DataTextField="Word" AutoPostBack="True" OnSelectedIndexChanged="SelectedChange" onchange="YourChangeFun(this);">

    </asp:DropDownList>

    In javascript

    <script type="text/javascript">

          function YourChangeFun(ddl)

          {

             alert(ddl.selectedIndex);

          }

    </script>

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!