Wednesday, March 28, 2012

PostBacks are not working

Help!

As soon as I change to EnablePartialRendering="true" so that I can get all the fancy Atlas functionality the buttons stop working. Weird thing is that the project was working but now it does not. I've reinstalled Atlas and I still have the same issue.

The aspx code is:

<

atlas:ScriptManagerid="s1"EnablePartialRendering="true"runat="server"/>

<

asp:PanelID=panel1runat=serverHeight="140px"Width="475px">

<

atlas:UpdatePanelID="p1"runat="server">

<

ContentTemplate><asp:LabelID="lblHello"runat=serverVisible=false>Hello World</asp:Label><asp:ButtonID="Button1"runat="server"Text="Button 1"Visible=falseOnClick="Button_Click"/><asp:ButtonID="Button2"runat="server"Text="Button 2"Visible=trueOnClick="Button_Click"/>

</

ContentTemplate>

<

Triggers>

<

atlas:ControlEventTriggerControlID="ImageButton1"EventName="Click"/>

</

Triggers>

</

atlas:UpdatePanel>

</

asp:Panel><asp:ImageButtonID="ImageButton1"runat="server"ImageUrl="~/images/but_New.gif"OnClick="ImageButton1_Click"/>

The cs code is:

protectedvoid ImageButton1_Click(object sender,ImageClickEventArgs e)

{

this.lblHello.Visible = !this.lblHello.Visible;

}

protectedvoid Button_Click(object sender,EventArgs e)

{

this.Button1.Visible = !this.Button1.Visible;this.Button2.Visible = !this.Button2.Visible;

}

And the web.config file has the following (I didn't change anything on this)

<

controls>

<

addnamespace="Microsoft.Web.UI"assembly="Microsoft.Web.Atlas"tagPrefix="atlas"/>

<

addnamespace="Microsoft.Web.UI.Controls"assembly="Microsoft.Web.Atlas"tagPrefix="atlas"/>

</

controls>

Thanks!

Hey!

try this in your Page_Load:

Page.ClientScript.GetPostBackEventReference(

new System.Web.UI.PostBackOptions(this.(control that is not posting back));

I had the same problem, and this line did the trick. This generates the _doPostBack function everytime the page loads. I'm not sure why is this necesary...

hope this works for you!


hello.

i've copied your excerpt and it looks like it's running ok here...


OK so this is REALLY weird.

My atlas post backs don't work when the page fist loads, but once I refresh the page everything works great. I've compared the webpage source code for page when it works and when it doesn't and the source code is identical.

Anyone have any ideas.

Help!!!


I'm having the same problem. Does anyone have a solution?

No comments:

Post a Comment