By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,836 Members | 2,023 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,836 IT Pros & Developers. It's quick & easy.

ReDirect - Please Help

P: n/a
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_Click(object sender, System.EventArgs e)
{
bool MyVar = true;
Msg.Text = "ReDirecting to Home.aspx";
Response.Redirect("Home.aspx",MyVar);
}
AND.....
private void LinkButton2_Click(object sender, System.EventArgs e)
{
Msg.Text = "ReDirecting to Home.aspx";
Response.Redirect("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
Jul 21 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
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" <Pa********@discussions.microsoft.com> wrote in message
news:4B**********************************@microsof t.com...
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_Click(object sender, System.EventArgs e)
{
bool MyVar = true;
Msg.Text = "ReDirecting to Home.aspx";
Response.Redirect("Home.aspx",MyVar);
}
AND.....
private void LinkButton2_Click(object sender, System.EventArgs e)
{
Msg.Text = "ReDirecting to Home.aspx";
Response.Redirect("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

Jul 21 '05 #2

P: n/a
YES - I am using
<authentication 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:
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" <Pa********@discussions.microsoft.com> wrote in message
news:4B**********************************@microsof t.com...
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_Click(object sender, System.EventArgs e)
{
bool MyVar = true;
Msg.Text = "ReDirecting to Home.aspx";
Response.Redirect("Home.aspx",MyVar);
}
AND.....
private void LinkButton2_Click(object sender, System.EventArgs e)
{
Msg.Text = "ReDirecting to Home.aspx";
Response.Redirect("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


Jul 21 '05 #3

P: n/a
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" ?>
<configuration>

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

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

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

<authorization>
<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" <Pa********@discussions.microsoft.com> wrote in message
news:C4**********************************@microsof t.com...
YES - I am using
<authentication 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:
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" <Pa********@discussions.microsoft.com> wrote in message
news:4B**********************************@microsof t.com...
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_Click(object sender, System.EventArgs e)
{
bool MyVar = true;
Msg.Text = "ReDirecting to Home.aspx";
Response.Redirect("Home.aspx",MyVar);
}
AND.....
private void LinkButton2_Click(object sender, System.EventArgs e)
{
Msg.Text = "ReDirecting to Home.aspx";
Response.Redirect("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


Jul 21 '05 #4

P: n/a
Thanks Ken,
I looked at the webhost4life site and when I get closer to ready, I'll
probably sign up there. I also tried your suggestion about the web.config
file and I don't have it working (yet - with multiple 'location path'
statements) but I think you put me on the right path.
Thanks again,
Paul
"Ken Dopierala Jr." wrote:
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" ?>
<configuration>

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

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

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

<authorization>
<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" <Pa********@discussions.microsoft.com> wrote in message
news:C4**********************************@microsof t.com...
YES - I am using
<authentication 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:
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" <Pa********@discussions.microsoft.com> wrote in message
news:4B**********************************@microsof t.com...
> 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_Click(object sender, System.EventArgs e)
> {
> bool MyVar = true;
> Msg.Text = "ReDirecting to Home.aspx";
> Response.Redirect("Home.aspx",MyVar);
> }
> AND.....
> private void LinkButton2_Click(object sender, System.EventArgs e)
> {
> Msg.Text = "ReDirecting to Home.aspx";
> Response.Redirect("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


Jul 21 '05 #5

P: n/a
Hi Paul,

Very cool. I use Forms Auth. with webhost4life and I use the <location>
tags for restricting access to different member roles. Remember to put the
<location> tags between the <configuration> and <system.web> tags. The
<authorization> tag should go in place of the one that is currently in your
Web.config in the <system.web> tag. The location tags below are used if you
are assigning people to roles, I figured that you were. But if you aren't
then change it to <allow users=""> and put in the user names you allow.
Also the Web.config file this goes in should be in the root directory of
your web app and the paths in the <location> tags should be relative to your
root directory. 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" <Pa********@discussions.microsoft.com> wrote in message
news:BA**********************************@microsof t.com...
Thanks Ken,
I looked at the webhost4life site and when I get closer to ready, I'll
probably sign up there. I also tried your suggestion about the web.config file and I don't have it working (yet - with multiple 'location path'
statements) but I think you put me on the right path.
Thanks again,
Paul
"Ken Dopierala Jr." wrote:
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" ?>
<configuration>

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

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

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

<authorization>
<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" <Pa********@discussions.microsoft.com> wrote in message
news:C4**********************************@microsof t.com...
YES - I am using
<authentication 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:

> 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" <Pa********@discussions.microsoft.com> wrote in message
> news:4B**********************************@microsof t.com...
> > 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_Click(object sender, System.EventArgs e)
> > {
> > bool MyVar = true;
> > Msg.Text = "ReDirecting to Home.aspx";
> > Response.Redirect("Home.aspx",MyVar);
> > }
> > AND.....
> > private void LinkButton2_Click(object sender, System.EventArgs e)
> > {
> > Msg.Text = "ReDirecting to Home.aspx";
> > Response.Redirect("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
>
>
>


Jul 21 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.