當前位置: 首頁>>代碼示例>>C#>>正文


C# AjaxControlToolkit.GetContents方法代碼示例

本文整理匯總了C#中AjaxControlToolkit.GetContents方法的典型用法代碼示例。如果您正苦於以下問題:C# AjaxControlToolkit.GetContents方法的具體用法?C# AjaxControlToolkit.GetContents怎麽用?C# AjaxControlToolkit.GetContents使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在AjaxControlToolkit的用法示例。


在下文中一共展示了AjaxControlToolkit.GetContents方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: ajaxFileUpload_OnUploadComplete

    protected void ajaxFileUpload_OnUploadComplete(object sender, AjaxControlToolkit.AjaxFileUploadEventArgs e)
    {
        if(e.ContentType.Contains("jpg") || e.ContentType.Contains("gif")
            || e.ContentType.Contains("png") || e.ContentType.Contains("jpeg")) {
            Session["fileContentType_" + e.FileId] = e.ContentType;
            Session["fileContents_" + e.FileId] = e.GetContents();
        }

        // Set PostedUrl to preview the uploaded file.
        e.PostedUrl = string.Format("?preview=1&fileId={0}", e.FileId);
    }
開發者ID:CharlieBP,項目名稱:AjaxControlToolkit,代碼行數:11,代碼來源:HtmlEditorExtender.aspx.cs

示例2: UploadComplete

        protected void UploadComplete(object sender, AjaxControlToolkit.AjaxFileUploadEventArgs e)
        {
            try
            {
                Account account = new Account("dlyvxs7of", "634626974285569", "FtB_0jhcmFypFS7QTwCBKcPRGzE");

                Cloudinary cloudinary = new Cloudinary(account);
                ImageUploadParams uploadParams = new ImageUploadParams()
                    {
                        File = new FileDescription("file", new MemoryStream(e.GetContents()))
                    };

                ImageUploadResult uploadResult = cloudinary.Upload(uploadParams);

                HEWDataContext context = new HEWDataContext();
                context.ProjectsImages.InsertOnSubmit(new ProjectsImage
                    {ImgPublicID = uploadResult.PublicId, ProjectID = int.Parse(Request.QueryString["ProjectID"])});
                context.SubmitChanges();
            }
            catch (Exception)
            {
            }
        }
開發者ID:AdhamMowafy,項目名稱:AlHuda,代碼行數:23,代碼來源:ProjectImages.aspx.cs

示例3: saveImage

        protected void saveImage(object sender, AjaxControlToolkit.AjaxFileUploadEventArgs e)
        {
            string tempPath = System.IO.Path.GetTempPath();
            System.Drawing.Image img = new GUIHelper().byteArrayToImage(e.GetContents());

            if (Session["fileContentType_"] == null)
            {
                Session.Add(("fileContentType_"), e.ContentType);
            }
            Session["fileContentType_"] = e.ContentType;

            if (Session["fileContents_"] == null)
            {
                Session.Add("fileContents_", e.GetContents());
            }
            Session["fileContents_"] = e.GetContents();

            string relativePath = Page.AppRelativeVirtualPath;
            relativePath = relativePath.Replace("~", "");
            e.PostedUrl = String.Format("/HRM" + relativePath + "?preview=1");
        }
開發者ID:GramozKrasniqi,項目名稱:HRMS,代碼行數:21,代碼來源:PersonalInformation.aspx.cs


注:本文中的AjaxControlToolkit.GetContents方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。