public ActionResult FileWriteText(TextPostData data) { var repo = _GetRepo(data); if (repo == null) { return(new HttpNotFoundResult()); } try { // TODO: in the future manage issues with versions in this repo var fullPath = repo.GetFullPath(data.Path); if (System.IO.File.Exists(fullPath)) { System.IO.File.WriteAllText(fullPath, data.Text); return(Json("success")); } return(new HttpNotFoundResult()); } catch (Exception ex) { Elmah.ErrorSignal.FromCurrentContext().Raise(ex); return(new HttpStatusCodeResult(HttpStatusCode.InternalServerError, ex.Message)); } }
private void PostTextBoxText(object obj) { TextPostData postData = (TextPostData)obj; ((TextBox)postData._lab).Text = postData._text; }
private void PostLabelText(object obj) { TextPostData postData = (TextPostData)obj; ((Label)postData._lab).Text = postData._text; }