Tech Off Thread

11 posts

Post back issues with ASP Button

Back to Forum: Tech Off
  • User profile image
    lesmemphis

    I've got an asp:button that calls server side code. But sometimes when the page loads, none of the buttons will post back. Nothing happens. Then I navigate away from the page and come back, then everything works. I've tried to debug, but I don't get the same problem when running from localhost and debugging through Visual Studio. It only happens when the site is live.

     

    Why does this happen? How do I fix this?

  • User profile image
    itsnotabug

    i've seen something similar before but i have not been able to duplicate it. it happens so rarely that i haven't investigated it too much. it usually manifests itself with a phone call once or twice a year.

     

    them: the links on the page don't do anything

    me: press f5

    them: oh that did it, now they work. thank you.

     

    i attribute it to "wonkiness" of the browser (very technical term). if it happened more, i'd probably have them view source and send me the html so i could verify that it looked okay. as always, your situation may be caused by something else, but i've had similar problems on paypal and other high visibility sites.

  • User profile image
    lesmemphis

    itsnotabug said:

    i've seen something similar before but i have not been able to duplicate it. it happens so rarely that i haven't investigated it too much. it usually manifests itself with a phone call once or twice a year.

     

    them: the links on the page don't do anything

    me: press f5

    them: oh that did it, now they work. thank you.

     

    i attribute it to "wonkiness" of the browser (very technical term). if it happened more, i'd probably have them view source and send me the html so i could verify that it looked okay. as always, your situation may be caused by something else, but i've had similar problems on paypal and other high visibility sites.

    The randomness of the occurrences is quite baffling, but it does happen a lot in my case. Problem is, the "they" an "me" in your example is both me.

     

    My logic says that when I run from local host, both the client and server is on the same pc, whereas when the site is live, the client and server is on remote locations. This could possibly indicate to time-out issues between postback; interruptions in connection; or packets lost during post back. The latter 2 possibilities seem less likely though. I think my problem is either again with standards compliance (using asp:tools incorrectly) or some other minor detail I've overlooked, but I'm at a loss to what it is!  Perplexed

  • User profile image
    lesmemphis

    I've found a related topic on a forum that suggested the MTU (maximum transmission unit) settings on the server be changed. Does this sound like a viable solution and could this be the cause of my problem?

  • User profile image
    W3bbo

    lesmemphis said:

    I've found a related topic on a forum that suggested the MTU (maximum transmission unit) settings on the server be changed. Does this sound like a viable solution and could this be the cause of my problem?

    MTU just affects efficiency of transfer, the same data is received by the client from the server, it just takes longer.

  • User profile image
    lesmemphis

    W3bbo said:
    lesmemphis said:
    *snip*

    MTU just affects efficiency of transfer, the same data is received by the client from the server, it just takes longer.

    damn, ok. So any idea what could be causing my problem? I've reviewed the code countless times and tried to debug from local host on numerous occassions and not once have I gotten the error, but as soon as the site is live, it happens.

  • User profile image
    W3bbo

    lesmemphis said:
    W3bbo said:
    *snip*

    damn, ok. So any idea what could be causing my problem? I've reviewed the code countless times and tried to debug from local host on numerous occassions and not once have I gotten the error, but as soon as the site is live, it happens.

    Save a copy of the generated markup from both production and development, ensure it validates, then run a diff. Then report back your findings.

  • User profile image
    lesmemphis

    W3bbo said:
    lesmemphis said:
    *snip*

    MTU just affects efficiency of transfer, the same data is received by the client from the server, it just takes longer.

    Cool, will do.

  • User profile image
    lesmemphis

    W3bbo said:
    lesmemphis said:
    *snip*

    Save a copy of the generated markup from both production and development, ensure it validates, then run a diff. Then report back your findings.

    It seems the problem was to do with sessions. Sometimes when I call a variable in a session it returns a null, but if I just call it again, it returns the value. So now I just build a check in. Haven't had the problem since. Still holding fingers crossed that it won't happen again.

  • User profile image
    lesmemphis

    lesmemphis said:
    W3bbo said:
    *snip*

    It seems the problem was to do with sessions. Sometimes when I call a variable in a session it returns a null, but if I just call it again, it returns the value. So now I just build a check in. Haven't had the problem since. Still holding fingers crossed that it won't happen again.

    Well, it seems my problem is STILL not solved. Wow, this is turning out to be a headache of note.

     

    I'm convinced that the problem lies with my sessions. It seems that under stress testing; after certain time periods; and at other random intervals, the site won't work.

     

    It can't be the session timeout period, because the default (according to W3Schools) is 20 minutes.

     

    Check out the problem on my ">http://www.semper-backpacking.com/"> BookNow pages. Try it with different browsers and add and remove numerous times when it does work. (Note that this site is in test phase).

     

    ---------------------------------------------------------------------------------------------------------------------------------------------------

     

    Update : Apparently Sessions are designed to handle only very small amounts of data like a sinle name or ip adress. Which means the 2 datatables i'm saving is too large. So I'll be writing to a db instead of using a session. Hopefully this will resolve the issue.

     

    Any thoughts on this?

  • User profile image
    itsnotabug

    lesmemphis said:
    lesmemphis said:
    *snip*

    Well, it seems my problem is STILL not solved. Wow, this is turning out to be a headache of note.

     

    I'm convinced that the problem lies with my sessions. It seems that under stress testing; after certain time periods; and at other random intervals, the site won't work.

     

    It can't be the session timeout period, because the default (according to W3Schools) is 20 minutes.

     

    Check out the problem on my ">http://www.semper-backpacking.com/"> BookNow pages. Try it with different browsers and add and remove numerous times when it does work. (Note that this site is in test phase).

     

    ---------------------------------------------------------------------------------------------------------------------------------------------------

     

    Update : Apparently Sessions are designed to handle only very small amounts of data like a sinle name or ip adress. Which means the 2 datatables i'm saving is too large. So I'll be writing to a db instead of using a session. Hopefully this will resolve the issue.

     

    Any thoughts on this?

    have you scraped the html off the working and non-working pages? have you compared them?

     

    sessions shouldn't have anything to do with the client side functionality of a link button actually being clickable (if that's what the problem is). you would get the error on postback with funky session values, but the link would still be clickable.

     

    try writing all your session objects out to the page to inspect their values. for low volume sites it's not uncommon to have complex objects living purely in session.

Comments closed

Comments have been closed since this content was published more than 30 days ago, but if you'd like to continue the conversation, please create a new thread in our Forums, or Contact Us and let us know.