<body>
<form id="frmdg" runat="server">
<center><asp:DataGrid ID="dataGrid1" AutoGenerateColumns="False" AllowPaging="true" Font-Size="10" PageSize="10" PagerStyle-BackColor="#F5FFC1" PagerStyle-Mode="numericPages" PagerStyle-HorizontalAlign="center" OnPageIndexChanged="Page_Change" AlternatingItemStyle-BackColor="#EFF7FF"
OnEditCommand="MyDataGrid_Edit"
OnCancelCommand="MyDataGrid_Cancel"
OnUpdateCommand="MyDataGrid_Update"
OnDeleteCommand="datagrid1_delete"
runat="server">
<HeaderStyle HorizontalAlign="Center" ForeColor="White"
BorderColor="#6876C5" BackColor="#6C88D9"></HeaderStyle>
<columns>
<asp:EditCommandColumn
EditText="编辑"
CancelText="取消"
UpdateText="更新"
ItemStyle-Wrap="false"
HeaderText="编辑列"
HeaderStyle-Wrap="false"
/>
<asp:boundColumn HeaderText="索引"
ItemStyle-Width="20" HeaderStyle-Width="30" ReadOnly="true" datafield="Id"/>
<asp:boundColumn HeaderText="用户名" datafield="username" />
<asp:boundColumn Headertext="日期" ItemStyle-Width="120" DataField="Tdate" />
<asp:boundColumn Headertext="工程代码" ItemStyle-Width="50" ReadOnly="true" DataField="Pcode" />
<asp:boundColumn Headertext="活动代码" ItemStyle-Width="60" ReadOnly="true" DataField="Acode" />
<asp:boundColumn Headertext="内容" ItemStyle-Width="200" ReadOnly="true" DataField="Content" />
<asp:boundColumn Headertext="计划时间" ItemStyle-Width="30" ReadOnly="true" DataField="PlanTime" />
<asp:boundColumn Headertext="实际时间" ItemStyle-Width="30" ReadOnly="true" DataField="pracTime" />
<asp:boundColumn Headertext="出差地点" ItemStyle-Width="50" ReadOnly="true" DataField="evecSpot" />
<asp:boundColumn Headertext="出差天数" ItemStyle-Width="30" ReadOnly="true" DataField="evecdays" />
<asp:boundColumn Headertext="费用" ItemStyle-Width="80" ReadOnly="true" DataField="charge" />
<asp:ButtonColumn Headertext="删除列" Text= "删除" CommandName="Delete"></asp:ButtonColumn>
</columns>
<PagerStyle HorizontalAlign="Center" ForeColor="Black" Position="Top" BackColor="White" Mode="NumericPages"></PagerStyle>
</asp:DataGrid>
</center>
</form>
<form id="frmtxt" runat="server">
<table width="547" border="0" align="center">
<tr>
<td width="168" height="27" bgcolor="#FFCC33"><div align="center" class="style2">日期(yyyy/mm/dd)</div></td>
<td width="369" bgcolor="#EFEFCF"> <div align="left"><span class="style3">
<asp:TextBox ID="Last_Update_Date" TextMode="SingleLine" height="20" width=200 maxlength="19" readonly runat="server" />
<input type="button" name="change2" value="展开" onClick="show_cele_date(change2,'','',Last_Update_Date)">
</span></div></td>
</tr>
<tr>
<td height="28" bgcolor="#FFCC33">
<div align="center" class="style2">项目名称</div></td>
<td bgcolor="#EFEFCF"><asp:DropDownList ID="DDListPcode" Height="20" AutoPostBack="true" runat="server">
</asp:DropDownList>
</td>
</tr>
<tr>
<td height="24" bgcolor="#FFCC33"><div align="center" class="style2">活动<span class="style2">名称</span></div></td>
<td bgcolor="#EFEFCF"><span class="style3">
<asp:DropDownList ID="DDListAcode" Height="20" runat="server" />
</span></td>
</tr>
<tr>
<td height="23" bgcolor="#FFCC33"><div align="center" class="style2">计划时间(小时)</div></td>
<td bgcolor="#EFEFCF"><span class="style3">
<asp:TextBox ID="txtPlantime" Height="20" runat="server" />
<asp:RequiredFieldValidator ID="RegValidPtime" ControlToValidate="txtPlantime" ErrorMessage="请输入计划时间"
runat="server" />
<asp:RangeValidator id="RangvaliPTime"
ControlToValidate="txtPlantime" forecolor="red" MinimumValue="0" MaximumValue="8" type="Double" Display="Dynamic"
ErrorMessage="必需是介于0到8的数字" runat="server"
/>
</span></td>
</tr>
<tr>
<td height="28" bgcolor="#FFCC33"><div align="center" class="style2">实际时间(小时)</div></td>
<td bgcolor="#EFEFCF"><span class="style3">
<asp:TextBox ID="txtpariTime" Height="20" runat="server" />
<asp:RangeValidator id="RangvaliNTime"
ControlToValidate="txtpariTime" forecolor="red" MinimumValue="0" MaximumValue="8" type="Double" Display="Dynamic"
ErrorMessage="必需是介于0到8的数字" runat="server"
/>
</span></td>
</tr>
<tr>
<td height="29" bgcolor="#FFCC33"><div align="center" class="style2">出差地点 </div></td>
<td bgcolor="#EFEFCF"><span class="style3">
<asp:TextBox ID="txtevecSpot" Height="20" runat="server" />
<asp:Label ForeColor="#FF0000" ID="Lbldays" runat="server" />
</span></td>
</tr>
<tr>
<td height="30" bgcolor="#FFCC33"><div align="center" class="style2">出差天数</div></td>
<td bgcolor="#EFEFCF"><span class="style3">
<asp:TextBox ID="txtevecdays" Height="20" runat="server" />
</span></td>
</tr>
<tr>
<td height="28" bgcolor="#FFCC33"><div align="center" class="style2">作业费用(元)</div></td>
<td bgcolor="#EFEFCF"><span class="style3">
<asp:TextBox ID="txtprice" Height="20" runat="server" />
</span></td>
</tr>
<tr>
<td height="24" bgcolor="#FFCC33"><div align="center" class="style2">作业内容描述</div></td>
<td bgcolor="#EFEFCF"><span class="style3">
<asp:TextBox ID="txtcontent" TextMode="MultiLine" Width="400" Height="20" runat="server" />
</span> </td>
</tr>
</table>
<table width="547" border="1" align="center">
<tr bgcolor="#6C88D9">
<td height="42" bgcolor="#6C88D9"><div align="center">
<asp:Button ID="ButtonAdd" Width="60" Text="添加" OnClick="btAdd_Click" runat="server" />
</div></td>
<td ><div align="center">
<asp:Button ID="ButtonSave" width="60" Text="取消" onClick="btSave_Click" runat="server" />
</div></td>
<td ><div align="center">
<asp:Button ID="ButtonBack" width="60" Text="返回" onClick="btBack_Click" runat="server" />
</div></td>
</tr>
</table>
</form>
</body>
如上的两个表单..怎么运行时会显示在一个页面只能有一个表单的错误...大家帮帮忙啦..最好有个例子说明...重谢..!!
<form id="frmdg" runat="server">
<center><asp:DataGrid ID="dataGrid1" AutoGenerateColumns="False" AllowPaging="true" Font-Size="10" PageSize="10" PagerStyle-BackColor="#F5FFC1" PagerStyle-Mode="numericPages" PagerStyle-HorizontalAlign="center" OnPageIndexChanged="Page_Change" AlternatingItemStyle-BackColor="#EFF7FF"
OnEditCommand="MyDataGrid_Edit"
OnCancelCommand="MyDataGrid_Cancel"
OnUpdateCommand="MyDataGrid_Update"
OnDeleteCommand="datagrid1_delete"
runat="server">
<HeaderStyle HorizontalAlign="Center" ForeColor="White"
BorderColor="#6876C5" BackColor="#6C88D9"></HeaderStyle>
<columns>
<asp:EditCommandColumn
EditText="编辑"
CancelText="取消"
UpdateText="更新"
ItemStyle-Wrap="false"
HeaderText="编辑列"
HeaderStyle-Wrap="false"
/>
<asp:boundColumn HeaderText="索引"
ItemStyle-Width="20" HeaderStyle-Width="30" ReadOnly="true" datafield="Id"/>
<asp:boundColumn HeaderText="用户名" datafield="username" />
<asp:boundColumn Headertext="日期" ItemStyle-Width="120" DataField="Tdate" />
<asp:boundColumn Headertext="工程代码" ItemStyle-Width="50" ReadOnly="true" DataField="Pcode" />
<asp:boundColumn Headertext="活动代码" ItemStyle-Width="60" ReadOnly="true" DataField="Acode" />
<asp:boundColumn Headertext="内容" ItemStyle-Width="200" ReadOnly="true" DataField="Content" />
<asp:boundColumn Headertext="计划时间" ItemStyle-Width="30" ReadOnly="true" DataField="PlanTime" />
<asp:boundColumn Headertext="实际时间" ItemStyle-Width="30" ReadOnly="true" DataField="pracTime" />
<asp:boundColumn Headertext="出差地点" ItemStyle-Width="50" ReadOnly="true" DataField="evecSpot" />
<asp:boundColumn Headertext="出差天数" ItemStyle-Width="30" ReadOnly="true" DataField="evecdays" />
<asp:boundColumn Headertext="费用" ItemStyle-Width="80" ReadOnly="true" DataField="charge" />
<asp:ButtonColumn Headertext="删除列" Text= "删除" CommandName="Delete"></asp:ButtonColumn>
</columns>
<PagerStyle HorizontalAlign="Center" ForeColor="Black" Position="Top" BackColor="White" Mode="NumericPages"></PagerStyle>
</asp:DataGrid>
</center>
</form>
<form id="frmtxt" runat="server">
<table width="547" border="0" align="center">
<tr>
<td width="168" height="27" bgcolor="#FFCC33"><div align="center" class="style2">日期(yyyy/mm/dd)</div></td>
<td width="369" bgcolor="#EFEFCF"> <div align="left"><span class="style3">
<asp:TextBox ID="Last_Update_Date" TextMode="SingleLine" height="20" width=200 maxlength="19" readonly runat="server" />
<input type="button" name="change2" value="展开" onClick="show_cele_date(change2,'','',Last_Update_Date)">
</span></div></td>
</tr>
<tr>
<td height="28" bgcolor="#FFCC33">
<div align="center" class="style2">项目名称</div></td>
<td bgcolor="#EFEFCF"><asp:DropDownList ID="DDListPcode" Height="20" AutoPostBack="true" runat="server">
</asp:DropDownList>
</td>
</tr>
<tr>
<td height="24" bgcolor="#FFCC33"><div align="center" class="style2">活动<span class="style2">名称</span></div></td>
<td bgcolor="#EFEFCF"><span class="style3">
<asp:DropDownList ID="DDListAcode" Height="20" runat="server" />
</span></td>
</tr>
<tr>
<td height="23" bgcolor="#FFCC33"><div align="center" class="style2">计划时间(小时)</div></td>
<td bgcolor="#EFEFCF"><span class="style3">
<asp:TextBox ID="txtPlantime" Height="20" runat="server" />
<asp:RequiredFieldValidator ID="RegValidPtime" ControlToValidate="txtPlantime" ErrorMessage="请输入计划时间"
runat="server" />
<asp:RangeValidator id="RangvaliPTime"
ControlToValidate="txtPlantime" forecolor="red" MinimumValue="0" MaximumValue="8" type="Double" Display="Dynamic"
ErrorMessage="必需是介于0到8的数字" runat="server"
/>
</span></td>
</tr>
<tr>
<td height="28" bgcolor="#FFCC33"><div align="center" class="style2">实际时间(小时)</div></td>
<td bgcolor="#EFEFCF"><span class="style3">
<asp:TextBox ID="txtpariTime" Height="20" runat="server" />
<asp:RangeValidator id="RangvaliNTime"
ControlToValidate="txtpariTime" forecolor="red" MinimumValue="0" MaximumValue="8" type="Double" Display="Dynamic"
ErrorMessage="必需是介于0到8的数字" runat="server"
/>
</span></td>
</tr>
<tr>
<td height="29" bgcolor="#FFCC33"><div align="center" class="style2">出差地点 </div></td>
<td bgcolor="#EFEFCF"><span class="style3">
<asp:TextBox ID="txtevecSpot" Height="20" runat="server" />
<asp:Label ForeColor="#FF0000" ID="Lbldays" runat="server" />
</span></td>
</tr>
<tr>
<td height="30" bgcolor="#FFCC33"><div align="center" class="style2">出差天数</div></td>
<td bgcolor="#EFEFCF"><span class="style3">
<asp:TextBox ID="txtevecdays" Height="20" runat="server" />
</span></td>
</tr>
<tr>
<td height="28" bgcolor="#FFCC33"><div align="center" class="style2">作业费用(元)</div></td>
<td bgcolor="#EFEFCF"><span class="style3">
<asp:TextBox ID="txtprice" Height="20" runat="server" />
</span></td>
</tr>
<tr>
<td height="24" bgcolor="#FFCC33"><div align="center" class="style2">作业内容描述</div></td>
<td bgcolor="#EFEFCF"><span class="style3">
<asp:TextBox ID="txtcontent" TextMode="MultiLine" Width="400" Height="20" runat="server" />
</span> </td>
</tr>
</table>
<table width="547" border="1" align="center">
<tr bgcolor="#6C88D9">
<td height="42" bgcolor="#6C88D9"><div align="center">
<asp:Button ID="ButtonAdd" Width="60" Text="添加" OnClick="btAdd_Click" runat="server" />
</div></td>
<td ><div align="center">
<asp:Button ID="ButtonSave" width="60" Text="取消" onClick="btSave_Click" runat="server" />
</div></td>
<td ><div align="center">
<asp:Button ID="ButtonBack" width="60" Text="返回" onClick="btBack_Click" runat="server" />
</div></td>
</tr>
</table>
</form>
</body>
如上的两个表单..怎么运行时会显示在一个页面只能有一个表单的错误...大家帮帮忙啦..最好有个例子说明...重谢..!!
解决方案 »
- 关于GridView 控件的DataNavigateUrlFormatString属性疑问
- asp.net我用表格布局,插入控件之后,控件总是不能充满表格
- table取值问题
- 发现vs2005严重问题!!!
- ???如何调用控件的代码**********************************************
- 求一段简单的SQL查询语句!
- 关于返回上一页面的问题!很棘手,请各路高手提供思路!
- 请问在datalist中删除一行数据后该如何返回?(最近问题很多,麻烦了,问题解决立刻揭帖)
- 请问:我在web sy项目中建立WEB页面相对路径是:/localhost/web sy/num.aspx但是在调试时会出现路径为:http://localhost/Web%20SY/(q4dc
- 春节前最后一个问题
- 怎样结贴?
- 菜鸟问题:ASP.NET 中怎样用代码做报表 谢谢各位大侠
不可以同时有2个表单在服务器端
不过可以可以设置另外的form 不在服务器端运行
根普通的form一样
到时候post数据的时候就用Request.Form["ssss"]来接收了
只能有一个runat=server的表单一个页面