ReDirect - Please Help

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • PaulThomas

    #1

    ReDirect - Please Help

    Working with XP-Pro and VS.Net I have set my Start Page to "Home.aspx" but
    the application always starts the "Login" page - - - How can I change the
    start page to the Home.aspx???
    On the login page that displays I have
    private void LinkButton1_Cli ck(object sender, System.EventArg s e)
    {
    bool MyVar = true;
    Msg.Text = "ReDirectin g to Home.aspx";
    Response.Redire ct("Home.aspx", MyVar);
    }
    AND.....
    private void LinkButton2_Cli ck(object sender, System.EventArg s e)
    {
    Msg.Text = "ReDirectin g to Home.aspx";
    Response.Redire ct("Home.aspx", MyVar);
    }
    Using debug I see that both buttons just re-load the Login page and
    re-execute the Login page Page_Load event???
    WHY / HOW can I get the ReDirects to work?

    I am so frustrated - please help me understand WHY these don't work.

    Thanks in advance,
    Paul
  • Ken Dopierala Jr.

    #2
    Re: ReDirect - Please Help

    Hi Paul,

    Are you running any type of authentication (Forms or Windows)? That could
    keep sending people back to the login page. Good luck! Ken.

    --
    Ken Dopierala Jr.
    For great ASP.Net web hosting try:
    http://www.webhost4life.com/default.asp?refid=Spinlight
    If you sign up under me and need help, email me.

    "PaulThomas " <PaulThomas@dis cussions.micros oft.com> wrote in message
    news:4BB06DD5-3705-42D8-8F3D-7A71D1ECE08F@mi crosoft.com...[color=blue]
    > Working with XP-Pro and VS.Net I have set my Start Page to "Home.aspx"[/color]
    but[color=blue]
    > the application always starts the "Login" page - - - How can I change the
    > start page to the Home.aspx???
    > On the login page that displays I have
    > private void LinkButton1_Cli ck(object sender, System.EventArg s e)
    > {
    > bool MyVar = true;
    > Msg.Text = "ReDirectin g to Home.aspx";
    > Response.Redire ct("Home.aspx", MyVar);
    > }
    > AND.....
    > private void LinkButton2_Cli ck(object sender, System.EventArg s e)
    > {
    > Msg.Text = "ReDirectin g to Home.aspx";
    > Response.Redire ct("Home.aspx", MyVar);
    > }
    > Using debug I see that both buttons just re-load the Login page and
    > re-execute the Login page Page_Load event???
    > WHY / HOW can I get the ReDirects to work?
    >
    > I am so frustrated - please help me understand WHY these don't work.
    >
    > Thanks in advance,
    > Paul[/color]


    Comment

    • PaulThomas

      #3
      Re: ReDirect - Please Help

      YES - I am using
      <authenticati on mode="Forms" />
      Does this affect "all" pages - I guess I need to do some more serious
      reading...

      I "thought" that if a page required security - I would code for it in the
      individual pages that need it. I should be able to put up pages that do not
      require security and go directly to them without validation - right?

      Thanks for the clue...
      Paul



      "Ken Dopierala Jr." wrote:
      [color=blue]
      > Hi Paul,
      >
      > Are you running any type of authentication (Forms or Windows)? That could
      > keep sending people back to the login page. Good luck! Ken.
      >
      > --
      > Ken Dopierala Jr.
      > For great ASP.Net web hosting try:
      > http://www.webhost4life.com/default.asp?refid=Spinlight
      > If you sign up under me and need help, email me.
      >
      > "PaulThomas " <PaulThomas@dis cussions.micros oft.com> wrote in message
      > news:4BB06DD5-3705-42D8-8F3D-7A71D1ECE08F@mi crosoft.com...[color=green]
      > > Working with XP-Pro and VS.Net I have set my Start Page to "Home.aspx"[/color]
      > but[color=green]
      > > the application always starts the "Login" page - - - How can I change the
      > > start page to the Home.aspx???
      > > On the login page that displays I have
      > > private void LinkButton1_Cli ck(object sender, System.EventArg s e)
      > > {
      > > bool MyVar = true;
      > > Msg.Text = "ReDirectin g to Home.aspx";
      > > Response.Redire ct("Home.aspx", MyVar);
      > > }
      > > AND.....
      > > private void LinkButton2_Cli ck(object sender, System.EventArg s e)
      > > {
      > > Msg.Text = "ReDirectin g to Home.aspx";
      > > Response.Redire ct("Home.aspx", MyVar);
      > > }
      > > Using debug I see that both buttons just re-load the Login page and
      > > re-execute the Login page Page_Load event???
      > > WHY / HOW can I get the ReDirects to work?
      > >
      > > I am so frustrated - please help me understand WHY these don't work.
      > >
      > > Thanks in advance,
      > > Paul[/color]
      >
      >
      >[/color]

      Comment

      • Ken Dopierala Jr.

        #4
        Re: ReDirect - Please Help

        Hi Paul,

        This is a fast fix. In your Web.config use location tags like below to only
        protect folders that need protecting. For home pages don't protect that.
        Good luck! Ken.

        <?xml version="1.0" encoding="utf-8" ?>
        <configuratio n>

        <location path="Members/Administrator">
        <system.web>
        <authorizatio n>
        <allow roles="Administ rator"></allow>
        <deny users="*"/>
        </authorization>
        </system.web>
        </location>

        <location path="Members/OtherUserType">
        <system.web>
        <authorizatio n>
        <allow roles="UserType One, UserTypeTwo"></allow>
        <deny users="*"/>
        </authorization>
        </system.web>
        </location>

        <system.web>
        .......

        <authorizatio n>
        <allow users="*" /> <!-- Allow all users, the location tags will protect
        folders. -->
        </authorization>


        --
        Ken Dopierala Jr.
        For great ASP.Net web hosting try:
        http://www.webhost4life.com/default.asp?refid=Spinlight
        If you sign up under me and need help, email me.

        "PaulThomas " <PaulThomas@dis cussions.micros oft.com> wrote in message
        news:C4EE9AAC-0E04-4E1C-82BB-D4DC94C7A443@mi crosoft.com...[color=blue]
        > YES - I am using
        > <authenticati on mode="Forms" />
        > Does this affect "all" pages - I guess I need to do some more serious
        > reading...
        >
        > I "thought" that if a page required security - I would code for it in the
        > individual pages that need it. I should be able to put up pages that do[/color]
        not[color=blue]
        > require security and go directly to them without validation - right?
        >
        > Thanks for the clue...
        > Paul
        >
        >
        >
        > "Ken Dopierala Jr." wrote:
        >[color=green]
        > > Hi Paul,
        > >
        > > Are you running any type of authentication (Forms or Windows)? That[/color][/color]
        could[color=blue][color=green]
        > > keep sending people back to the login page. Good luck! Ken.
        > >
        > > --
        > > Ken Dopierala Jr.
        > > For great ASP.Net web hosting try:
        > > http://www.webhost4life.com/default.asp?refid=Spinlight
        > > If you sign up under me and need help, email me.
        > >
        > > "PaulThomas " <PaulThomas@dis cussions.micros oft.com> wrote in message
        > > news:4BB06DD5-3705-42D8-8F3D-7A71D1ECE08F@mi crosoft.com...[color=darkred]
        > > > Working with XP-Pro and VS.Net I have set my Start Page to[/color][/color][/color]
        "Home.aspx"[color=blue][color=green]
        > > but[color=darkred]
        > > > the application always starts the "Login" page - - - How can I change[/color][/color][/color]
        the[color=blue][color=green][color=darkred]
        > > > start page to the Home.aspx???
        > > > On the login page that displays I have
        > > > private void LinkButton1_Cli ck(object sender, System.EventArg s e)
        > > > {
        > > > bool MyVar = true;
        > > > Msg.Text = "ReDirectin g to Home.aspx";
        > > > Response.Redire ct("Home.aspx", MyVar);
        > > > }
        > > > AND.....
        > > > private void LinkButton2_Cli ck(object sender, System.EventArg s e)
        > > > {
        > > > Msg.Text = "ReDirectin g to Home.aspx";
        > > > Response.Redire ct("Home.aspx", MyVar);
        > > > }
        > > > Using debug I see that both buttons just re-load the Login page and
        > > > re-execute the Login page Page_Load event???
        > > > WHY / HOW can I get the ReDirects to work?
        > > >
        > > > I am so frustrated - please help me understand WHY these don't work.
        > > >
        > > > Thanks in advance,
        > > > Paul[/color]
        > >
        > >
        > >[/color][/color]


        Comment

        Working...