如何将会话值与整数进行比较 [英] How to compare session value with integer

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

问题描述

我将usertypeid作为会话存储在userlogin上.现在,我希望如果userid为1,那么只有他可以添加产品.但是我无法在产品页面上访问它.

if(Session ["Usertypeid"] == 1)
{
Bind("productdetail");
}

I stored the usertypeid in as session on userlogin . Now i want that if the userid is 1 then only he can add the products . But i am not able to access it on the product page .

if(Session["Usertypeid"]==1)
{
Bind("productdetail");
}

推荐答案

if(convert.toint32(Session ["Usertypeid"].ToString())== 1)
{
Bind("productdetail");
}
if(convert.toint32(Session["Usertypeid"].ToString())==1)
{
Bind("productdetail");
}


这篇关于如何将会话值与整数进行比较的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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