Note that there are some explanatory texts on larger screens.

plurals
  1. POAsp.net Dynamic Validators don't work in Chrome or Safari
    primarykey
    data
    text
    <p>Ok, I'm dynamically creating Asp.net validation controls and inserting them into an update panel. The validation works in IE and Firefox, but not in Chrome or Safari.</p> <p>Here is the aspx file. Don't ask why I'm not using a button server control...</p> <pre><code> &lt;asp:ScriptManager ID="ScriptManager1" runat="server" /&gt; &lt;div&gt; &lt;asp:Label ID="Label1" runat="server" Text="Label"&gt;&lt;/asp:Label&gt; &lt;asp:UpdatePanel ID="UpdatePanel1" UpdateMode="Always" runat="server"&gt; &lt;ContentTemplate&gt; &lt;asp:PlaceHolder ID="PlaceHolder1" runat="server"&gt;&lt;/asp:PlaceHolder&gt; &lt;input id="Button1" type="button" value="submit" onclick='javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("Button1", "btnNext", true, "", "", false, true))' /&gt; &lt;/ContentTemplate&gt; &lt;/asp:UpdatePanel&gt; &lt;/div&gt; </code></pre> <p>Here is the code behind:</p> <pre><code> Dim Survey As New Survey Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load If Request("__EVENTARGUMENT") = "btnNext" Then NextClick() End If Label1.Text = Date.Now.ToString End Sub Private Sub NextClick() Survey.RenderPage(PlaceHolder1) End Sub </code></pre> <p>And here is the class:</p> <pre><code> Public Class Survey Public Sub RenderPage(ByVal PlaceHolder As PlaceHolder) Dim textbox As New TextBox textbox.ID = "testing" PlaceHolder.Controls.Add(textbox) Dim val As New RequiredFieldValidator val.ControlToValidate = textbox.ID val.Text = "required" val.EnableClientScript = True PlaceHolder.Controls.Add(val) End Sub End Class </code></pre> <p>Does anyone have any ideas on how to get this to work in Chrome and Safari?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload