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

  • Thread starter Daniel Walzenbach
  • Start date
D

Daniel Walzenbach

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
 
S

Steven Cheng[MSFT]

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.)
 
G

Guest

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
 
D

Daniel Walzenbach

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

Daniel Walzenbach said:
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"
/> said:
Regarding your question whether some pages are protected I have to add
that basically all pages are protected and only accessible after logging in.
 
S

Steven Cheng[MSFT]

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.)
 
G

Guest

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
 
S

Steven Cheng[MSFT]

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-us/cpguide/html/cpconsimplecookieauthen
tication.asp?frame=true

#Forms Authentication Provider
http://msdn.microsoft.com/library/en-us/cpguide/html/cpconthecookieauthentic
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.)
 
S

Steven Cheng[MSFT]

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.)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top