English 中文(简体)
未从事更新小组工作的文件载荷控制
原标题:fileupload control not working in the update panel

iii

当Ajax没有正确使用其工作时,如Ajax使用更新小组,在将我的档案上上载到更严格的数据库时,皮茨帮助我。

Please advice me Dhanraj.S

问题回答

你们可以在Submit button上设定“后回事”。 之后,你可以在服务器上获得图像。

页: 1

<Triggers>
<ajax:PostBackTrigger ControlID="btnSubmit" />
</Triggers>

这是因为<代码>UpdatePanel没有在asp:FileUpload上保留档案。

工作是就更新<代码>的纽特纳特波茨坦戈/代码制定<代码> UpdatePanel

供应者有“Button”(请说“UploadFileButton”),更新了更新小组。 请贵小组照此办理。

<asp:UpdatePanel runat="server">
    <ContentTemplate>
        <asp:FileUpload ID="TestFileUpload" runat="server" />
        <br />
        <asp:Button ID="UploadFileButton" runat="server" Text="Upload File"/>
    </ContentTemplate>
    <Triggers>
        <asp:PostBackTrigger ControlID="UploadFileButton" />
    </Triggers>
</asp:UpdatePanel>

http://www.asp.net/ajax/ajax Controltoolkit/samples/asyncfileupload/asyncfileupload.aspx”rel=“nofollow”

Probably not what you are looking for but why not use jQuery to upload the file? You can use jQuery Form Plugin to do it. This is the script:

<script type="text/javascript" src="Scripts/jquery-1.4.1.min.js"></script>
<script type="text/javascript" src="Scripts/jquery.form.js"></script>
<script type="text/javascript">
    $("#myForm").ajaxForm({
        success: function (response) {
            $( #updateDiv ).append(response);
        }
    });
</script>

这是超文本:

<form id="myForm" action="http://localhost/Default.aspx" method="post"
enctype="multipart/form-data">
<div id="updateDiv" runat="server">
</div>
<div>
    <input type="file" id="filePhoto" name="filePhoto" value="" />
    <input type="submit" value="Upload Photo" />
</div>
</form>

当然,你必须处理你编码背后提出的表格,并退回适当的答复。





相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Transaction handling with TransactionScope

I am implementing Transaction using TransactionScope with the help this MSDN article http://msdn.microsoft.com/en-us/library/system.transactions.transactionscope.aspx I just want to confirm that is ...

System.Web.Mvc.Controller Initialize

i have the following base controller... public class BaseController : Controller { protected override void Initialize(System.Web.Routing.RequestContext requestContext) { if (...

Microsoft.Contracts namespace

For what it is necessary Microsoft.Contracts namespace in asp.net? I mean, in what cases I could write using Microsoft.Contracts;?

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签