Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
405
Server Side Event Handler (eg. Button click) doesn't trigger with oEvent.fullPostBack = true
posted

        <igtab:UltraWebTab ID="tabSource" runat="server" AsyncMode="On">
            <ClientSideEvents BeforeAsyncSubmit="UltraWebTab1_BeforeAsyncSubmit" />
            <Tabs>
                <igtab:Tab Key="UP" Tag="Upload" Text="Upload">
                    <ContentTemplate>
                        <table>
                            <tr>
                                <td>
                                    <asp:FileUpload ID="FileUpload1" runat="server" />
                                    <asp:Button ID="btnUpload" runat="server" OnClick="btnUpload_Click" Text="Upload" />
                                </td>
                            </tr>
                        </table>
                    </ContentTemplate>
                </igtab:Tab>
                <igtab:Tab Key="AB" Tag="Tab AB" Text="TabAB">
                    <ContentTemplate>
                        SIMPLE TEXT
                    </ContentTemplate>
                </igtab:Tab>
            </Tabs>
        </igtab:UltraWebTab>

Then here's the client side script

<script type="text/javascript">
function UltraWebTab1_BeforeAsyncSubmit(oWebTab, notUsed, oEvent, id)
{
    // if async postback was triggered by
    // btnUpload then trigger full postback
    if(id.indexOf('btnUpload') > 0)
    {
        oEvent.fullPostBack = true;
    }
}
</script>

Then the code behind

    protected void Page_Load(object sender, EventArgs e)
    {
    }

    protected void btnUpload_Click(object sender, EventArgs e)
    {
        string path = @"C:\temp\" + FileUpload1.FileName;
        FileUpload1.SaveAs(path);
    }

 When fullPostback is set to true in BeforeAsyncSubmit, the page postsback as expected but the button's click event handler doesn't run. My goal is to support file upload inside a web tab and without setting the fullPostBack the button click event fires but as we know, the FileUpload will have no relevant data/content.