Validator.RenderControl(htmlTextWriter) returns empty string?
-
Hello! I've got an aspx-file which I use for AJAX to return different stuff depending on querystring. I one case I return an webusercontrol(.ascx) with a bunch of controls including a couple of validators. When I try to do this: myWebUserControl.RenderControl(myHtmlTextWriter) none of the asp:validator-controls gets rendered in html. This includes asp:RequiredFieldValidator and asp:ValidationSummary. What do I have to do in order for those controls to also be rendered?
-
Hello! I've got an aspx-file which I use for AJAX to return different stuff depending on querystring. I one case I return an webusercontrol(.ascx) with a bunch of controls including a couple of validators. When I try to do this: myWebUserControl.RenderControl(myHtmlTextWriter) none of the asp:validator-controls gets rendered in html. This includes asp:RequiredFieldValidator and asp:ValidationSummary. What do I have to do in order for those controls to also be rendered?
In design mode drag the .ascx onto the form. put the control inside a panel in the page load set panel.style.value = "display:none"; in ajax event when you want to display the ascx set panel.style.value = ""; Did that help?
I didn't get any requirements for the signature
-
In design mode drag the .ascx onto the form. put the control inside a panel in the page load set panel.style.value = "display:none"; in ajax event when you want to display the ascx set panel.style.value = ""; Did that help?
I didn't get any requirements for the signature
Hello and thanks for your reply! Actually this did solve part of the problem. Now I do get html for the validators like this:
span id="Login1_validatorReqFieldUserName" style="color: Red; display: none;"
but I don´t seem to get the javascripts that makes the actual validation work.