ASPX not redirecting in Production Azure Stack

31 views Asked by At

I am deploying a website created in ASP.NET on Azure Stack. There is one ASPX page that I am trying to redirect after authentication, it is working perfectly on my local machine but after publishing it even credentials are correct it is not going to this page. This below code is from CS page.

Response.Redirect("~/TestPage.aspx", false);
Context.ApplicationInstance.CompleteRequest();

this page contains

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
     <div class="row">
        <div class="col-md-12">

            <div class="panel panel-default">
                <div class="panel-heading">
                </div>
                <br />
                <div class="panel-heading">
                    <i class="fa fa-dashboard"></i><b>
                        <asp:Label ID="lblTestDashboard" runat="server" /></b>

                </div>
                <br />

                <div class="panel-body">

                    <div>
                      DASHBOARD
                    </div>                    
                </div>
            </div>
        </div>
    </div>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder3" runat="server">
</asp:Content>

above this a master page is calling into code.

After deployment I am getting issue to redirect to this page but if create a new webpage and trying to redirect then it easily navigate to this new page. I am struggling why this above page is not able to redirect. Is there any issue with this code?

1

There are 1 answers

1
Sachin Yadav On

I have checked my master page where is written

HttpContext.Current.User.Identity.Name

It is not supported by AzureStack so instead of this i have passed user name through session then validate that.

string.IsNullOrEmpty(Convert.ToString(Session["UserID"]

and it worked. On Azure Stack Identity will never work.