hye there, can anybody helps me about the update panel. I have a grid view that must show the file that i already browser. in my situation i am using Ajax control toolkit so it automatically will upload the file in the grid view. Unfortunately it did not work but the other code is work. this is my code
function clearContents() {
var AsyncFileUpload = $get("<%=MemoFileUpload.ClientID%>");
var AsyncFileUpload = $get("<%=AttorneyFileUplod.ClientID%>");
var AsyncFileUpload = $get("<%=TORFileUpload.ClientID%>");
var txts = AsyncFileUpload.getElementsByTagName("input");
for (var i = 0; i < txts.length; i++) {
if ((txts[i].type == "file") || (txts[i].type == 'text')) {
txts[i].value = "";
txts[i].style.backgroundColor = "transparent";
}
if (txts[i].type == 'text') {
txts[i].value = '';
}
}
}
function uploadComplete1(sender, args) {
clearContents();
__doPostBack("<%= HiddenButton.UniqueID %>", "");
}
function uploadComplete2(sender, args) {
clearContents();
__doPostBack("<%= HiddenButton2.UniqueID %>", "");
}
//the code that works
<td>
<%-- <asp:FileUpload
ID="MemoFileUpload" runat="server" Height="25px" Width="275px" />--%>
<asp:AsyncFileUpload
OnClientUploadComplete="uploadComplete1" runat="server" ID="MemoFileUpload"
Width="400px"
UploaderStyle="Modern" CompleteBackColor="White" UploadingBackColor="#CCFFFF"
ThrobberID="imgLoader"
OnUploadedComplete="btnMemoUplod_Click" OnClientUploadStarted="uploadStarted" />
<asp:Button runat="server"
ID="HiddenButton" Style="display: none;" />
<asp:Image ID="imgLoader"
runat="server" ImageUrl="../Images/loader.gif" /><br />
<br />
<img id="imgDisplay"
alt="" src="" style="display: none" />
</td>
<td align="right">
<asp:Button ID="btnMemoUplod"
runat="server" Text="<%$ Resources: Section64OpenKPDetailedPRS.aspx,btnMemoUplod %>" Visible="false" />
<%--CssClass="ButtonStyle"--%>
</td>
<asp:UpdatePanel ID="update1"
runat="server" UpdateMode="Always">
<Triggers>
<asp:PostBackTrigger
ControlID="btnMemoUplod" />
<%--<asp:PostBackTrigger
ControlID="GridInspection" />--%>
<%-- <asp:AsyncPostBackTrigger ControlID="btnMemoUplod" EventName="Click" />--%>
</Triggers>
<ContentTemplate>
</ContentTemplate>
</asp:UpdatePanel>
</tr>
//the code that did not work
<td>
<%--<asp:FileUpload
ID="AttorneyFileUplod" runat="server" />--%>
<asp:AsyncFileUpload
OnClientUploadComplete="uploadComplete2" runat="server" ID="AttorneyFileUplod"
Width="400px"
UploaderStyle="Modern" CompleteBackColor="White" UploadingBackColor="#CCFFFF"
ThrobberID="imgLoader1"
OnUploadedComplete="btnAttrnyUpload_Click" OnClientUploadStarted="uploadStarted" />
<asp:Button
runat="server" ID="HiddenButton2" Style="display: none;" />
<asp:Image ID="imgLoader1"
runat="server" ImageUrl="../Images/loader.gif" />
</td>
<td align="right">
<asp:Button ID="btnAttrnyUpload"
runat="server" Text="<%$ Resources: Section64OpenKPDetailedPRS.aspx,btnAttrnyUpload %>" visible ="false" />
<%--CssClass="ButtonStyle"--%>
<asp:UpdatePanel
ID="Update2" runat="server" UpdateMode="Conditional">
<Triggers>
<asp:PostBackTrigger ControlID="btnAttrnyUpload" />
<%--<asp:PostBackTrigger ControlID="grdAttorny" />--%>
</Triggers>
<ContentTemplate>
</ContentTemplate>
</asp:UpdatePanel>
</td>
</tr>