AjaxFileUpload控件无法在共享窗口托管上工作 [英] AjaxFileUpload control not working on shared windows hosting
本文介绍了AjaxFileUpload控件无法在共享窗口托管上工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
Hi,
I am using AjaxFileUpload control in my project. I am able to successfully implement and test functionality of this control on development machine. But after publishing on hosting server Ajax File Upload control stopped to work. On File upload it showing me file uploaded successfully with 100% progress but I am not able to find uploaded file on server.
Designer Code:
<pre lang="HTML">
<%@ Page Title="Add Banner – Website Content Management" Language="vb" AutoEventWireup="false" MasterPageFile="~/AdminPanel/Site.master" CodeBehind="AddBanner.aspx.vb" Inherits="Suvidhi.AddBanner" %>
<%@ Implements Interface="Idunno.AntiCsrf.ISuppressCsrfCheck" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<div align="center"><h2>Upload Banner Images</h2></div>
<div align="center">
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<table>
<tr>
<td align="left">Meta Title: </td>
<td>
<asp:TextBox ID="txtTitle" runat="server" Height="16px" MaxLength="70"
Width="550px"></asp:TextBox></td>
<td style="width:150px;text-align:left;">
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server"
ControlToValidate="txtTitle" Display="Dynamic" ErrorMessage="*" ForeColor="Red"
SetFocusOnError="True"></asp:RequiredFieldValidator>
<asp:RegularExpressionValidator ID="RegularExpressionValidator3" runat="server"
ControlToValidate="txtTitle" Display="Dynamic" ErrorMessage="Invalid Meta Title"
ForeColor="Red" SetFocusOnError="True"
ValidationExpression="^[0-9a-zA-Z .!@$%&-:'",.]+$"></asp:RegularExpressionValidator>
</td>
</tr>
<tr>
<td align="left">Meta Keyword: </td>
<td>
<asp:TextBox ID="txtKeyword" runat="server" Height="16px" MaxLength="170"
Width="550"></asp:TextBox></td>
<td style="width:150px;text-align:left;">
<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server"
ControlToValidate="txtKeyword" Display="Dynamic" ErrorMessage="*" ForeColor="Red"
SetFocusOnError="True"></asp:RequiredFieldValidator>
<asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server"
ControlToValidate="txtKeyword" Display="Dynamic" ErrorMessage="Invalid Meta Keyword"
ForeColor="Red" SetFocusOnError="True"
ValidationExpression="^[0-9a-zA-Z .!@$%&-:'",.]+$"></asp:RegularExpressionValidator>
</td>
</tr>
<tr>
<td align="left" valign="top">Meta Description: </td>
<td>
<asp:TextBox ID="txtDescription" runat="server" Height="48px" MaxLength="160"
Width="550" TextMode="MultiLine"></asp:TextBox></td>
<td style="width:150px;text-align:left;">
<asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server"
ControlToValidate="txtDescription" Display="Dynamic" ErrorMessage="*" ForeColor="Red"
SetFocusOnError="True"></asp:RequiredFieldValidator>
<asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server"
ControlToValidate="txtDescription" Display="Dynamic" ErrorMessage="Invalid Meta Description"
ForeColor="Red" SetFocusOnError="True"
ValidationExpression="^[0-9a-zA-Z .!@$%&-:'",.]+$"></asp:RegularExpressionValidator>
</td>
</tr>
<tr>
<td align="left" valign="top">Category: </td>
<td>
<asp:DropDownList ID="cboCategory" runat="server" Width="100%">
</asp:DropDownList>
</td>
<td style="width:150px;text-align:left;">
<asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server"
ControlToValidate="cboCategory" Display="Dynamic"
ErrorMessage="Select Category" ForeColor="Red"
SetFocusOnError="True"></asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td align="left" valign="top">Banner Image File: </td>
<td align="left">
<asp:AjaxFileUpload ID="AFUBanner" ThrobberID="imgUpload" runat="server"
AllowedFileTypes="jpg,jpeg,gif,png" MaximumNumberOfFiles="1" />
</td>
<td style="width:150px;text-align:left;">
<asp:Label ID="lblImage" runat="server" ForeColor="Red"></asp:Label>
</td>
</tr>
<tr>
<td colspan="3" align="center">
<asp:Button ID="butSave" runat="server" Text="Save" Width="75px" /> <asp:Button
ID="Clear" runat="server" Text="Clear" Width="75px"
CausesValidation="False" /></td>
</tr>
<tr>
<td colspan="3" align="center">
<asp:Label ID="lblError" runat="server" ForeColor="red" Width="100%"></asp:Label></td>
</tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</asp:Content>
Code:
Code:
Private Sub AFUBanner_UploadComplete(sender As Object, e As AjaxControlToolkit.AjaxFileUploadEventArgs) Handles AFUBanner.UploadComplete
Try
Dim strPath As String = Server.MapPath("/") & "\AdminPanel\Temp\" & e.FileName
lblError.Text = strPath
lblError.Visible = True
AFUBanner.SaveAs(strPath)
Session("BannerImage") = strPath
Catch ex As Exception
End Try
End Sub
Please help me.
Thanks in advance.
Please help me.
Thanks in advance.
推荐答案
%&-:'\",.]+
%&-:'",.]+
\"></asp:RegularExpressionValidator>
</td>
</tr>
<tr>
<td align=\"left\">Meta Keyword: </td>
<td>
<asp:TextBox ID=\"txtKeyword\" runat=\"server\" Height=\"16px\" MaxLength=\"170\"
Width=\"550\"></asp:TextBox></td>
<td style=\"width:150px;text-align:left;\">
<asp:RequiredFieldValidator ID=\"RequiredFieldValidator2\" runat=\"server\"
ControlToValidate=\"txtKeyword\" Display=\"Dynamic\" ErrorMessage=\"*\" ForeColor=\"Red\"
SetFocusOnError=\"True\"></asp:RequiredFieldValidator>
< span class=\"code-keyword\"><asp:RegularExpressionValidator ID=\"RegularExpressionValidator1\" runat=\"server\"
ControlToValidate=\"txtKeyword\" Display=\"Dynamic\" ErrorMessage=\"Invalid Meta Keyword\"
ForeColor=\"Red\" SetFocusOnError=\"True\"
ValidationExpression=\"^[0-9a-zA-Z .!@
"></asp:RegularExpressionValidator> </td> </tr> <tr> <td align="left">Meta Keyword: </td> <td> <asp:TextBox ID="txtKeyword" runat="server" Height="16px" MaxLength="170" Width="550"></asp:TextBox></td> <td style="width:150px;text-align:left;"> <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="txtKeyword" Display="Dynamic" ErrorMessage="*" ForeColor="Red" SetFocusOnError="True"></asp:RequiredFieldValidator> <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ControlToValidate="txtKeyword" Display="Dynamic" ErrorMessage="Invalid Meta Keyword" ForeColor="Red" SetFocusOnError="True" ValidationExpression="^[0-9a-zA-Z .!@
%&-:'\",.]+
%&-:'",.]+
这篇关于AjaxFileUpload控件无法在共享窗口托管上工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文