<a href="renshiguanli/employee_info.aspx?User_ID=Request.Cookies("UID")" target="main"> 有什么不妥当 <a href="renshiguanli/employee_info.aspx?User_ID=<%#Request.Cookies("UID")%>" target="main"> 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 “/na_oa”应用程序中的服务器错误。--------------------------------------------------------------------------------编译错误 说明: 在编译向该请求提供服务所需资源的过程中出现错误。请检查下列特定错误详细信息并适当地修改源代码。 编译器错误信息: CS0118: “System.Web.HttpRequest.Cookies”表示“属性”,此处应为“方法” Request.Cookies["UID"](改成[如果还不行试这个Request.Cookies["UID"].ToString() <a href="renshiguanli/employee_info.aspx?User_ID=<%#Request.Cookies["UID"].ToString()%>" target="main"> HttpCookie mycookie = Request.Cookies ["mycookie"] ;我把UID存在mycookie中,电击后:http://localhost/na_oa/renshiguanli/employee_info.aspx?User_ID=User_ID 值为空?还要请教,所以刚才连接没有达到目的 HttpCookie mycookie = Request.Cookies ["mycookie"] ;//你确定他存在吗? MyCookie.Values["uid"] = "1"; Response.Cookies.Add(MyCookie); <script runat="server">protected System.Data.SqlClient.SqlDataReader myReader ,myReader1;protected void Page_Load(Object Src, EventArgs E){ HttpCookie mycookie = Request.Cookies ["mycookie"] ; if(mycookie["LoginID"]!="true") { Response.Redirect("default.aspx"); } if (!IsPostBack) { String strCon = System.Configuration.ConfigurationSettings.AppSettings["MM_CONNECTION_STRING_mydb"]; SqlConnection myConn = new System.Data.SqlClient.SqlConnection (strCon); myConn.Open ( ) ; string strCom = "SELECT * FROM dbo.emp_basic where User_ID='" + mycookie["UID"] + "'"; SqlCommand myCommand= new System.Data.SqlClient.SqlCommand(strCom,myConn); myReader =myCommand.ExecuteReader(); myReader.Read() ; user.Text=myReader["UserName"].ToString(); myReader.Close(); }}</script><body bgcolor="#F0DA8E" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0"><div id="Layer1" style="position:absolute; left:0px; top:39px; width:121px; height:12px; z-index:1"> <table width="122" border="0"> <tr> <td width="56%"><font color="#0000FF">在线用户:</font></td> <td width="44%"> <div align="center"><font color="#FF0000" size="2"> <a href="renshiguanli/employee_edit.aspx?User_ID=<%#Request.Cookies["UID"].ToString()%>" target="main"> <asp:label BorderStyle="none" ForeColor="#0000FF" ID="user" runat="server"></asp:label> </a> </font></div></td> </tr> </table></div><div id="Layer2" style="position:absolute; left:0px; top:50px; width:100%; height:10px; z-index:2"> <hr align="center" width="100%" size="3" color="#006699"></div><div id="Layer3" style="position:absolute; left:671px; top:31px; width:100px; height:15px; z-index:3"> <table width="99" border="0"> <tr> <td><a href="myDesktop.aspx" target="main"><img src="images/button/shareforum.gif" alt="我的桌面" width="16" height="16" border="0"></a></td> <td><img src="images/button/wri.gif" alt="工作日志" width="16" height="16"></td> <td><a href="#" onClick="window.Click();"><img src="images/emot/logout.gif" alt="退出" width="20" height="18" border="0"></a></td> </tr> </table></div><p> </p><p class="show"> <object id=window type="application/x-oleobject"classid="clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11"> <param name="Command" value="Close"> </object> </p></body> 四级分类如何用table输出 难道ASP.net真的不适合做SNS或者WEB2.0网站吗? vs2008界面怎么没有xp风格 下周日结婚,撒分 ~~ 如果不刷新取得js中confirm返回的值? 好奇怪的session问题,麻烦大家帮我分析下啊,急 (急)把程序中的string数据(包括文字.图片.视频文件等信息)保为数据库中的NTEXT类型应如何处理! 我实在想不出来了,请大家帮忙!关于datagrid的 我要出去找工作了--特地留言(希望不要被删) C#中字符串分解的问题? 怎样交TreeView控件打在安装中啊,有无人知道啊? 寻找ASP.net高级编程等书的电子档
--------------------------------------------------------------------------------编译错误
说明: 在编译向该请求提供服务所需资源的过程中出现错误。请检查下列特定错误详细信息并适当地修改源代码。 编译器错误信息: CS0118: “System.Web.HttpRequest.Cookies”表示“属性”,此处应为“方法”
(改成[如果还不行
试这个
Request.Cookies["UID"].ToString()
电击后:
http://localhost/na_oa/renshiguanli/employee_info.aspx?User_ID=User_ID 值为空?
还要请教,
所以刚才连接没有达到目的
Response.Cookies.Add(MyCookie);
protected System.Data.SqlClient.SqlDataReader myReader ,myReader1;
protected void Page_Load(Object Src, EventArgs E)
{
HttpCookie mycookie = Request.Cookies ["mycookie"] ;
if(mycookie["LoginID"]!="true")
{
Response.Redirect("default.aspx");
}
if (!IsPostBack)
{
String strCon = System.Configuration.ConfigurationSettings.AppSettings["MM_CONNECTION_STRING_mydb"];
SqlConnection myConn = new System.Data.SqlClient.SqlConnection (strCon);
myConn.Open ( ) ;
string strCom = "SELECT * FROM dbo.emp_basic where User_ID='" + mycookie["UID"] + "'";
SqlCommand myCommand= new System.Data.SqlClient.SqlCommand(strCom,myConn);
myReader =myCommand.ExecuteReader();
myReader.Read() ;
user.Text=myReader["UserName"].ToString();
myReader.Close();
}
}
</script>
<body bgcolor="#F0DA8E" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<div id="Layer1" style="position:absolute; left:0px; top:39px; width:121px; height:12px; z-index:1">
<table width="122" border="0">
<tr>
<td width="56%"><font color="#0000FF">在线用户:</font></td>
<td width="44%"> <div align="center"><font color="#FF0000" size="2"> <a href="renshiguanli/employee_edit.aspx?User_ID=<%#Request.Cookies["UID"].ToString()%>" target="main"> <asp:label BorderStyle="none" ForeColor="#0000FF" ID="user" runat="server"></asp:label>
</a> </font></div></td>
</tr>
</table>
</div>
<div id="Layer2" style="position:absolute; left:0px; top:50px; width:100%; height:10px; z-index:2">
<hr align="center" width="100%" size="3" color="#006699">
</div>
<div id="Layer3" style="position:absolute; left:671px; top:31px; width:100px; height:15px; z-index:3">
<table width="99" border="0">
<tr>
<td><a href="myDesktop.aspx" target="main"><img src="images/button/shareforum.gif" alt="我的桌面" width="16" height="16" border="0"></a></td>
<td><img src="images/button/wri.gif" alt="工作日志" width="16" height="16"></td>
<td><a href="#" onClick="window.Click();"><img src="images/emot/logout.gif" alt="退出" width="20" height="18" border="0"></a></td>
</tr>
</table>
</div>
<p> </p>
<p class="show">
<object id=window type="application/x-oleobject"classid="clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11">
<param name="Command" value="Close">
</object>
</p>
</body>