Wednesday, September 10, 2014

Java Script: Enable/Disable Server controls based on DropDownValue.

   Java Script: Enable/Disable Server controls based on      
                           DropDownValue.
Client side and Sever side also word if changes in both the places



 <script src="http://code.jquery.com/jquery-1.11.0.min.js"></script>

<script type="text/javascript">
    $(document).ready(function () {

        //Attach change event hanlder to dropdownlist
        $("#<%=DropDown1.ClientID%>").change(function () {
            //check if selected value is not equal to
            if ($(this).val() == 'Yes') {
                //Hide the button
                $("#<%=tblName.ClientID%>").hide();
                $("#<%=tbPhone.ClientID%>").hide();

            }
            if ($(this).val() == 'No')
            {
                //show the button
                $("#<%=tblName.ClientID%>").show();
                $("#<%=tbPhone.ClientID%>").show();

            }
        });
               if ($('#<%=DropDown1.ClientID %> OPTION:selected').val() == 'Yes') {
            $("#<%=tblName.ClientID%>").hide();
            $("#<%=tbPhone.ClientID%>").hide();
        }
        else {
            $("#<%=tblName.ClientID%>").show();
            $("#<%=tbPhone.ClientID%>").show();
        }
    });

    </script>




 

Monday, September 1, 2014

Error: Unknown server tag "asp:ListView"

<%@ Register TagPrefix="asp" Namespace="System.Web.UI.WebControls" Assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" %>