热门将用户重定向到选定的表单作为分配的任务 [英] Hot to redirect users to selected forms as assigned task

查看:45
本文介绍了热门将用户重定向到选定的表单作为分配的任务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是将我重定向到HOMEPAGE.aspx。现在我希望我在SQL表中有角色字段,所以我希望用户重定向到我想指定的选定页面,以便如何编写代码



我尝试过:



this is redirecting me to HOMEPAGE.aspx. Now I want that i have Role field in SQL Table so I want users to redirect to selected page that i want to specify so how to write code in that

What I have tried:

SqlConnection con = new SqlConnection(@"Data Source=chinu\a;Initial Catalog=UNIT_DB;Integrated Security=True;");

SqlDataAdapter sda = new SqlDataAdapter("Select count (*) from USER_DETLS WHERE User_Id ='" + User_Id.Text + "' and  PASSWORD = '" + Password.Text + "' and  Role = '" + Branch.Text + "'", con);

DataTable dt = new DataTable();
sda.Fill(dt);

if (dt.Rows[0][0].ToString() == "1")
{
    Session["User_Id"] = User_Id.Text;
    Response.Redirect("HOMEPAGE.aspx");
    Session.RemoveAll();
}
else
{
    Label1.Visible = true;
}

推荐答案

这是一个非常常见的问题。以下是一个类似于您想要的答案:重定向不同的用户 [< a href =https://www.codeproject.com/Questions/625037/Redirect-Different-userstarget =_ blanktitle =New Window> ^ ]
This is a very common question. Here is one that was previously answered that does similar to what you want: Redirect Different users[^]


这篇关于热门将用户重定向到选定的表单作为分配的任务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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