如题,
客户端代码:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" Debug="true" EnableSessionState="True" %><!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>Untitled Page</title>
<script language="javascript" type="text/javascript">
// <!CDATA[function sb_insert_onclick() {
var obj = document.getElementById('table1');
var mRow = obj.insertRow(-1);
var mCell = mRow.insertCell();
mCell.colspan ="3";
mCell.innerHTML="<FONT size=5>Report Online</FONT> ";
}// ]]>
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<div style="text-align: center">
<table border="0" cellpadding="0" cellspacing="0" id= "table1">
<tr>
<td colspan="3"><input type="submit" id="sb_insert" onclick="sb_insert_onclick()" /><div style="text-align: center">
</div>
</td>
</tr>
<tr><td colspan="3"><asp:TextBox ID="tbx_test" runat="server"></asp:TextBox>
</td>
</tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" id= "table2">
</table>
</div>
</div>
</form>
</body>
</html>
服务器端代码:
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;public partial class _Default : System.Web.UI.Page
{ protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
}
}
}
不知道问题出在那里了
客户端代码:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" Debug="true" EnableSessionState="True" %><!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>Untitled Page</title>
<script language="javascript" type="text/javascript">
// <!CDATA[function sb_insert_onclick() {
var obj = document.getElementById('table1');
var mRow = obj.insertRow(-1);
var mCell = mRow.insertCell();
mCell.colspan ="3";
mCell.innerHTML="<FONT size=5>Report Online</FONT> ";
}// ]]>
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<div style="text-align: center">
<table border="0" cellpadding="0" cellspacing="0" id= "table1">
<tr>
<td colspan="3"><input type="submit" id="sb_insert" onclick="sb_insert_onclick()" /><div style="text-align: center">
</div>
</td>
</tr>
<tr><td colspan="3"><asp:TextBox ID="tbx_test" runat="server"></asp:TextBox>
</td>
</tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" id= "table2">
</table>
</div>
</div>
</form>
</body>
</html>
服务器端代码:
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;public partial class _Default : System.Web.UI.Page
{ protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
}
}
}
不知道问题出在那里了
解决方案 »
- 为什么我的table内的td之间没有线呢?就是边框的线
- 关于System.Drawing设置fontfamily的问题
- 陕北吴旗娃进来看看:AspNetPager6.0 的 url 重写分页问题
- 怎么防止上传的文件重复命名
- 关于文件上载(inputfile)控件问题!
- 为什么我的cookie就是删不掉呢???望各位前辈指点!!!
- 怎么显示一个文件夹的所有文件名。
- 这个错误搞了半天了呀.还没搞定:"弹出错误:无法在web服务器上启动调试。您没有调试该服务器的权限。"
- 想了解一下现在.net企业上流行什么新技术
- 怎么用css控制datagrid的显示
- 大家看看这个问题,
- 可不可以在b1那里加一个功能进去
<input type=button onclick="sb_insert_onclick()" />
<!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>Untitled Page</title>
<script language="javascript" type="text/javascript">
// <!CDATA[function sb_insert_onclick() {
var obj = document.getElementById('table1');
var mRow = obj.insertRow();
var mCell = mRow.insertCell();
mCell.colspan ="3";
mCell.innerHTML="<FONT size=5>Report Online</FONT> ";
}// ]]>
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<div style="text-align: center">
<table border="0" cellpadding="0" cellspacing="0" id= "table1">
<tr>
<td colspan="3"><input type="submit" id="sb_insert" onclick="sb_insert_onclick()" /><div style="text-align: center">
</div>
</td>
</tr>
<tr><td colspan="3"><asp:TextBox ID="tbx_test" runat="server"></asp:TextBox>
</td>
</tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" id= "table2">
</table>
</div>
</div><input type="button" onclick="sb_insert_onclick()" value="add" /> </form>
</body>
</html>
因为你重新提交页面了, 刷新过后自然没有了2.
使用:
<input type="button" onclick="sb_insert_onclick()" value="add" />