0

I am using ImageGallery control of FreeTextbox DLL for uploading images to server. The issue i am facing is when i click on upload button this error page is shown enter image description here I Check the console of chrome, i got following error

enter image description here

here is my aspx code of ftb.imagegallery.aspx

<%@ Register TagPrefix="FTB" Namespace="FreeTextBoxControls" Assembly="FreeTextBox, Version=3.3.1.12354, Culture=neutral, PublicKeyToken=5962a4e684a48b87" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
        <div>
            <FTB:ImageGallery ID="ImageGallery1"
                AllowImageDelete="true" JavaScriptLocation="InternalResource" UtilityImagesLocation="InternalResource"
                AllowImageUpload="true" AllowDirectoryCreate="true" AllowDirectoryDelete="true" runat="Server"  />
        </div>

    </form>
</body>
</html>
KanisXXX
  • 757
  • 7
  • 19

1 Answers1

0

I didn't able to solve this issue, Alternatively I manage to get past to this problem by manual uploading the image using A FileUpload Controll. Here is my code for anyone who face this problem in future.

1.ftb.imagegallery.aspx

 <form id="form1" runat="server">
        <div>
            <FTB:ImageGallery ID="ImageGallery1"
                AllowImageDelete="true" JavaScriptLocation="InternalResource" UtilityImagesLocation="InternalResource"
                AllowImageUpload="False" AllowDirectoryCreate="true" AllowDirectoryDelete="true" runat="Server" />
        </div>
        <div class="col-md-6">
            <div class="col-md-8">
                <asp:FileUpload runat="server" ID="fileupload1" CssClass="form-control" AllowMultiple="False" />
            </div>
            <div class="col-md-4">
                <asp:Button runat="server" Text="UPLOAD" CssClass="btn btn-success" ID="btnsumbit" OnClick="btnsumbit_OnClick" />
            </div>
        </div>
    </form>

2.Code behind

 protected void Page_Load(object sender, EventArgs e)
    {

    }

    protected void btnsumbit_OnClick(object sender, EventArgs e)
    {
        if (fileupload1.HasFile)
        {
            foreach (HttpPostedFile file in fileupload1.PostedFiles)
            {
                string fileName = Path.GetFileName(fileupload1.PostedFile.FileName);
                fileupload1.PostedFile.SaveAs(Server.MapPath("~/Images/") + fileName);
                Response.Redirect(Request.Url.AbsoluteUri);
            }  
        }
    }
KanisXXX
  • 757
  • 7
  • 19