Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7047919
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T02:49:46+00:00 2026-05-28T02:49:46+00:00

I decided not to redirect a first visitor from default to my Not Logged

  • 0

I decided not to redirect a first visitor from default to my “Not Logged In” page and just turn default in the “Not Logged In” page. When i did this, none of the code is working in the codebehind except for the page load. I have a menu that works perfectly fine, but any link button, or login code in the master page is not working. Maybe it has to do with the url rewriting the hosting provider does? My page doesn’t have default.aspx in the url it just shows http://www.mywebsite.com

Here is my page load on default.

if (!IsPostBack)
        {
            AbuseReport abuse = new AbuseReport();
            abuse.Message = "page load clicked";
            abuse.ReportingPersonID = 1;
            abuse.AbuserPersonID = 1;
            abuse.CreateAbuseReport();

            SiteViews();

            bool stayOnSite = (Session["StayOnMainSite"] != null && !Parser.GetBoolean(Session["StayOnMainSite"]));

            string strUserAgent = Request.UserAgent.ToString().ToLower();

            if (strUserAgent != null)
            {
                if (Request.Browser.IsMobileDevice == true || strUserAgent.Contains("iphone") ||
                    strUserAgent.Contains("blackberry") || strUserAgent.Contains("mobile") ||
                    strUserAgent.Contains("windows ce") || strUserAgent.Contains("opera mini") ||
                    strUserAgent.Contains("palm") || strUserAgent.Contains("android") ||
                    strUserAgent.Contains("ipad") || strUserAgent.Contains("moto") ||
                    strUserAgent.Contains("htc") || strUserAgent.Contains("sony") ||
                    strUserAgent.Contains("panasonic") || strUserAgent.Contains("midp") ||
                    strUserAgent.Contains("cldc") || strUserAgent.Contains("avant") ||
                    strUserAgent.Contains("windows ce") || strUserAgent.Contains("nokia") ||
                    strUserAgent.Contains("pda") || strUserAgent.Contains("hand") ||
                    strUserAgent.Contains("mobi") || strUserAgent.Contains("240x320") ||
                    strUserAgent.Contains("voda"))
                {
                    if (!stayOnSite)
                    {
                        Response.Redirect("~/Mobile/Default.aspx");
                        return;
                    }
                }
            }

            if (Session[ApplicationClass.UserSessions.AppUser] != null)
            {
                ApplicationClass appClass = ((ApplicationClass)Session[ApplicationClass.UserSessions.AppUser]);

                if (appClass.User.IsPolitician)
                {
                    UrlParameterPasser urlPasser = new UrlParameterPasser("~/PoliticianView/PoliticianWall.aspx");
                    urlPasser["PoliticianID"] = Parser.GetString(appClass.User.Politician.PoliticianID);
                    urlPasser.PassParameters();
                }
                else
                {
                    Response.Redirect("~/User/UserMain.aspx");
                }
            }
        }

Here is my login click (register is the same, and the abuse is just for logging purpose right now)

protected void lbtnLogin_Click(object sender, EventArgs e)
    {
        AbuseReport abuse = new AbuseReport();
        abuse.Message = "Login clicked";
        abuse.ReportingPersonID = 1;
        abuse.AbuserPersonID = 1;
        abuse.CreateAbuseReport();

        Response.Redirect("~/Login/Login.aspx");

        AbuseReport abuse2 = new AbuseReport();
        abuse2.Message = "Login after click";
        abuse2.ReportingPersonID = 1;
        abuse2.AbuserPersonID = 1;
        abuse2.CreateAbuseReport();
    }

here is defualt.aspx

<%@ Page Title="Politic Profiles Main" Language="C#" MasterPageFile="~/TwoColumn.master" AutoEventWireup="true"
CodeBehind="Default.aspx.cs" Inherits="PoliticProfiles._Default" %>

<table cellpadding="10px">
    <tr>
        <td>
            <asp:Image ID="Image1" ImageUrl="~/Images/flags.jpg" AlternateText="American Flags" 
                runat="server" />
        </td>
        <td valign="top">
            <h1>Welcome to Politic Profiles</h1>

            <h2>Political information tailored to you.</h2>

            <br />

            <h3>
                <asp:LinkButton ID="lbtnRegister" runat="server" Text="Register" 
                onclick="lbtnRegister_Click" />
                <asp:Label ID="Label1" Text=" or " runat="server" />
                <asp:LinkButton ID="lbtnLogin" runat="server" Text="Login" 
                onclick="lbtnLogin_Click"/>
                <asp:Label ID="Label2" runat="server" Text=" to get the most out of your experience." />
            </h3>

            <ul class="landing">
                <li>
                    <asp:Label ID="Label3" runat="server" Text="Ask your politicians questions." />
                    <br /><br />
                </li>
                <li>
                    <asp:Label ID="Label4" runat="server" Text="Keep up to date with what your politicians are doing." />
                    <br /><br />
                </li>
                <li>
                    <asp:Label ID="Label5" runat="server" Text="Allow your politicians to learn from you." />
                    <br /><br />
                </li>
                <li>
                    <asp:Label ID="Label6" runat="server" Text="Be involved in polls that help inform you politicians what track you want them on." />
                    <br /><br />
                </li>
            </ul>
        </td>
    </tr>
</table>

<uc:Polls id="ucPolls" runat="server" />

<br /><br /> 

<uc:Donate id="ucDonate" runat="server" />

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T02:49:46+00:00Added an answer on May 28, 2026 at 2:49 am

    Turned out to be because i had enableCrossAppRedirects=”true”

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've decided to take the advice in this question: create-excel-chart-programmatically-in-php and NOT attempt to
First of all, I could not decide if I should ask this here or
I'm creating my first project with ASP. This project is just making a basic
After searching through SO, and not finding anything useful, I decided to post this
I decided not to use an orm and going to use straight ADO.NET for
I was evaluating the Enterprise IDE plugin for Eclipse, and ultimately decided not to
I am currently working on a ASP.NET AJAX application. Having decided to not use
My company has decided to develop ebook DRM platform. The platform does not have
I've decided to develop a database driven web app, but I'm not sure where
I know you shouldn't use this to decide whether or not to change an

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.