Cannot display images

Discussion in 'ASP .Net' started by egsdar, Oct 13, 2008.

  1. egsdar

    egsdar Guest

    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.
     
    egsdar, Oct 13, 2008
    #1
    1. Advertising

  2. egsdar

    George Guest

    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.


    "egsdar" <> wrote in message
    news:...
    > 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.
     
    George, Oct 13, 2008
    #2
    1. Advertising

  3. egsdar

    egsdar Guest

    You made me laugh. I think you should be fat because you're eating so much.
    But seriously i found out that the code that i implement from this web page
    was the cause of it:

    http://www.codeproject.com/KB/session/NoCookieSessionLogin.aspx

    But the new question would be: How can I validate users with sessions or
    what is the error with the code that is not allowing me to display the images?



    "George" wrote:

    > 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.
    >
    >
    > "egsdar" <> wrote in message
    > news:...
    > > 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.

    >
    >
     
    egsdar, Oct 13, 2008
    #3
  4. egsdar

    George Guest

    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.


    "egsdar" <> wrote in message
    news:...
    > You made me laugh. I think you should be fat because you're eating so
    > much.
    > But seriously i found out that the code that i implement from this web
    > page
    > was the cause of it:
    >
    > http://www.codeproject.com/KB/session/NoCookieSessionLogin.aspx
    >
    > But the new question would be: How can I validate users with sessions or
    > what is the error with the code that is not allowing me to display the
    > images?
    >
    >
    >
    > "George" wrote:
    >
    >> 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.
    >>
    >>
    >> "egsdar" <> wrote in message
    >> news:...
    >> > 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.

    >>
    >>
     
    George, Oct 13, 2008
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Guest
    Replies:
    4
    Views:
    902
    Eliyahu Goldin
    Jan 4, 2005
  2. Luis Esteban Valencia Muñoz
    Replies:
    0
    Views:
    774
    Luis Esteban Valencia Muñoz
    Jun 3, 2005
  3. wardemon

    Cache Images vs Static Images

    wardemon, Jun 14, 2007, in forum: ASP .Net
    Replies:
    3
    Views:
    667
    bruce barker
    Jun 14, 2007
  4. Keith Hughitt
    Replies:
    6
    Views:
    1,073
  5. Adrienne Boswell
    Replies:
    1
    Views:
    511
    dorayme
    Aug 4, 2009
Loading...

Share This Page