且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

为什么我的jquery不在内容页面内工作?

更新时间:2022-12-15 10:39:30

(document).ready(function() {
(document).ready(function() {


(\"#<%=TextBox1.ClientID %>\").datepicker();


});
</script>


<script language=\"javascript\" type=\"text/javascript\">
function ltrim(s)
{
return s.replace( /^\s*/, \"\");
}

function trim(s)
{
//s=s.replace(/^\s*/,\"\");
return s.replace(/^\s+|\s+
("#<%=TextBox1.ClientID %>").datepicker(); }); </script> <script language="javascript" type="text/javascript"> function ltrim(s) { return s.replace( /^\s*/, ""); } function trim(s) { //s=s.replace(/^\s*/,""); return s.replace(/^\s+|\s+


/g,\"\");
}
function Daily() {
var da= document.getElementById('<%=TextBox1.ClientID %>');
var ay = document.getElementById('<%=DropDownList2.ClientID %>');
var co = document.getElementById('<%=DropDownList3.ClientID %>');
var ty = document.getElementById('<%=DropDownList4.ClientID %>');

if(ltrim(da.value) == \"\")
{ da.style.background = 'Yellow'; alert(\"Please select the date of birth !\"); da.focus(); 返回 false ; }
else
{ da.style.background = 'White'; }
if (ay.selectedIndex == 0)
{ ay.style.background = 'Yellow'; alert(\"Please select the Academic Year !\"); ay.focus(); 返回 false ; }
else
{ ay.style.background = 'White'; }
if (co.selectedIndex == 0)
{ co.style.background = 'Yellow'; alert(\"Please select the Course !\"); co.focus(); 返回 false ; }
else
{ co.style.background = 'White'; }
if (ty.selectedIndex == 0)
{ ty.style.background = 'Yellow'; alert(\"Please select the type !\"); ty.focus(); 返回 false ; }
else
{ ty.style.background = 'White'; }
}





</script>

<asp:ScriptManager ID=\"scriptmanager1\" runat=\"server\"></asp:ScriptManager>
<asp:UpdatePanel ID=\"updatepanel1\" runat=\"server\">
<ContentTemplate>

<div style=\"width: 100%;\">
<table width=\"100%\" border =\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\">
<tr>
<td width=\"95%\" valign=\"top\" bgcolor=\"#FFFFFF\">
<table width=\"100%\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\">

<tr>

<td width=\"100%\" valign=\"top\">
<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"2\" style=\"background-color: #ffffff\">
<tr>
<td align=\"center\">
<%--<asp:Label ID=\"Label2\" runat=\"server\" Style=\"font-size: 14pt; color: #2B6799; font-family: Verdana\">
College Details</asp:Label>
--%>
<img src=\"images/Head/stfdaly.PNG\" />
</td>
</tr>
<tr>
<td align=\"left\" width=\"100%\">
<table width=\"66%\" align=\"center\">
<tr>
<td align=\"left\" width=\"24%\">
<asp:Label ID=\"Label3\" runat=\"server\" CssClass=\"lbl\" Text=\"Date\"></asp:Label>
</td>
<td style=\"height: 6px\" width=\"2%\">
:
</td>
<td align=\"left\" width=\"24%\">
<%--<a href=\"javascript: NewCal('TextBox1','MMDDYYYY');\">--%>
<asp:TextBox ID=\"TextBox1\" runat=\"server\" AutoCompleteType=\"Disabled\" CssClass=\"normal\"

onblur=\"this.className='normal'\" onfocus=\"this.className='focus'\" Width=\"100px\"></asp:TextBox>
<%--<img id=\"IMG3\" alt=\"\" border=\"0\" onclick=\"return IMG1_onclick()\" src=\"Date-Picker.gif\" /></a>--%>
</td>
<td align=\"left\" width=\"24%\">
<asp:Label ID=\"Label4\" runat=\"server\" CssClass=\"lbl\" Text=\"Academic Year\"></asp:Label>
</td>
<td style=\"height: 6px\" width=\"2%\">
:
</td>
<td align=\"left\" width=\"24%\">
<asp:DropDownList ID=\"DropDownList2\" runat=\"server\" Width=\"120px\">
</asp:DropDownList>
</td>
</tr>
<tr>
<td al ign=\"left\" width=\"24%\">
<asp:Label ID=\"Label5\" runat=\"server\" CssClass=\"lbl\" Text=\"Department\"></asp:Label>
</td>
<td style=\"height: 6px\" width=\"2%\">
:
</td>
<td align=\"left\" width=\"24%\">
<asp:DropDownList ID=\"DropDownList3\" runat=\"server\" Width=\"120px\">
</asp:DropDownList>
</td>
<td align=\"left\" width=\"24%\">
<asp:Label ID=\"Label6\" runat=\"server\" CssClass=\"lbl\" Text=\"Type\"></asp:Label>
</td>
<td style=\"height: 6px\" width=\"2%\">
:
</td>
<td align=\"left\" width=\"24%\">
<asp:DropDownList ID=\"DropDownList4\" runat=\"server\" Width=\"pan>120px\">
</asp:DropDownList>
</td>
</tr>
<tr>
<td align=\"center\" width=\"100%\" colspan=\"6\">
<asp:Button ID=\"Button5\" runat=\"server\" CssClass=\"Fetch\" OnClick=\"Button5_Click\"

OnClientClick=\"return Daily()\" />
</td>
</tr>
<tr>
<td align=\"right\" width=\"50%\" colspan=\"3\">
<asp:CheckBox ID=\"CheckBox1\" runat=\"server\" Font-Bold=\"True\" Text=\"Select All Morning\"

AutoPostBack=\"True\" OnCheckedChanged=\"CheckBox1_CheckedChanged\" />
</td>
<td align=\"left\" width=\"50%\" colspan=\"3\">
<asp:CheckBox ID=\"CheckBox2\" runat=\"server\" Font-Bold=\"True\" Text=\"Select All Afternoon\"

AutoPostBack=\"True\" OnCheckedChanged=\"CheckBox2_CheckedChanged\" />
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td align=\"center\">
<br />
<asp:GridView ID=\"GridView1\" runat=\"server\" AutoGenerateColumns=\"False\" Width=\"100%\"

GridLines=\"None\" CssClass=\"mGrid\" PagerStyle-CssClass=\"pgr\" BorderStyle=\"None\"

BorderWidth=\"1px\" CellPadding=\"3\" AllowPaging=\"True\" OnPageIndexChanging=\"GridVie w1_PageIndexChanging\"

Font-Names=\"MS Sans Serif\" OnRowDataBound=\"GridView1_RowDataBound\">
<Columns>
<asp:BoundField HeaderText=\"Employee\" DataField=\"EN\">
<HeaderStyle Font-Size=\"8pt\" />
</asp:BoundField>
<asp:TemplateField>
<HeaderTemplate>
Morning
</HeaderTemplate>
<ItemTemplate>
<asp:CheckBox ID=\"chk\" runat=\"server\" />
</ItemTemplate>
<ItemStyle HorizontalAlign=\"Center\" />
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:DropDownList ID=\"ddl\" runat=\"server\" DataTextField=\"LNAME\" DataValueField=\"LNAME\"

AppendDataBoundItems=\"true\">
</asp:DropDownList>
</ItemTemplate>
<ItemStyle HorizontalAlign=\"Center\" />
<HeaderTemplate>
Morning Leave
</HeaderTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:CheckBox ID=\"cb\" runat=\"server\" />
</ItemTemplate>
<ItemStyle HorizontalAlign=\"Center\" />
<HeaderTemplate>
Afternoon
</HeaderTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:DropDownList ID=\"ddl2\" runat=\"server\">
</asp:DropDownList>
</ItemTemplate>
<ItemStyle HorizontalAlign=\"Center\" />
<HeaderTemplate>
Afternoon Leave
</HeaderTemplate>
</asp:TemplateField>
</Columns>
<%--<FooterStyle BackColor=\"White\" ForeColor=\"#000066\" />
<RowStyle ForeColor=\"#000066\" />
<SelectedRowStyle BackColor=\"#669999\" Font-Bold=\"True\" ForeColor=\"White\" />
<PagerStyle BackColor=\"White\" ForeColor=\"#000066\" HorizontalAlign=\"Center\" />
<HeaderStyle BackColor=\"#006699\" Font-Bold=\"True\" ForeColor=\"White\" />
<PagerSettings Mode=\"NumericFirstLast\" />
--%>
</asp:GridView>
<asp:Label ID=\"Label2\" runat=\"server\"></asp:Label>
</td>
</tr>
<tr>
<td align=\"center\">
<asp:Button ID=\"
n>Button1\" runat=\"server\" Style=\"display: none;\" OnClick=\"Button1_Click\" />
<asp:Button ID=\"Button3\" runat=\"server\" CssClass=\"Save\" OnClick=\"Button3_Click\" />
<asp:Button ID=\"Button4\" runat=\"server\" Style=\"display: none;\" OnClick=\"Button4_Click\" />
</td>
</tr>
</table>
</td>
</tr>

</table>
</td>
</tr>
</table>
</div>


</ContentTemplate>

</asp:UpdatePanel>
</asp:Content>
/g,""); } function Daily() { var da= document.getElementById('<%=TextBox1.ClientID %>'); var ay = document.getElementById('<%=DropDownList2.ClientID %>'); var co = document.getElementById('<%=DropDownList3.ClientID %>'); var ty = document.getElementById('<%=DropDownList4.ClientID %>'); if(ltrim(da.value) == "") { da.style.background = 'Yellow'; alert("Please select the date of birth !"); da.focus(); return false; } else { da.style.background = 'White'; } if (ay.selectedIndex == 0) { ay.style.background = 'Yellow'; alert("Please select the Academic Year !"); ay.focus(); return false; } else { ay.style.background = 'White'; } if (co.selectedIndex == 0) { co.style.background = 'Yellow'; alert("Please select the Course !"); co.focus(); return false; } else { co.style.background = 'White'; } if (ty.selectedIndex == 0) { ty.style.background = 'Yellow'; alert("Please select the type !"); ty.focus(); return false; } else { ty.style.background = 'White'; } } </script> <asp:ScriptManager ID="scriptmanager1" runat="server"></asp:ScriptManager> <asp:UpdatePanel ID="updatepanel1" runat="server"> <ContentTemplate> <div style="width: 100%;"> <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td width="95%" valign="top" bgcolor="#FFFFFF"> <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td width="100%" valign="top"> <table width="100%" border="0" cellspacing="0" cellpadding="2" style="background-color: #ffffff"> <tr> <td align="center"> <%--<asp:Label ID="Label2" runat="server" Style="font-size: 14pt; color: #2B6799; font-family: Verdana"> College Details</asp:Label>--%> <img src="images/Head/stfdaly.PNG" /> </td> </tr> <tr> <td align="left" width="100%"> <table width="66%" align="center"> <tr> <td align="left" width="24%"> <asp:Label ID="Label3" runat="server" CssClass="lbl" Text="Date"></asp:Label> </td> <td style="height: 6px" width="2%"> : </td> <td align="left" width="24%"> <%--<a href="javascript: NewCal('TextBox1','MMDDYYYY');">--%> <asp:TextBox ID="TextBox1" runat="server" AutoCompleteType="Disabled" CssClass="normal" onblur="this.className='normal'" onfocus="this.className='focus'" Width="100px"></asp:TextBox> <%--<img id="IMG3" alt="" border="0" onclick="return IMG1_onclick()" src="Date-Picker.gif" /></a>--%> </td> <td align="left" width="24%"> <asp:Label ID="Label4" runat="server" CssClass="lbl" Text="Academic Year"></asp:Label> </td> <td style="height: 6px" width="2%"> : </td> <td align="left" width="24%"> <asp:DropDownList ID="DropDownList2" runat="server" Width="120px"> </asp:DropDownList> </td> </tr> <tr> <td align="left" width="24%"> <asp:Label ID="Label5" runat="server" CssClass="lbl" Text="Department"></asp:Label> </td> <td style="height: 6px" width="2%"> : </td> <td align="left" width="24%"> <asp:DropDownList ID="DropDownList3" runat="server" Width="120px"> </asp:DropDownList> </td> <td align="left" width="24%"> <asp:Label ID="Label6" runat="server" CssClass="lbl" Text="Type"></asp:Label> </td> <td style="height: 6px" width="2%"> : </td> <td align="left" width="24%"> <asp:DropDownList ID="DropDownList4" runat="server" Width="120px"> </asp:DropDownList> </td> </tr> <tr> <td align="center" width="100%" colspan="6"> <asp:Button ID="Button5" runat="server" CssClass="Fetch" OnClick="Button5_Click" OnClientClick="return Daily()" /> </td> </tr> <tr> <td align="right" width="50%" colspan="3"> <asp:CheckBox ID="CheckBox1" runat="server" Font-Bold="True" Text="Select All Morning" AutoPostBack="True" OnCheckedChanged="CheckBox1_CheckedChanged" /> </td> <td align="left" width="50%" colspan="3"> <asp:CheckBox ID="CheckBox2" runat="server" Font-Bold="True" Text="Select All Afternoon" AutoPostBack="True" OnCheckedChanged="CheckBox2_CheckedChanged" /> </td> </tr> </table> </td> </tr> <tr> <td align="center"> <br /> <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" Width="100%" GridLines="None" CssClass="mGrid" PagerStyle-CssClass="pgr" BorderStyle="None" BorderWidth="1px" CellPadding="3" AllowPaging="True" OnPageIndexChanging="GridView1_PageIndexChanging" Font-Names="MS Sans Serif" OnRowDataBound="GridView1_RowDataBound"> <Columns> <asp:BoundField HeaderText="Employee" DataField="EN"> <HeaderStyle Font-Size="8pt" /> </asp:BoundField> <asp:TemplateField> <HeaderTemplate> Morning </HeaderTemplate> <ItemTemplate> <asp:CheckBox ID="chk" runat="server" /> </ItemTemplate> <ItemStyle HorizontalAlign="Center" /> </asp:TemplateField> <asp:TemplateField> <ItemTemplate> <asp:DropDownList ID="ddl" runat="server" DataTextField="LNAME" DataValueField="LNAME" AppendDataBoundItems="true"> </asp:DropDownList> </ItemTemplate> <ItemStyle HorizontalAlign="Center" /> <HeaderTemplate> Morning Leave </HeaderTemplate> </asp:TemplateField> <asp:TemplateField> <ItemTemplate> <asp:CheckBox ID="cb" runat="server" /> </ItemTemplate> <ItemStyle HorizontalAlign="Center" /> <HeaderTemplate> Afternoon </HeaderTemplate> </asp:TemplateField> <asp:TemplateField> <ItemTemplate> <asp:DropDownList ID="ddl2" runat="server"> </asp:DropDownList> </ItemTemplate> <ItemStyle HorizontalAlign="Center" /> <HeaderTemplate> Afternoon Leave </HeaderTemplate> </asp:TemplateField> </Columns> <%--<FooterStyle BackColor="White" ForeColor="#000066" /> <RowStyle ForeColor="#000066" /> <SelectedRowStyle BackColor="#669999" Font-Bold="True" ForeColor="White" /> <PagerStyle BackColor="White" ForeColor="#000066" HorizontalAlign="Center" /> <HeaderStyle BackColor="#006699" Font-Bold="True" ForeColor="White" /> <PagerSettings Mode="NumericFirstLast" />--%> </asp:GridView> <asp:Label ID="Label2" runat="server"></asp:Label> </td> </tr> <tr> <td align="center"> <asp:Button ID="Button1" runat="server" Style="display: none;" OnClick="Button1_Click" /> <asp:Button ID="Button3" runat="server" CssClass="Save" OnClick="Button3_Click" /> <asp:Button ID="Button4" runat="server" Style="display: none;" OnClick="Button4_Click" /> </td> </tr> </table> </td> </tr> </table> </td> </tr> </table> </div> </ContentTemplate> </asp:UpdatePanel> </asp:Content>