<a href="renshiguanli/employee_info.aspx?User_ID=<%#Request.Cookies("UID")%>" target="main">

解决方案 »

  1.   

    “/na_oa”应用程序中的服务器错误。
    --------------------------------------------------------------------------------编译错误 
    说明: 在编译向该请求提供服务所需资源的过程中出现错误。请检查下列特定错误详细信息并适当地修改源代码。 编译器错误信息: CS0118: “System.Web.HttpRequest.Cookies”表示“属性”,此处应为“方法”
      

  2.   

    Request.Cookies["UID"]
    (改成[如果还不行
    试这个
    Request.Cookies["UID"].ToString()
      

  3.   

    <a href="renshiguanli/employee_info.aspx?User_ID=<%#Request.Cookies["UID"].ToString()%>" target="main">
      

  4.   

    HttpCookie mycookie = Request.Cookies ["mycookie"] ;我把UID存在mycookie中,
    电击后:
    http://localhost/na_oa/renshiguanli/employee_info.aspx?User_ID=User_ID 值为空?
    还要请教,
    所以刚才连接没有达到目的
      

  5.   

    HttpCookie mycookie = Request.Cookies ["mycookie"] ;//你确定他存在吗? MyCookie.Values["uid"] = "1";
     Response.Cookies.Add(MyCookie);
      

  6.   

    <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>&nbsp;</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>