I cant seem to generate an async postback.
-
I need to use ajax to handle price calculations based on user selections, i was going to use a checkbox list, but i discovered that i can't seem to get an async postback happening. i have a calendar extender on the page that works perfectly from the Ajax Control Toolkit, but i cant get this simple example to work. Works fine outside of this page/project. I'm using asp.net 3.5 the solution was converted from 1.1 to 3.5 a while ago. I cant post the whole page(rather long) this appears about 650 lines down up top i have form div asp:scriptManager then some tables some nested in the row above this i have another dateTime. Now codeblock to see if i can get the dates out of synch which seems to be a standard example on all the sites i've looked at. Regardless of what i do the button in the updatePanel runs a whole postback, i've tried setting triggers, enabling partial rendering(and having it off) setting the children as triggers property, along with the render and update modes. I've read Dino Esposito's book on ajax along with other artciles and anything i can find.
<asp:UpdatePanel ID="JokeUpdatePanel" runat="server"> <ContentTemplate> <asp:Label ID="JokeText" runat="server"></asp:Label><br /> <br /><%=DateTime.Now %> <asp:Button ID="NewJokeButton" runat="server" OnClick="NewJokeButton\_Click" Text="Show Me a Random Joke!" /> </ContentTemplate> </asp:UpdatePanel>
I've disabled most of the things i do on page_load event incase it was messing with something now all i do is in the initial load of the page (!page.IsPostBack) and set up a db connection(dont open it just create it), which shouldnt matter. no matter what i try the whole page refreshes, but the demo project i have on the same server runs fine. I've tried the integrated server in VS 2008 sp1, and IIS on my local machine. Any help would be appreciated, I think it may have something to do with having converted the project but i have no idea what or how to fix it. John
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are a
-
I need to use ajax to handle price calculations based on user selections, i was going to use a checkbox list, but i discovered that i can't seem to get an async postback happening. i have a calendar extender on the page that works perfectly from the Ajax Control Toolkit, but i cant get this simple example to work. Works fine outside of this page/project. I'm using asp.net 3.5 the solution was converted from 1.1 to 3.5 a while ago. I cant post the whole page(rather long) this appears about 650 lines down up top i have form div asp:scriptManager then some tables some nested in the row above this i have another dateTime. Now codeblock to see if i can get the dates out of synch which seems to be a standard example on all the sites i've looked at. Regardless of what i do the button in the updatePanel runs a whole postback, i've tried setting triggers, enabling partial rendering(and having it off) setting the children as triggers property, along with the render and update modes. I've read Dino Esposito's book on ajax along with other artciles and anything i can find.
<asp:UpdatePanel ID="JokeUpdatePanel" runat="server"> <ContentTemplate> <asp:Label ID="JokeText" runat="server"></asp:Label><br /> <br /><%=DateTime.Now %> <asp:Button ID="NewJokeButton" runat="server" OnClick="NewJokeButton\_Click" Text="Show Me a Random Joke!" /> </ContentTemplate> </asp:UpdatePanel>
I've disabled most of the things i do on page_load event incase it was messing with something now all i do is in the initial load of the page (!page.IsPostBack) and set up a db connection(dont open it just create it), which shouldnt matter. no matter what i try the whole page refreshes, but the demo project i have on the same server runs fine. I've tried the integrated server in VS 2008 sp1, and IIS on my local machine. Any help would be appreciated, I think it may have something to do with having converted the project but i have no idea what or how to fix it. John
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are a
You should set up a update target in the update panel that points to your button control. That'll force the update panel to respond via callback to the button's click event.
-
You should set up a update target in the update panel that points to your button control. That'll force the update panel to respond via callback to the button's click event.
I've tried setting up the triggers on the update panel, as well as ChildrenAsTriggers, i dont see where you can set up a target. The button click will change the text of a text box in the update panel's contentTemplate, and there's a datetime value that refreshes.
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.