删除会话如何解决 [英] remove the session how it can be solved

查看:84
本文介绍了删除会话如何解决的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何借助asp.net中的会话在aspx页面上删除超链接?

how to remove hyperlink on the aspx page with help of session in asp.net?

推荐答案

您可以从另一个页面访问母版页面,但是简单方法:

在您的母版页中检查一个会话,如果该会话不为null,则显示超链接,否则将其禁用.
并在该页面的InIt页面上设置会话!
you can access from another page to master page but let sat the easy way:

in your master page check a session that if that session if isn''t null then show the hyperlink ,else make it disable.
and in that page set the session on page InIt!


您的问题尚不清楚,我认为您想隐藏超链接,以确保会话是否有价值.用作
使用
Your question is not clear,I think you want to hide hyperlink if session have or not have value.use as
Use
if(Session["userid"]==null)
{
HyperLink1.Visible=false;
}


在contentpage的页面加载量上使用


use on pageload of contentpage

((HyperLink)this.Master.FindControl("HyperLink1")).Visible=false;


您不需要会话即可从您的aspx页面中删除任何超链接.

如果它是基于设计的,则完全删除超链接标记.如果在运行时,根据某些情况,您不希望超链接,则只需将其隐藏即可.使用超链接的可见"属性并发挥其可见性.
You don''t need Session to remove any hyperlink from your aspx page.

If it is based on design then remove the hyperlink tag altogether. If at runtime, based on certain scenario you don''t want the hyperlink then just hide it. Use the ''Visible'' property of the hyperlink and play with it''s visibility.


这篇关于删除会话如何解决的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆