Missing CustomProvider

Last post 09-26-2011, 8:13 AM by Kenneth. 1 replies.
Sort Posts: Previous Next
  •  09-26-2011, 3:13 AM 70191

    Missing CustomProvider

    I have a file already saved in my system and I know the GUID of that file. Due to some reasons I am bound to use this approach of first saving the file and then adding it to CuteWebUI.UploadAttachments manually via AddCustomAttachment.
     
    The code i have written is:
     
    Guid g = new Guid(ItemChar2C[0].ToString().Substring(18).ToString());
                    Attachments1.AddCustomAttachment(g); 
     
    But I am getting error of "Missing CustomProvider"
     
    Please help.
  •  09-26-2011, 8:13 AM 70199 in reply to 70191

    Re: Missing CustomProvider

    Hi HinaLaitkor,
     
    The example below shows you how to add the file into the attachment list.
     
    I have a file name "test.txt" at the root of the test site.
     
    <%@ Page Language="C#" %>

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

    <script runat="server">
        protected void button1_Click(object sender, EventArgs e)
        {
            using (FileStream fs = System.IO.File.Open(Server.MapPath("~/test.txt"), FileMode.Open))
            {
                uploader1.Items.Add(int.Parse(fs.Length.ToString()), fs.Name, fs);
            }
        }
    </script>

    <html xmlns="http://www.w3.org/1999/xhtml">
    <head id="Head1" runat="server">
        <title>Untitled Page</title>
    </head>
    <body>
        <form id="form1" runat="server">
            <div>
                <CuteWebUI:UploadAttachments ID="uploader1" runat="server">
                </CuteWebUI:UploadAttachments>
                <asp:Button ID="button1" runat="server" Text="add attachment" OnClick="button1_Click" />
            </div>
        </form>
    </body>
    </html>
     
    Regards,
     
    Ken
View as RSS news feed in XML