private void AddFormToCommentView(string path) { try { CommentFormBase formView = (CommentFormBase)LoadControl(path); formView.PostItem = this.Post; phCommentForm.Controls.Add(formView); } catch (Exception ex) { Utils.Log("AddFormToCommentView", ex); } }
private void LoadCommentForm() { string path = FromThemeFolder("CommentForm.ascx"); if (!File.Exists(Server.MapPath(path))) { path = Utils.ApplicationRelativeWebRoot + "Custom/Controls/Defaults/CommentForm.ascx"; } try { CommentFormBase formView = (CommentFormBase)LoadControl(path); formView.PostItem = this.Post; phCommentForm.Controls.Add(formView); } catch (Exception ex) { Utils.Log("Error adding comment form to CommentView", ex); } }