Cannot display images

  • Thread starter Thread starter egsdar
  • Start date Start date
E

egsdar

Yesterday everytime i hit on "view in browser.." it displays fine the images,
but today in the morning can't do it.
How can i solve this, tomorrow i have to do a presentation, so i really
appreciate your help.
 
Eat more.. So you get stronger and hit "view in browser" stronger.
I had the same problem when i was 5. I ate and ate and now i am 36 and no
problem with hitting "view in browser" Works from first time always...


George.
 
Well, I completely did not understand your problem in your first post so I
gave you a funny answer.
But since you've followed up :)

Here is my guess what is wrong with your code (at least what is wrong with
the code on this page
http://www.codeproject.com/KB/session/NoCookieSessionLogin.aspx

If you are not using IIS and using bult in WebServer in Visual Studio then
..NET handles everything. Even ouput of the images.
Hence this code
Sub Application_OnPostRequestHandlerExecute()
CheckLoggedIn()
End Sub

will run and redirect to ~/Login/Login.aspx even requests like
http://localhost:12323/my.gif
which is why you do not see images.

Sollution is easy. Add the check that request URL is .aspx

Sub Application_OnPostRequestHandlerExecute()
CheckLoggedIn()
End Sub

something like this.

Sub Application_OnPostRequestHandlerExecute()

if (HttpContext.Current.Request.Path.ToLower().Substring(sPath.Length - 5)
<> ".aspx")
return;
CheckLoggedIn()
End Sub

George.
 
Back
Top