我想在页面下写一段JAVASCRIPT的代码来判断我两个文本框是否为空该怎么写 下面是我页面代码
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="TbLockIPmg.aspx.cs" Inherits="tieba_mg_TbLockIPmg" %>
<!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 id="Head1" runat="server">
<title>IP禁用管理</title>
</script>
<link href="../../CSS/mgcss.css" rel="stylesheet" type="text/css" />
</head>
<body style="font-size: 12pt">
<form id="form1" name ="formpage" runat="server">
<div>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:xhhyconn %>"
SelectCommand="SELECT [LockId], [StartIP], [EndIP], [LockTime] FROM [QqjyTbLockIP]" DeleteCommand="DELETE FROM [QqjyTbLockIP] WHERE [LockId] = @original_LockId AND [StartIP] = @original_StartIP AND [EndIP] = @original_EndIP AND [LockTime] = @original_LockTime" InsertCommand="INSERT INTO [QqjyTbLockIP] ([StartIP], [EndIP], [LockTime]) VALUES (@StartIP, @EndIP, @LockTime)" UpdateCommand="UPDATE [QqjyTbLockIP] SET [StartIP] = @StartIP, [EndIP] = @EndIP WHERE [LockId] = @original_LockId " ConflictDetection="CompareAllValues" OldValuesParameterFormatString="original_{0}" OnSelecting="SqlDataSource1_Selecting1">
<DeleteParameters>
<asp:Parameter Name="original_LockId" Type="Int32" />
<asp:Parameter Name="original_StartIP" Type="String" />
<asp:Parameter Name="original_EndIP" Type="String" />
<asp:Parameter Name="original_LockTime" Type="DateTime" />
</DeleteParameters>
<UpdateParameters>
<asp:Parameter Name="StartIP" Type="String" />
<asp:Parameter Name="EndIP" Type="String" />
<asp:Parameter Name="LockTime" Type="DateTime" />
<asp:Parameter Name="original_LockId" Type="Int32" />
<asp:Parameter Name="original_StartIP" Type="String" />
<asp:Parameter Name="original_EndIP" Type="String" />
<asp:Parameter Name="original_LockTime" Type="DateTime" />
</UpdateParameters>
<InsertParameters>
<asp:Parameter Name="StartIP" Type="String" />
<asp:Parameter Name="EndIP" Type="String" />
<asp:Parameter Name="LockTime" Type="DateTime" />
</InsertParameters>
</asp:SqlDataSource>
<table class="mg_table" cellspacing="1" border="0" align="center" >
<tr>
<td class="mg_td_top" colspan="3" style="height: 21px; width: 587px;" >
IP禁用管理</td>
</tr>
<tr>
<td colspan="3" style="width: 587px; height: 1px">
<span>开始IP<asp:TextBox ID="TxtStartIP" runat="server" ToolTip="格式应为***.***.***.***" Width="95px"></asp:TextBox>
<asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ControlToValidate="TxtStartIP"
ErrorMessage="IP格式错误" ValidationExpression="\b(((?!\d\d\d)\d+|1\d\d|2[0-4]\d|25[0-5])(\b|\.)){4}" ToolTip="格式应为***.***.***.***"></asp:RegularExpressionValidator>
结束IP<asp:TextBox
ID="TxtEndIP" runat="server" ToolTip="格式应为***.***.***.***" Width="95px"></asp:TextBox>
<asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server" ControlToValidate="TxtEndIP"
ErrorMessage="IP格式错误" ValidationExpression="\b(((?!\d\d\d)\d+|1\d\d|2[0-4]\d|25[0-5])(\b|\.)){4}" SetFocusOnError="True"></asp:RegularExpressionValidator>
<asp:Button ID="CmdForbidIP" runat="server" Text="禁用" OnClick="CmdForbidIP_Click" />
<asp:Button ID="CmdSearchIP" runat="server" Text="查询" OnClick="CmdSearchIP_Click" />
</span></td>
</tr>
<tr style="font-size: 12pt">
<td align="center" colspan="3" rowspan="4" valign="top" style="height: 244px; width: 587px;" >
<asp:GridView ID="GridView1" runat="server" Width="100%" AutoGenerateColumns="False" DataSourceID="SqlDataSource1" Height="214px" OnRowDataBound="GridView1_RowDataBound1" OnPageIndexChanging="GridView1_PageIndexChanging" AllowSorting="True" AllowPaging="True" OnRowUpdating="GridView1_RowUpdating">
<Columns>
<asp:BoundField DataField="LockId" HeaderText="锁定编号" InsertVisible="False" ReadOnly="True"
SortExpression="LockId" />
<asp:BoundField DataField="StartIP" HeaderText="开始IP" SortExpression="StartIP" />
<asp:BoundField DataField="EndIP" HeaderText="结束IP" SortExpression="EndIP" />
<asp:BoundField DataField="LockTime" HeaderText="锁定时间" SortExpression="LockTime" ReadOnly="True" />
<asp:CommandField HeaderText="修改" ShowEditButton="True" EditText="修改" />
<asp:TemplateField HeaderText="解锁">
<ItemTemplate>
<asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False" CommandName="Delete" CommandArgument='<%# Eval("LockId") %>'>解锁</asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</td>
</tr>
</table>
</div>
</form>
</body>
</html>