急!请高手帮忙~!

zengqiao_bridge 2010-06-21 09:23:10
用window.open打开一个页面时全是空白,没有任何内容,但把地址复制后,打开新窗口,粘贴刚刚复制的地址上去,就可以看到内容。请问高手们,这种情况是怎么回事?如何解决~!
...全文
68 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
zengqiao_bridge 2010-06-21
  • 打赏
  • 举报
回复
前台和js应该没有什么问题的,要不然应该是全都无法正常显示才对呀
zengqiao_bridge 2010-06-21
  • 打赏
  • 举报
回复
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="site_jiancha222.aspx.cs" Inherits="site_jiancha222" validateRequest="false" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>工程工地检查记录</title>

</head>



<body >
<script src="rq.js" type="text/javascript" language="javascript" ></script>
<form id="EditForm" runat="server">
不懂装懂 2010-06-21
  • 打赏
  • 举报
回复
[Quote=引用 3 楼 zengqiao_bridge 的回复:]
CS文件如下:
public partial class site_jiancha222 : System.Web.UI.Page
{
public string connStr = WebConfigurationManager.ConnectionStrings["SqlServices"].ConnectionString;
string strSQL = "";
st……
[/Quote]
....这种问题应该不涉及到后台代码....还是检查下js和前台代码
zengqiao_bridge 2010-06-21
  • 打赏
  • 举报
回复
注:只是个别地方的机子无法正常显示,其他都没有问题。
zengqiao_bridge 2010-06-21
  • 打赏
  • 举报
回复
CS文件如下:
public partial class site_jiancha222 : System.Web.UI.Page
{
public string connStr = WebConfigurationManager.ConnectionStrings["SqlServices"].ConnectionString;
string strSQL = "";
string gcName = "";
string id_str = "";
string gcName_str = "";


protected void Page_Load(object sender, EventArgs e)
{
SqlConnection conn = new SqlConnection(connStr);
gcName = Request.QueryString["gcName"].ToString();
id_str = Request.QueryString["recordID"].ToString();
Response.Cache.SetExpires(DateTime.Now);
if (!IsPostBack)
{

if (id_str != null && id_str != "")
{
if (conn.State.ToString() == "Closed") conn.Open();
strSQL = "SELECT * FROM 工程检查记录 WHERE (id = " + id_str + ") AND (gcName = '" + gcName + "')";
SqlCommand MyCommand2 = new SqlCommand(strSQL, conn);
SqlDataAdapter adp = new SqlDataAdapter(MyCommand2);
DataSet ds = new DataSet();
adp.Fill(ds);
if (conn.State.ToString() == "Open") conn.Close();
//gdName, gdAddr, sgdw, jldw, sgdwlxrdh, jldwlxrdh, xmjldh, jsdwlxrdh, xygrs, zdsrs, hmzcqk, glrys, ldhtqdqk, qdrs, htys, grgsffqk,

//pakblqk,syqk, blfs, blrs, clkzfqk, ygysqdhtqk, sfaszf, ywtq, gckzfqk, yfk, jdk, jcyj, bz, xcr, sgfzrqm, jlfzrqm, context, rq, gcName
TextBox1.Text = ds.Tables[0].Rows[0]["gdName"].ToString();
TextBox2.Text = ds.Tables[0].Rows[0]["gdAddr"].ToString();
TextBox3.Text = ds.Tables[0].Rows[0]["sgdw"].ToString();
TextBox29.Text = ds.Tables[0].Rows[0]["jldw"].ToString();
TextBox5.Text = ds.Tables[0].Rows[0]["sgdwlxrdh"].ToString();
TextBox6.Text = ds.Tables[0].Rows[0]["jldwlxrdh"].ToString();
TextBox7.Text = ds.Tables[0].Rows[0]["xmjldh"].ToString();
TextBox8.Text = ds.Tables[0].Rows[0]["jsdwlxrdh"].ToString();
TextBox9.Text = ds.Tables[0].Rows[0]["xygrs"].ToString();
TextBox10.Text = ds.Tables[0].Rows[0]["zdsrs"].ToString();
TextBox11.Text = ds.Tables[0].Rows[0]["hmzcqk"].ToString();
TextBox12.Text = ds.Tables[0].Rows[0]["glrys"].ToString();
TextBox13.Text = ds.Tables[0].Rows[0]["ldhtqdqk"].ToString();
TextBox14.Text = ds.Tables[0].Rows[0]["qdrs"].ToString();
TextBox15.Text = ds.Tables[0].Rows[0]["htys"].ToString();
TextBox16.Text = ds.Tables[0].Rows[0]["grgsffqk"].ToString();
TextBox17.Text = ds.Tables[0].Rows[0]["pakblqk"].ToString();
TextBox18.Text = ds.Tables[0].Rows[0]["syqk"].ToString();
TextBox19.Text = ds.Tables[0].Rows[0]["blfs"].ToString();
TextBox20.Text = ds.Tables[0].Rows[0]["blrs"].ToString();
TextBox21.Text = ds.Tables[0].Rows[0]["clkzfqk"].ToString();
TextBox22.Text = ds.Tables[0].Rows[0]["ygysqdhtqk"].ToString();
TextBox23.Text = ds.Tables[0].Rows[0]["sfaszf"].ToString();
TextBox24.Text = ds.Tables[0].Rows[0]["ywtq"].ToString();
TextBox25.Text = ds.Tables[0].Rows[0]["gckzfqk"].ToString();
TextBox26.Text = ds.Tables[0].Rows[0]["yfk"].ToString();
TextBox27.Text = ds.Tables[0].Rows[0]["jdk"].ToString();
TextBox28.Text = ds.Tables[0].Rows[0]["jcyj"].ToString();
TextBox30.Text = ds.Tables[0].Rows[0]["bz"].ToString();
TextBox31.Text = ds.Tables[0].Rows[0]["xcr"].ToString();
TextBox32.Text = ds.Tables[0].Rows[0]["sgfzrqm"].ToString();
TextBox33.Text = ds.Tables[0].Rows[0]["jlfzrqm"].ToString();
string[] arrs = ds.Tables[0].Rows[0]["rq"].ToString().Split(' ');
shijian.Text = arrs[0];

ds.Clear();
adp.Dispose();
}
}
}
public void btnSave_Click(object sender, System.EventArgs e)
{
SqlConnection conn = new SqlConnection(connStr);

if (conn.State.ToString() == "Closed") conn.Open();
if (id_str != null && id_str != "")
{
strSQL = "update 工程检查记录 set title='工程检查记录" + (((DateTime.Now.ToString()).Replace("-", "")).Replace(":", "")).Replace(" ", "") + "', ";
strSQL = strSQL + "gdName='" + TextBox1.Text.ToString() + "', gdAddr='" + TextBox2.Text.ToString() + "', sgdw='" + TextBox3.Text.ToString() + "', jldw='" + TextBox29.Text.ToString() + "', sgdwlxrdh='" + TextBox5.Text.ToString() + "',";
strSQL = strSQL + "jldwlxrdh='" + TextBox6.Text.ToString() + "', xmjldh='" + TextBox7.Text.ToString() + "', jsdwlxrdh='" + TextBox8.Text.ToString() + "',";
strSQL = strSQL + "xygrs=" + TextBox9.Text.ToString() + ", zdsrs=" + TextBox10.Text.ToString() + ", hmzcqk='" + TextBox11.Text.ToString() + "', glrys=" + TextBox12.Text.ToString() + ",";
strSQL = strSQL + "ldhtqdqk='" + TextBox13.Text.ToString() + "', qdrs=" + TextBox14.Text.ToString() + ", htys='" + TextBox15.Text.ToString() + "', grgsffqk='" + TextBox16.Text.ToString() + "',";
strSQL = strSQL + "pakblqk='" + TextBox17.Text.ToString() + "', blfs='" + TextBox19.Text.ToString() + "', syqk='" + TextBox18.Text.ToString() + "', blrs=" + TextBox20.Text.ToString() + ",";
strSQL = strSQL + "clkzfqk='" + TextBox21.Text.ToString() + "', ygysqdhtqk='" + TextBox22.Text.ToString() + "', sfaszf='" + TextBox23.Text.ToString() + "', ywtq='" + TextBox24.Text.ToString() + "',";
strSQL = strSQL + "gckzfqk='" + TextBox25.Text.ToString() + "', yfk='" + TextBox26.Text.ToString() + "', jdk='" + TextBox27.Text.ToString() + "', jcyj='" + TextBox28.Text.ToString() + "', bz='" + TextBox30.Text.ToString() + "',";
strSQL = strSQL + "xcr='" + TextBox31.Text.ToString() + "', sgfzrqm='" + TextBox32.Text.ToString() + "', jlfzrqm='" + TextBox33.Text.ToString() + "', rq='" + shijian.Text.ToString() + "' ";
strSQL = strSQL + " WHERE (id = " + id_str + ") AND (gcName = '" + gcName + "')";
}
else
{
strSQL = "insert into 工程检查记录 (title, gdName, gdAddr, sgdw, jldw, sgdwlxrdh, jldwlxrdh, xmjldh, jsdwlxrdh, xygrs, zdsrs, hmzcqk, glrys, ldhtqdqk, qdrs, htys, grgsffqk, pakblqk, blfs, syqk, blrs, clkzfqk, ygysqdhtqk, sfaszf, ywtq, gckzfqk, yfk, jdk, jcyj, bz, xcr, sgfzrqm, jlfzrqm, rq, gcName) values('工程检查记录" + (((DateTime.Now.ToString()).Replace("-", "")).Replace(":", "")).Replace(" ", "") + "','" + TextBox1.Text + "','" + TextBox2.Text + "','" + TextBox3.Text + "','" + TextBox29.Text + "','" + TextBox5.Text + "','" + TextBox6.Text + "','" + TextBox7.Text + "','" + TextBox8.Text + "'," + TextBox9.Text + "," + TextBox10.Text + ",'" + TextBox11.Text + "'," + TextBox12.Text + ",'" + TextBox13.Text + "'," + TextBox14.Text + ",'" + TextBox15.Text + "','" + TextBox16.Text + "','" + TextBox17.Text + "','" + TextBox18.Text + "','" + TextBox19.Text + "'," + TextBox20.Text + ",'" + TextBox21.Text + "','" + TextBox22.Text + "','" + TextBox23.Text + "','" + TextBox24.Text + "','" + TextBox25.Text + "'," + TextBox26.Text + "," + TextBox27.Text + ",'" + TextBox28.Text + "','" + TextBox30.Text + "','" + TextBox31.Text + "','" + TextBox32.Text + "','" + TextBox33.Text + "','" + shijian.Text + "','" + gcName + "')";
}
SqlCommand comm = new SqlCommand(strSQL, conn);
//Response.Write (strSQL);
try
{
//comm.Connection.Open();
comm.ExecuteNonQuery();
comm.Dispose();
if (conn.State.ToString() == "Open") conn.Close();
Response.Write("<script language='javascript'>alert('保存成功!');window.close();</script>");

if (conn.State.ToString() == "Closed") conn.Open();

strSQL = "SELECT TOP (1) * FROM 工程检查记录 WHERE (gcName = '" + gcName + "') ORDER BY id DESC";
SqlDataAdapter daa = new SqlDataAdapter(strSQL, conn);
DataSet ds = new DataSet();
daa.Fill(ds);

strSQL = "UPDATE a工程工地_属性 SET 下次检查时间 = DATEADD(d, 15, CAST('" + ds.Tables[0].Rows[0]["rq"].ToString() + "' AS smalldatetime)) WHERE (序号 = " + ds.Tables[0].Rows[0]["gcName"].ToString() + ")";
SqlCommand comm2 = new SqlCommand(strSQL, conn);
comm2.ExecuteNonQuery();
comm2.Dispose();
ds.Clear();
daa.Dispose();
if (conn.State.ToString() == "Open") conn.Close();
}
catch (Exception ex)
{
Response.Write("<script language='javascript'>alert('保存出错!');</script>");
}
finally
{
if (conn.State.ToString() == "Open") conn.Close();

}
}
}
supelves 2010-06-21
  • 打赏
  • 举报
回复
怎么写的?看看代码,js和打开页面的代码.
yasire 2010-06-21
  • 打赏
  • 举报
回复
不明真相!~~~~~~~

62,074

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

试试用AI创作助手写篇文章吧