首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > asp.net >

请教html中关于cookies的有关问题

2011-12-15 
请教html中关于cookies的问题TRTD styleHEIGHT: 20px colSpan3A hrefsfzy.aspx?xm_id06-28-

请教html中关于cookies的问题
<TR>
<TD style="HEIGHT: 20px" colSpan="3"><A href="sfzy.aspx?xm_id=06-28-01" target="main"><%=trim("" & Server.UrlDecode(Request.Cookies("zy_name").Value))%></A></TD>
</TR>

想在页面中根据cookies的值来显示,如上所示怎么放到一个超链接中间就出错呢?

像下面这样,如果不在超链接中间就又没有问题:

<td style="HEIGHT: 20px" bgColor="#d6dff7">用户:<font color="red">&nbsp;<%=trim("" & Server.UrlDecode(Request.Cookies("user_name").Value))%>&nbsp;(<%=trim("" & Server.UrlDecode(request.Cookies("dept_name").Value))%>
)</font>
</td>



[解决办法]

C# code
 <tr>    <td style="height: 20px" colspan="3">       <a href="sfzy.aspx?xm_id=06-28-01" target="main">         <%= (Server.UrlDecode(Request.Cookies["zy_name"].Value)).ToString().Trim()%>        </a>    </td>    <td>        <%= (Server.UrlDecode(Request.Cookies["myCookie"].Value)).ToString().Trim()%>     </td></tr>
[解决办法]
<TR > 
<TD style="HEIGHT: 20px" colSpan="3" > <A href="sfzy.aspx?xm_id=06-28-01" target="main" > <%=Server.UrlDecode(Request.Cookies("zy_name").Value)).Trim()%> </A > </TD > 
</TR >

热点排行