Can't get postback to update controls

Nov 19, 2010 at 4:04 PM

I place your Flajaxian FileUploader and a label to be updated after postback.

I upload a file and the postback is triggered, the label is updated on the server but it is not refreshed on the client.

My test markup as follows:

<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="WebForm1.aspx.vb" Inherits="testFlajactianFileUploader.WebForm1" %>
<%@ Register TagPrefix="fjx" Namespace="com.flajaxian" Assembly="com.flajaxian.FileUploader" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
   
    <fjx:FileUploader ID="FileUploader1" RequestAsPostBack="true" runat="server">
            <Adapters>
                <fjx:FileSaverAdapter Runat="server" FolderName="~/tmp/Uploaded" />
            </Adapters>
    </fjx:FileUploader>

    <br />

    <asp:Label ID="Label1" runat="server" Text="before postback"></asp:Label>

    </div>
    </form>
</body>
</html>

my code behind:

Public Class WebForm1
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If Page.IsPostBack Then
            Label1.Text = "after postback"
        End If
    End Sub

End Class

Dec 9, 2010 at 3:43 PM

I have the same issue. Any luck?

Coordinator
Dec 9, 2010 at 3:55 PM

Hey people this is ajax control. What post back? What are you talking about?

Dec 9, 2010 at 4:28 PM

the uploader has RequestAsPostBack property.

Coordinator
Dec 9, 2010 at 5:27 PM

Request is always on a background thread whether it is Post Back or just XML. If you want a normal post back why use this control? Use the Microsoft FileUpload control.

If you want to refresh when the upload is over use client side code:

http://flajaxian.com/flajaxian.com/FileUploader2.0Help.html#HowToUseClientSideEvents

Dec 9, 2010 at 5:31 PM

Good answer, thanks!