Note that there are some explanatory texts on larger screens.

plurals
  1. PORegularExpressionValidator won't let me get to the next page
    primarykey
    data
    text
    <p>I have two datalists. One works like a menu where you click on a link to fill the othe datalist. I also have added a next and previous linkbutton to move between the different "pages" so that you do not have to change using the menu datalist.</p> <p>Now in code behind depending on which values I get from the database I add a RegularExpressionValidator.</p> <p>This works great until I want to use the next button (or previous for that matter). Even if all the controls that are checked are valid when compared with the RegularExpressionValidator I never get to load the new values. The next and previous buttons fires the datalist selected index change event and then I check if it is the previous or next button that was clicked.</p> <p>But the previous and next buttons are numb. They don't even fire the event. It is like clicking on the background. Nothing happens. </p> <p>I have chcked the PageIs.Valid and it is true.</p> <p>Does anyone have a clue what it could be that is causing this behavior?</p> <p>Thanks in advance!</p> <p>Some of the texts down there is in Swedish but it shouldn't matter for the code.</p> <pre><code>rev_checkfieldvalue.ControlToValidate = "tb_detailValue"; switch (iDataTypeId) { case 2: rev_checkfieldvalue.ValidationExpression = @"^\d*[0-9 ]+$"; rev_checkfieldvalue.Text = "Fältet får endast innehålla siffror och mellanslag."; break; case 3: break; case 4: break; case 5: rev_checkfieldvalue.ValidationExpression = @"\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"; rev_checkfieldvalue.Text = "Fältet får endast innehålla en e-postadress."; break; } e.Item.Controls.AddAt(32, rev_checkfieldvalue); &lt;asp:DataList ID="dl_componentInfo" DataKeyField="ComponentId" runat="server" OnItemDataBound="dl_componentInfo_OnItemDataBound" OnItemCommand="dl_componentInfo_OnItemCommand"&gt; &lt;ItemTemplate&gt; &lt;table&gt; &lt;tr&gt; &lt;td colspan="2"&gt;&lt;asp:Label ID="lb_componentName" SkinID="lblHeader" runat="server" Text='&lt;%# Eval("ComponentName") %&gt;' /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td colspan="2"&gt;Fält markerade med * är obligatoriska&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&amp;nbsp;&lt;/td&gt; &lt;td&gt; &lt;asp:DataList ID="dl_details" OnItemDataBound="dl_details_OnItemDataBound" runat="server"&gt; &lt;ItemTemplate&gt; &lt;table&gt; &lt;tr&gt; &lt;td colspan="2"&gt; &lt;asp:Label ID="lbl_detailName" Text='&lt;%# Eval("DetailName") %&gt;' runat="server"&gt;&lt;/asp:Label&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt; &lt;asp:Label ID="lbl_custDetName" runat="server" /&gt; &lt;/td&gt; &lt;td align="left"&gt; &lt;%--Always hidden values--%&gt; &lt;asp:Label ID="lbl_detailTypeId" Visible="false" Text='&lt;%# Eval("DetailTypeId") %&gt;' runat="server" /&gt; &lt;asp:Label ID="lbl_detailId" Visible="false" Text='&lt;%# Eval("DetailId") %&gt;' runat="server" /&gt; &lt;asp:Label ID="lbl_dataTypeId" Visible="false" Text='&lt;%# Eval("DataTypeId") %&gt;' runat="server" /&gt; &lt;asp:Label ID="lbl_customerEventValueId" Visible="false" Text='&lt;%# Eval("CustomerEventValueId") %&gt;' runat="server" /&gt; &lt;asp:Label ID="lbl_reqFld" Visible="false" Text='&lt;%# Eval("ReqFld") %&gt;' runat="server" /&gt; &lt;%--Sometimes visible values--%&gt; &lt;asp:Label ID="lbt_detailValue" Visible="false" Text='&lt;%# Eval("PresetDetailValue") %&gt;' runat="server" /&gt; &lt;asp:Label ID="lbtb_detailValue" Visible="false" Text='&lt;%# Eval("PresetDetailValue") %&gt;' runat="server" /&gt; &lt;asp:Label ID="lbth_detailValue" Visible="false" Text='&lt;%# Eval("PresetDetailValue") %&gt;' runat="server" /&gt; &lt;asp:Label ID="lbc_detailValue" Visible="false" Text='&lt;%# Eval("PresetDetailValue") %&gt;' runat="server" /&gt; &lt;asp:DropDownList ID="dd_detailValue" Visible="false" runat="server"&gt;&lt;/asp:DropDownList&gt; &lt;%--Om det ska gå att markera/avmarkera alla så använd AJAX--%&gt; &lt;asp:CheckBoxList ID="cbl_detailValue" RepeatDirection="Horizontal" RepeatLayout="flow" Visible="false" runat="server" /&gt; &lt;asp:CheckBox ID="cb_detailValue" Visible="false" Text='&lt;%# Eval("PresetDetailValue") %&gt;' runat="server" /&gt; &lt;asp:TextBox ID="tb_detailValue" Visible="false" Text='&lt;%# Eval("PresetDetailValue") %&gt;' runat="server" /&gt; &lt;asp:TextBox ID="ta_detailValue" Visible="false" Text='&lt;%# Eval("PresetDetailValue") %&gt;' runat="server"&gt;&lt;/asp:TextBox&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;/ItemTemplate&gt; &lt;/asp:DataList&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;/ItemTemplate&gt; &lt;FooterTemplate&gt; &lt;table width="600"&gt; &lt;tr&gt; &lt;td&gt; &lt;asp:LinkButton id="lb_previous" Text="Föregående" CommandName="Previous" runat="server"/&gt; &lt;/td&gt; &lt;td&gt; &lt;asp:LinkButton id="lb_next" Text="Nästa" CommandName="Next" runat="server"/&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;/FooterTemplate&gt; &lt;/asp:DataList&gt; </code></pre>
    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.
    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