ASP.NET AsyncPostBackTrigger disables button's OnClick function???
Posted
by hahuang65
on Stack Overflow
See other posts from Stack Overflow
or by hahuang65
Published on 2010-04-10T05:59:31Z
Indexed on
2010/04/10
6:03 UTC
Read the original article
Hit count: 289
updatepanel
|asp.net-ajax
I saw another post like this: http://stackoverflow.com/questions/1795621/asyncpostbacktrigger-disables-buttons But I don't really know what to make of it. The accepted answer was poorly typed.
Basically, I have a button with an OnClick function. I also have a UpdatePanel, with is AsyncPostBackTrigger set to that same button.
It seems that if I do this, my Button no longer does ANYTHING.
I guess it's because I have a Page_Load() event... Can anyone explain why this is? And how should I set up my webpage if I can't use the Page_Load() function?
Oh and if I put my Button in a UpdatePanel, it also won't do anything, probably because of the same reason.
This is a section of my code:
<asp:FileUpload id="FileUploadControl" runat="server" />
<asp:Button runat="server" id="UploadButton" text="Upload" OnClick="uploadClicked" />
<br /><br />
<asp:Label runat="server" id="StatusLabel" text="Upload status: " />
<br />
<asp:UpdatePanel ID="UpdatePanel2" runat="server" updatemode="Conditional" >
<ContentTemplate>
<asp:DropDownList ID="songList" runat="server" />
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="RefreshButton" />
</Triggers>
</asp:UpdatePanel>
Thanks in advance.
© Stack Overflow or respective owner