建一个工程,在该工程里加页面Parent.aspx与a.aspx。在Parent.aspx页面中加:
<table><tr><td><a href="javascript:window.showModalDialog('a.aspx','newwin','dialogHeight: 800px; dialogWidth: 600px; dialogTop: 458px; dialogLeft: 166px; edge: Raised; center: Yes; help: Yes; resizable: Yes; status: Yes;');">模式窗体</a></td></tr></table>在a.aspx页面中对DataGird进行数据库的操作(修改,删除,添加记录)
出现错误。为方便您实验,提供该页绑顶DataGrid的部分代码如下[要修改,可运行]: private void Page_Load(object sender, System.EventArgs e)
{
// 在此处放置用户代码以初始化页面
initDataGrid();
}
private void initDataGrid()
{
SqlConnection con=new SqlConnection ("Password=xxxx;Persist Security Info=True;User ID=sa;Initial Catalog=NorthWind;Data Source=xxxx");
con.Open ();
string strSQL="select * from Employees";
SqlCommand cmd=new SqlCommand (strSQL,con);
SqlDataReader dr=cmd.ExecuteReader();
DataGrid1.DataSource =dr;
DataGrid1.DataBind ();
}
<table><tr><td><a href="javascript:window.showModalDialog('a.aspx','newwin','dialogHeight: 800px; dialogWidth: 600px; dialogTop: 458px; dialogLeft: 166px; edge: Raised; center: Yes; help: Yes; resizable: Yes; status: Yes;');">模式窗体</a></td></tr></table>在a.aspx页面中对DataGird进行数据库的操作(修改,删除,添加记录)
出现错误。为方便您实验,提供该页绑顶DataGrid的部分代码如下[要修改,可运行]: private void Page_Load(object sender, System.EventArgs e)
{
// 在此处放置用户代码以初始化页面
initDataGrid();
}
private void initDataGrid()
{
SqlConnection con=new SqlConnection ("Password=xxxx;Persist Security Info=True;User ID=sa;Initial Catalog=NorthWind;Data Source=xxxx");
con.Open ();
string strSQL="select * from Employees";
SqlCommand cmd=new SqlCommand (strSQL,con);
SqlDataReader dr=cmd.ExecuteReader();
DataGrid1.DataSource =dr;
DataGrid1.DataBind ();
}
解决方案 »
- 大家提供一个好的asp:Repeater分页控件啊
- 关于数据库的问题,高手帮忙!!!
- Apache都能发布什么类型的网页
- 高手们,大家能帮个忙做个winform的页面带数据列表中带修改带删除的页面的
- DropDownList AutoPost=True,选择问题 ??
- 为什么装MSDN时,提示要我插入vs.net2005DVD光盘?
- OleDbDataReader问题
- LumiSoft.Net.dll 发送邮件
- 帮帮忙先!
- 求助:如何自定义报表中的某个字段的的范围.搞懂啦我这个问题对制作报表大有益处,大大解开你对报表的疑惑!!!!!!!!!!!!!
- 为什么登陆后打开15个到20个页面就要求重新登陆?问题解决,实现承诺再送100分,请wq85(a) 进来接分
- 问大家个很基础的问题!帮我解答一下
到底是什莫问题?
1.不要使用缓存如果可以的话:
<META http-equiv="Pragma" content="no-cache">
<META http-equiv="Cache-Control" content="no-cache">
<META http-equiv="Expires" content="0">
2.要放入操作为_self,这样写:
<base target="_self">以上都放入<head>中
Dim objNewTag As System.Web.UI.LiteralControl
objNewTag = New LiteralControl("<base target=""_self"">")
Me.Head.Controls.Add(objNewTag) Response.Expires = 0