1 Replies - 434 Views - Last Post: 19 July 2012 - 01:57 PM

#1 rup_nab  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 10
  • Joined: 18-June 12

javascript not getting fired

Posted 19 July 2012 - 11:55 AM

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="asp" %>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <style type="text/css">
        .style1
        {
            width: 100%;
        }
    </style>
    <script type="text/javascript" language="Javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
    <script type="text/javascript" language="javascript" src="date.js"></script>
    <script type="text/javascript"  language="javascript" src="JScript.js"></script>

    <script type="text/javascript">
        $(document).ready(function () {
            BindPageLoad();
        });
    </script>
    
    
</head>
<body>
    <form id="form1" runat="server">
    <table class="style1">
        <tr>
            <td>
                <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
                </asp:ToolkitScriptManager>
            </td>
            <td>
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td>
                Date Of joining</td>
            <td>
                <asp:TextBox ID="txtDate" runat="server" ClientIDMode="Static"></asp:TextBox>
                <asp:CalendarExtender ID="CalendarExtender1" runat="server" Format="dd-MM-yyyy" TargetControlID="txtDate">
                </asp:CalendarExtender>
            </td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td>
                &nbsp;</td>
            <td>
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td>
                Day</td>
            <td>
                <asp:Label ID="Label2" runat="server" ClientIDMode="Static"></asp:Label>
            </td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td>
                &nbsp;</td>
            <td>
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td>
                &nbsp;</td>
            <td>
                <asp:Button ID="Button1" runat="server" Text="Button" />
            </td>
            <td>
                &nbsp;</td>
        </tr>
    </table>
    <div>
    
    </div>
    </form>
</body>
</html>




js file


function BindPageLoad() {
    $('#txtDate').val().change(function () {
        var dd = Date.parseExact($('#TextBox1').html(), "dd-MM-yyyy");

     var parsedDate = new Date(yy, mm, dd, 0, 0, 0, 0);
        DOJDateChangeHandler(dd);
    }
);
}


function DOJDateChangeHandler(parsedDate) {
    //alert('hi');
    var Day = GetReleaseDay(parsedDate);
    $('#Label2').html(Day);
}

function GetReleaseDay(indate) {
    //alert('hi');
    //var indateNew = Date.parse(indate);
    var days = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
    return days[indate.GetDay()];
    }




When I placed a breakpoint,I observed that the BindPageLoad() was not geting fired even after change of text in the TextBox1.Whats the error?

This post has been edited by Dormilich: 19 July 2012 - 01:55 PM
Reason for edit:: more code tags


Is This A Good Question/Topic? 0
  • +

Replies To: javascript not getting fired

#2 Dormilich  Icon User is offline

  • 痛覚残留
  • member icon

Reputation: 3524
  • View blog
  • Posts: 10,169
  • Joined: 08-June 10

Re: javascript not getting fired

Posted 19 July 2012 - 01:57 PM

anything in the Error Console?
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1