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

  • Home
  • SEARCH
  • 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 8402737
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T22:08:56+00:00 2026-06-09T22:08:56+00:00

Please see the image below As you can see I have a master page

  • 0

Please see the image below

enter image description here

As you can see I have a master page Design.master and the code behind it that is called Design.master.cs.

I am simply trying to get my page to redirect to dashboard.aspx when the user is not logged it, but no matter what I try I can’t get it do it.

I want to be able to access the value of the public variable redirect, which is set in the code behind and access it from the Design.master code.

So that I can check the variable and put the Response.redirect() code in the Design.master page.

Unless you know how to get the Redirect to work from the Design.master.cs code?

Please help 🙁 It’s driving me INSANE!

Updated image

adas

Design.master code:

<%@ Master Language="C#" CodeBehind="~/Design.master.cs" AutoEventWireup="true" %>

<%

        Response.Redirect("default.aspx", true);

%>

<!DOCTYPE html>

<html>

<head>
    <title>Portal</title>
    <link rel="stylesheet" href="styles.css" type="text/css" />

    <script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js"></script>
    <script src="portal_script.js" type="text/javascript"></script>
</head>
<body>

<div id="main_wrapper">

        <div id="header_top_wrapper">
            <div id="header_top">
                <img src="images/design/logo_small.png" id="logo_top" />

                <a href="basket.aspx">
                    <div id="basket_top_link">
                        <div>Order Basket</div>
                    </div>
                </a>
            </div>
        </div>
        <div id="header_breadcrumb_wrapper">
            <div id="header_breadcrumb"></div>
        </div>

        <div id="content_wrapper">
            <div id="content">

                <div id="side_menu">

                    <div id="customer_info">

                        <asp:ContentPlaceHolder id="CustomerInfo" runat="server">

                        </asp:ContentPlaceHolder>

                    </div>

                    <a href="dashboard.aspx"><div class="side_menu_item">
                        <div class="item_title">View Orders</div>
                        <div class="item_description">View your outstanding orders</div>
                    </div></a>

                    <a href="search.aspx"><div class="side_menu_item">
                        <div class="item_title">Product Search</div>
                        <div class="item_description">Search products and view stock levels</div>
                    </div></a>

                    <a href="search.aspx"><div class="side_menu_item">
                        <div class="item_title">Outstanding Complaints</div>
                        <div class="item_description">View status of complaints</div>
                    </div></a>

                </div>

                <div id="content_left">

                    <asp:ContentPlaceHolder id="Content" runat="server">

                    </asp:ContentPlaceHolder>

                </div>

            </div>
        </div>

        <div id="footer_wrapper">

            <div id="footer"><p></p></div>

        </div>

</div>

</body>
</html>

Design.master.cs code:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Design : System.Web.UI.MasterPage
{

    public bool redirect = false;

    protected override void OnInit(EventArgs e)
    {

        // Get the users session
        SessionManager session = new SessionManager(HttpContext.Current);

        // I've tried it here, and it won't redirect
        // Response.Redirect("default.aspx");

        redirect = true;

    }

    protected void Page_Load(object sender, EventArgs e)
    {
        // I've tried it here, and it won't redirect
        // Response.Redirect("default.aspx");
    }
}
  • 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-06-09T22:08:58+00:00Added an answer on June 9, 2026 at 10:08 pm

    Just do it in your Page_Load method from Design.master.cs:

    protected void Page_Load(object sender, EventArgs e){
       if (result){
          Response.Redirect("....");
       }
    }
    

    This is much neater than having code breaks in your markup file, and that technique will only bite you back in the future.

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

Sidebar

Related Questions

Please look at the image below !! So in this image... You can see
i have the following situation (please see image below after reading the following): .dragoverlay
Please see the attached image. I'm trying to change the color on the segmented
Please see below code: thrust::device_vector<int>::iterator whereToBegin = copyListOfNgramCounteachdoc.begin(); end = thrust::unique_by_key(end.first, end.first + numUniqueNgrams,end.second);
Please see below: I tried using Absolute layout, but that's deprecated. I appreciate your
Please see the code snippet below : #include <iostream> using namespace std; int main()
Please take a look at the screenshot below and see if you can tell
I'm trying to implement the AQGridView in my iPad app. Please see my below
Please see the below image. It is a snip containing the Y-axis of a
I am Trying to add an image to an existing button..I have done that

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.