Note that there are some explanatory texts on larger screens.

plurals
  1. POSub routine for OnClick procedure in GridView is not executing
    text
    copied!<p>We have a GridView with a 2 buttons. One of the buttons is a select button and the other is a one without a command. It is supposed to activate an OnClick sub routine. The sub routine is not executing.</p> <p>Here is the markup of the GridView with the buttons:</p> <pre><code> &lt;asp:GridView ID="GridViewParentsSummary" runat="server" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" DataKeyNames="ID" &gt; &lt;Columns&gt; &lt;asp:BoundField DataField="ID" HeaderText="ID" SortExpression="ID" InsertVisible="False" ReadOnly="True" Visible="False" /&gt; &lt;asp:BoundField DataField="FatherName" HeaderText="FatherName" SortExpression="FatherName" /&gt; &lt;asp:BoundField DataField="MotherName" HeaderText="MotherName" SortExpression="MotherName" /&gt; &lt;asp:ButtonField ButtonType="Button" CommandName="Select" Text="Select Details" /&gt; &lt;asp:TemplateField ShowHeader="False"&gt; &lt;ItemTemplate&gt; &lt;asp:Button ID="ButtonNewPersonToReleaseChildren" runat="server" CausesValidation="false" Text="New Person To Release Children" CommandArgument='&lt;%# Eval("ID") %&gt;' OnClick="NewPersonToReleaseChildren" /&gt; &lt;/ItemTemplate&gt; &lt;/asp:TemplateField&gt; &lt;/Columns&gt; &lt;/asp:GridView&gt; </code></pre> <p>Here is the VB.Net code-behind coding with the sub routines for the buttons:</p> <pre><code>Protected Sub GridViewParentsSummary_SelectedIndexChanged(sender As Object, e As EventArgs) Handles GridViewParentsSummary.SelectedIndexChanged IntParentsID = GridViewParentsSummary.DataKeys(GridViewParentsSummary.SelectedIndex).Value Response.Redirect("AuthorizationForChildReleaseDetails.aspx") End Sub Protected Sub NewPersonToReleaseChildren(sender As Object, e As EventArgs) blnAddModeIsSelected = True MsgBox("The button was clicked.") Response.Redirect("AuthorizationForChildReleaseDetails.aspx") End Sub </code></pre> <p>I'm sure I am missing some coding but don't know what that could be because the sub routine for the Select button works, but not the sub routine for NewPersonToReleaseChildren.</p>
 

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