Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
AI OnAI Off
Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
//Create a InputPageReference on the fly EPiServer.WebControls.InputPageReference pref = new EPiServer.WebControls.InputPageReference(); //Setting text value (if not still in view mode, now in edit) pref.Text = "4"; //Put an id to the control before render pref.ID = "pref1"; System.Text.StringBuilder result = new System.Text.StringBuilder(1024); pref.RenderControl(new HtmlTextWriter(new System.IO.StringWriter(result))); //Patch EPiServers webcontrol! Is this a bug? result.Replace("document.all['Hidden'].value,'Display','Hidden'", "document.all['" + pref.ID + "$Hidden'].value,'" + pref.ID + "$Display','" + pref.ID + "$Hidden'"); //Set the control, it could be just right to a pages form. In this case inside a webgrid's row event: e.Row.Columns["Source"].BeforeEditHtml = Server.HtmlEncode(result.ToString()) + result.ToString();