Showing posts with label javascript. Show all posts
Showing posts with label javascript. Show all posts

Sunday, February 21, 2016

Tuesday, September 22, 2015

asp.net fire button click in javascript function

<asp:Button ID="btnSetRadEditorContent" runat="server" OnClick="btnSetRadEditorContent_Click" Style="display: none;" />


 function SetDocumentEditorSrc(WrkID) {
                __doPostBack('<%= btnSetRadEditorContent.UniqueID %>');
            }


  protected void btnSetRadEditorContent_Click(object sender, EventArgs e)
        {
            string filePath = Server.MapPath("~/SampleInitialContent.docx");
            byte[] fileBinaryData = File.ReadAllBytes(filePath);
            string convertedContent = Functions.ConvertDocxToHtml(fileBinaryData);

            RadEditor1.Content = convertedContent;
        }

Tuesday, August 18, 2015

asp.net access c# variable in javascript

1)  asp.net code behind
 public partial class UploadMultipleFiles : System.Web.UI.Page
    {
        public string eCabinetbaseURL = Functions.ToString(ConfigurationManager.AppSettings["eCabinetServiceUrl"]);

        protected void Page_Load(object sender, EventArgs e)
        {

        }
    }

2)  In Javascript function

 var eCabinetServiceUrl = '<%=eCabinetbaseURL%>';