如何解决这个问题,避免进入登录页面? [英] How do I address this problem that would avoid go to the login page?

查看:90
本文介绍了如何解决这个问题,避免进入登录页面?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个将邮件作为链接发送的应用程序。我的启动页面是'Login.aspx。该链接可供外部用户访问。



链接包含外部用户可以输入信息的直接页面,并在底层数据库中注册。



问题是,当点击链接时,它会重定向到登录页面。



如何解决这个避免进入登录页面的问题?





问候,

narayanan



我尝试过:



页面上的代码加载如下:





protected void Page_Load(object sender,EventArgs e)

{



if(Request.QueryString [ReturnUrl]!=&&

Request.QueryString [ReturnUrl]!= null)

{

Response.Redirect(Request.QueryString [ReturnUrl]);

}

否则

{

//这里你的正常重定向





strParamCustId = Request.QueryString [CustId]。ToString();

strParamPONo = Request.Que ryString [PONo]。ToString();



tblH = objH.getByCustPO(strParamCustId.ToString(),strParamPONo.ToString());



if(tblH.Rows.Count> 0)

{

DDL_Divn.SelectedValue = tblH [0] .Division.ToString();

TxtCustCode.Text = tblH [0] .CustomerCode.ToString();

CDC_CustPODate.Text = tblH [0] .CustPODate;

TxtPONO.Text = tblH [0] .CustPONo.ToString();

TxtProj.Text = tblH [0] .ProjectName.ToString();

TxtCustName.Text = tblH [0] .CustomerName.ToString();

TxtCustEmail.Text = tblH [0] .CustEmail.ToString();

}





}

}

I have an application that sends a mail as a link. My start-up page is 'Login.aspx. The link is accessible for external users.

The link contains the direct page where the external users can enter information and the same is registered in the underlying database.

The problem is that, when the link is clicked, it redirects to the 'Login' page.

How do I address this problem that would avoid go to the Login Page?


Regards,
narayanan

What I have tried:

The code on Page Load is as follows:


protected void Page_Load(object sender, EventArgs e)
{

if (Request.QueryString["ReturnUrl"] != "" &&
Request.QueryString["ReturnUrl"] != null)
{
Response.Redirect(Request.QueryString["ReturnUrl"]);
}
else
{
// Do your normal redirect here


strParamCustId = Request.QueryString["CustId"].ToString();
strParamPONo = Request.QueryString["PONo"].ToString();

tblH = objH.getByCustPO(strParamCustId.ToString(), strParamPONo.ToString());

if (tblH.Rows.Count > 0)
{
DDL_Divn.SelectedValue = tblH[0].Division.ToString();
TxtCustCode.Text = tblH[0].CustomerCode.ToString();
CDC_CustPODate.Text = tblH[0].CustPODate;
TxtPONO.Text = tblH[0].CustPONo.ToString();
TxtProj.Text = tblH[0].ProjectName.ToString();
TxtCustName.Text = tblH[0].CustomerName.ToString();
TxtCustEmail.Text = tblH[0].CustEmail.ToString();
}


}
}

推荐答案

假设它是导致重定向的身份验证,您只需移动页面即可任何人都可以自己访问一个文件夹,并将这样的web.config文件添加到该文件夹​​:

Assuming it's Authentication that is causing the redirect, all you need to do is move the page(s) that anyone can access to a folder on their own, and add a web.config file like this to that folder:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
    <system.web>
        <authorization>
            <allow users="*" />
        </authorization>
    </system.web>
</configuration>

然后可以无限制地访问文件夹内容。

The folder content is then free to access without restrictions.


这篇关于如何解决这个问题,避免进入登录页面?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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