Topic: ASP page refresh (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=29059" title="Pages that link to Topic: ASP page refresh (Page 1 of 1)" rel="nofollow" >Topic: ASP page refresh <span class="small">(Page 1 of 1)</span>\

 
Lord_Fukutoku
Paranoid (IV) Inmate

From: San Antonio
Insane since: Jul 2002

posted posted 03-22-2007 17:23

I inherited a project last week written in ASP/C#, and since I've never worked with ASP (and my web skills are incredibly lacking anyways), I have a feeling this won't be the only question I have.

I have a page that displays a bunch of data and two radio buttons to select the units to display the data in (metric/english). Teh page loads on metric and eveything is good. I click english, the page reloads, but the data is still in metric. Now I click metric, the page reloads, and the data shows up in english units.

The first thing I thought was the obvious 'oops, the radio buttons are backwards,' but that's not the case. If it's in the debugger, I hit my breakpoints in the correct convert method, the modified values just don't display until I click another radio button. (I even added a third radio button to test with ('fake units') and it was one behind, not just wrong )

Anyone have any ideas what I'm missing here? Or any ideas where to look?

Thanks,
LF

--

Any sufficiently advanced bug is indistinguishable from a feature.

Lord_Fukutoku
Paranoid (IV) Inmate

From: San Antonio
Insane since: Jul 2002

posted posted 03-22-2007 18:09

I think I figured it out now...

AutoPostBack was true for the radio buttons, so it was reloading the page (on page load, it was calling DataBind on the GridView) before it was converting the data. So the next time the page was loaded, it called DataBind on the last set of data used, then updated the data. As a temporary fix, I just call DataBind after I do the conversions and it works.

--

Any sufficiently advanced bug is indistinguishable from a feature.



Post Reply
 
Your User Name:
Your Password:
Login Options:
 
Your Text:
Loading...
Options:


« BackwardsOnwards »

Show Forum Drop Down Menu