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

half rendered page on first load :-( after refreshing everything is fine

P: n/a
Hi,

when I start my asp.net page for the first time I almost always get the
following output:

form name="Form1" method="post"
action="Login.aspx?ReturnUrl=%2fatv2004%2fDefault. aspx" id="Form1">

After refreshing the page everything is perfectly fine and the page gets
rendered.

I have forms authentication enabled but have seen this error in another
application which doesn't use any authentication at all.

Has anybody else observed this phenomenon and knows how to solve it?

Thank you a lot in advance!

Daniel Walzenbach
Nov 18 '05 #1
Share this Question
Share on Google+
7 Replies


P: n/a
Hi Daniel,
Thanks for posting in the community!
From your description, you found some certain pages in some of your web
applications will output the following content when they're first time
requested:
--------------------
form name="Form1" method="post"
action="Login.aspx?ReturnUrl=%2fatv2004%2fDefault. aspx" id="Form1">
--------------------
And they work well when refresh them again,yes?
If there is anything I misunderstood, please feel free to let me know.

As for this problem, I'd like to confirm some furthing points on it:
1. Would you please provide some detailed infos on your application's
Authentication setting? Since you mentioned that you use the
FormsAuthentication in one web app, you must have set some certain pages or
folders in that web app as protected from unauthenticated user's
visiting,yes? So please check those pages (with this problem) to see
whether there is any code or links which refer to the some certain
protected pages in the FormAuthentication based webapp.

2. You may try change the FormsAuthenction web app to use "Windows"
authentication and run those pages again to see whether the problem remain.

Please check out the above suggestions. If you have any questions, please
feel free to let me know.
Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Nov 18 '05 #2

P: n/a
Steven

your conclusion was perfectly right. Regarding to your first point I copied parts of my web.config (of which I only have one located in the root of the application)

<authentication mode="Forms"><forms loginUrl="/ATV2004/Account/Login.aspx" timeout="18" /></authentication><authorization><deny users="?" /><!-- Alle Benutzer zulassen --></authorization

Regarding your question whether some pages are protected I have to add that basically all pages are protected and only accessible after logging in

Thank you for your help
Daniel Walzenbac

Nov 18 '05 #3

P: n/a
btw.. don't care about <!-- Alle Benutzer zulassen --> (for those of you who
understand German). It's a default comment from VS.

"Daniel Walzenbach" <da**********************@freudenberg.de> schrieb im
Newsbeitrag news:E6**********************************@microsof t.com...
Steven,

your conclusion was perfectly right. Regarding to your first point I copied parts of my web.config (of which I only have one located in the root
of the application):
<authentication mode="Forms"><forms loginUrl="/ATV2004/Account/Login.aspx" timeout="18"
/></authentication><authorization><deny users="?" /><!-- Alle Benutzer
zulassen --></authorization>
Regarding your question whether some pages are protected I have to add that basically all pages are protected and only accessible after logging in.
Thank you for your help!
Daniel Walzenbach

Nov 18 '05 #4

P: n/a
Hi Daniel,
Thanks for your promp response and the further inforamtion you provided.
How about the current state of this issue now? I've got that in the
FormsAuthenticaion based web app, all pages are protected from
unauthenticated user. Then, does this problem occur on the page before the
user has loged in or after that? If the problem occurs after the user has
been login, I feel it a bit strange. Can you create a simple page, as
simple as possible to repro this problem? And then, compare this page with
those which don't suffer this problem to see whether there are any
differences between them? Also, since this problem also exist in other web
application, you may also compare the pages in those application to see
whether there is any similar features in the error pages.

Meanwhile, if you have any questions, please feel free to post here.
Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Nov 18 '05 #5

P: n/a
Steven

The problem occurs before the user logs in. I have a default.aspx which redirects (using Response.Redirect("/ATV2004/Account/Login.aspx") in code behind) to /ATV2004/Account/login.aspx where the user authentication takes place. After the user was authenticated correctly he finally gets redirected where I want him to be.
The half rendered page I poste
------
form name="Form1" method="post" action="Login.aspx?ReturnUrl=%2fatv2004%2fDefault. aspx" id="Form1"
------
is the default.aspx page meaning the first page which gets opened by IIS. Later on I had the idea that I could skip redirecting the user to /ATV2004/Account/login.aspx since they should be automatically redirected to this page because of the settings in the web.config. This approach worked perfectly well on my development computer but failed on my productive IIS. Do I have to redirect my user manually or are my settings in the web.config sufficient?

Nov 18 '05 #6

P: n/a
Hi Daniel,
Thanks for your followup and the further information you provided. Since
you mentioned that the problem occured before user has loged in, I think
the former problem in this issue if probably caused by the page you
manually redirect user to the login page. And I think you've also got it
that it's no need to manually redirect user to login page if you have
implemented the FormsAuthentication and set the "loginUrl". Then if
unathenticated user visit some certain protected pages, he'll be
automatically redirect to the "loginUrl". If you have anything unclear on
using the FormsAuthentication, here is some weblink to the reference and a
simple sample on ASP.NET FormsAuthentication:

#.NET Framework Developer's Guide Simple Forms Authentication
http://msdn.microsoft.com/library/en...lecookieauthen
tication.asp?frame=true

#Forms Authentication Provider
http://msdn.microsoft.com/library/en...ookieauthentic
ationprovider.asp?frame=true

As for the new problem "the form authentication not work after deploying on
the productive server", yes? I think you may first have a check on the
web.config file's "Authentication" block. I notice that you set the
absolute url for the "loginUrl" in your config file as below:
/ATV2004/Account/Login.aspx
Have you adjust it according to the proper path structure on the
productive server or is it possible that the the ASP.NET can't find the
login page correctly? Also, I suggest that you have a check on the
web.config file and compare with the example in the tech article I provide
above.
In addtion, if the suggestoin if not quite suitable, would you please
provide me some further description on how the FormsAuthentication not work
on productive machine?

Please check out the above things. If you feel anything unclear, please
feel free to let me know.
Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Nov 18 '05 #7

P: n/a
Hi Daniel,
I haven't heard from you, have you got any progress on this issue? If you
have any questions or need any assistance, please feel free to post here.
Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Nov 18 '05 #8

This discussion thread is closed

Replies have been disabled for this discussion.