问题描述
做了一个管理预定客房的页面代码如下。从菜单点进去就显示网络连接错误,是页面代码的错误吗,还是其他错误。求大神指导。usingSystem;usingSystem.Collections;usingSystem.Configuration;usingSystem.Data;usingSystem.Linq;usingSystem.Web;usingSystem.Web.Security;usingSystem.Web.UI;usingSystem.Web.UI.HtmlControls;usingSystem.Web.UI.WebControls;usingSystem.Web.UI.WebControls.WebParts;usingSystem.Xml.Linq;usingBusiness;usingSystem.Data.SqlClient;publicpartialclassCustomer_BookRoom:System.Web.UI.Page{businessb=newbusiness();staticstringsortRule;staticDataViewdv;protectedvoidPage_Load(objectsender,EventArgse){if(!IsPostBack){Bind();sortRule="";}Label1.Text=Session["cusname"].ToString();}protectedvoidBind(){stringconnstring="server=.\sqlexpress;database=HotelRoomManagement;IntegratedSecurity=SSPI";SqlConnectionconn=newSqlConnection(connstring);//SqlCommandcmd=newSqlCommand("select*fromcheckinsituationwherecusname='"+Session["cusname"].ToString()+"'",conn);SqlCommandcmd=newSqlCommand("selectroomid,cusname,checkintime,checkouttime,reservecheckintime,reservecheckouttime,depositfromcheckinsituationwherecusname=@cusname",conn);cmd.Parameters.AddWithValue("cusname",Session["cusname"].ToString());SqlDataAdaptersda=newSqlDataAdapter(cmd);DataSetds=newDataSet();sda.Fill(ds,"t1");GridView1.DataSource=ds.Tables["t1"];GridView1.DataBind();}protectedvoidGridView1_RowDeleting(objectsender,GridViewDeleteEventArgse){stringnid=GridView1.DataKeys[e.RowIndex].Value.ToString();stringconnstring="server=.\sqlexpress;database=HotelRoomManagement;IntegratedSecurity=SSPI";SqlConnectionconn=newSqlConnection(connstring);conn.Open();SqlCommandcmd=newSqlCommand("deletefromcheckinsituationwherecustomerID='"+nid+"'",conn);intres=cmd.ExecuteNonQuery();conn.Close();if(res>0)Response.Write("<script>alert('success')</scrip>");GridView1.EditIndex=-1;Bind();}protectedvoidGridView1_RowCommand(objectsender,GridViewCommandEventArgse){if(e.CommandName=="update"){Response.Redirect("../Customer/BookRoom2.aspx");}}}
解决方案
解决方案二:
解决方案三:
电脑感染了360等流氓软件。
解决方案四:
Response.Redirect("../Customer/BookRoom2.aspx");===》Response.Redirect("/Customer/BookRoom2.aspx");||Response.Redirect("http://wwww.xxxx.com/Customer/BookRoom2.aspx");