Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to make this Ajax ModalPopUp works with this GridView?
    primarykey
    data
    text
    <p>I have a GridView that shows the suggestions submitted by the users and stored in the database. In the last column, the status will be displayed. I want to make this column to be a clickable and when the Admin clicks on it, a ModalPopUp window (Ajax ModalPopUpExtender) will be viewed with the RadioButtonList that shows the status. I just started with writing the code and I faced many problems. I fixed all of them except one which is the following:</p> <blockquote> <p><em><strong>Unknown server tag 'AjaxToolKit:ModalPopUpExtender'</em></strong></p> </blockquote> <p>I don't know how to fix error. <strong>Could you please help me with it?</strong></p> <p>My ASP.NET code:</p> <pre><code>&lt;%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %&gt; &lt;asp:TabContainer CssClass="tabCont" ID="TabContainer1" runat="server" ActiveTabIndex="0" Height="500px" ScrollBars="Auto" Width="100%"&gt; &lt;asp:TabPanel ID="All_SafetySuggestions_Tab" HeaderText="All" runat="server"&gt; &lt;ContentTemplate&gt; &lt;div&gt; &lt;strong&gt; Division &lt;/strong&gt; &lt;asp:DropDownList ID="ddlDivision" runat="server" AppendDataBoundItems="True" AutoPostBack="True" DataSourceID="sqlDataSourceDivision" DataTextField="DivisionShortcut" DataValueField="DivisionShortcut" Width="175px" EnableViewState="False"&gt; &lt;asp:ListItem Value="%"&gt;All&lt;/asp:ListItem&gt; &lt;/asp:DropDownList&gt; &lt;br /&gt; &lt;br /&gt; &lt;asp:GridView ID="GridView1" runat="server" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" DataKeyNames="ID" width="900px" CssClass="mGrid" DataSourceID="SqlDataSource1" OnRowDataBound="GridView1_RowDataBound"&gt; &lt;AlternatingRowStyle BackColor="White" ForeColor="#284775" CssClass="alt" /&gt; &lt;HeaderStyle Font-Bold = "True" ForeColor="Black" Height="20px"/&gt; &lt;Columns&gt; &lt;asp:BoundField DataField="ID" HeaderText="ID" InsertVisible="False" ReadOnly="True" SortExpression="ID" /&gt; &lt;asp:BoundField DataField="Title" HeaderText="Title" SortExpression="Title" /&gt; &lt;asp:BoundField DataField="Description" HeaderText="Description" SortExpression="Description" /&gt; &lt;asp:BoundField DataField="Name" HeaderText="Name" SortExpression="Name" /&gt; &lt;asp:BoundField DataField="Username" HeaderText="Username" SortExpression="Username" /&gt; &lt;asp:BoundField DataField="DivisionShortcut" HeaderText="DivisionShortcut" SortExpression="DivisionShortcut" /&gt; &lt;asp:BoundField DataField="Type" HeaderText="Type" SortExpression="Type" /&gt; &lt;%-- This to make status be opened and edited through the Ajax ModalPopUp Window --%&gt; &lt;asp:TemplateField HeaderText="Status"&gt; &lt;ItemTemplate&gt; &lt;asp:LinkButton runat="server" ID="lnkSuggestionStatus" Text='&lt;%#Eval("Status")%&gt;' OnClick="lnkSuggestionTitle_Click"&gt; &lt;/asp:LinkButton&gt; &lt;/ItemTemplate&gt; &lt;/asp:TemplateField&gt; &lt;%--&lt;asp:HyperLinkField HeaderText="Status" SortExpression="Status" /&gt;--%&gt; &lt;/Columns&gt; &lt;RowStyle HorizontalAlign="Center" /&gt; &lt;/asp:GridView&gt; &lt;asp:Button runat="server" ID="btnModalPopUp" style="display:none" /&gt; &lt;AjaxToolkit:ModalPopUpExtender ID="modalPopUpExtender1" runat="server" TargetControlID="btnModalPopUp" PopupControlID="pnlPopUp" BackgroundCssClass="popUpStyle" PopupDragHandleControlID="panelDragHandle" OkControlID="OKButton"&gt; &lt;/AjaxToolkit:ModalPopUpExtender&gt; &lt;asp:Panel runat="server" ID="pnlPopUp"&gt; &lt;table id="suggestionStatus"&gt; &lt;tr&gt; &lt;asp:RadioButtonList ID="StatusList" runat="server"&gt; &lt;asp:ListItem&gt;Received&lt;/asp:ListItem&gt; &lt;asp:ListItem&gt;Pending&lt;/asp:ListItem&gt; &lt;asp:ListItem&gt;Actioned&lt;/asp:ListItem&gt; &lt;asp:ListItem&gt;Transferred&lt;/asp:ListItem&gt; &lt;/asp:RadioButtonList&gt; &lt;/tr&gt; &lt;tr&gt; &lt;asp:Button ID="confirmButton" runat="server" Text="Confirm" OnClientClick="javascript:return confirm('Are you sure you want to send an email notification about the safety suggestion to the owner?')" OnClick="btnSendStatus_Click" /&gt; &lt;/tr&gt; &lt;/table&gt; &lt;asp:Button ID="OKButton" runat="server" Text="Close" /&gt; &lt;/asp:Panel&gt; &lt;asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="&lt;%$ ConnectionStrings:testConnectionString %&gt;" SelectCommand="SELECT dbo.SafetySuggestionsLog.ID, dbo.SafetySuggestionsLog.Title, dbo.SafetySuggestionsLog.Description, dbo.employee.Name, dbo.SafetySuggestionsLog.Username, dbo.Divisions.DivisionShortcut, dbo.SafetySuggestionsType.Type, dbo.SafetySuggestionsStatus.Status FROM dbo.employee INNER JOIN dbo.SafetySuggestionsLog ON dbo.employee.Username = dbo.SafetySuggestionsLog.Username INNER JOIN dbo.Divisions ON dbo.employee.DivisionCode = dbo.Divisions.SapCode INNER JOIN dbo.SafetySuggestionsType ON dbo.SafetySuggestionsLog.TypeID = dbo.SafetySuggestionsType.ID INNER JOIN dbo.SafetySuggestionsStatus ON dbo.SafetySuggestionsLog.StatusID = dbo.SafetySuggestionsStatus.ID" FilterExpression="[DivisionShortcut] like '{0}%'"&gt; &lt;FilterParameters&gt; &lt;asp:ControlParameter ControlID="ddlDivision" Name="DivisionShortcut" PropertyName="SelectedValue" Type="String" /&gt; &lt;/FilterParameters&gt; &lt;/asp:SqlDataSource&gt; &lt;asp:SqlDataSource ID="sqlDataSourceDivision" runat="server" ConnectionString="&lt;%$ ConnectionStrings:testConnectionString %&gt;" SelectCommand="SELECT [DivisionShortcut] FROM [Divisions]"&gt;&lt;/asp:SqlDataSource&gt; &lt;/div&gt; &lt;/ContentTemplate&gt; &lt;/asp:TabPanel&gt; </code></pre> <p>My C# code-behind:</p> <pre><code>protected void lnkSuggestionStatus_Click(object sender, EventArgs e) { modalPopUpExtender1.Show(); } </code></pre> <p>Also, regarding the RadioButtonList values that will be shown, in the ModalPopUp window, <strong>How can I bind it to the Database?</strong></p> <p>For your information, the database design is as following:</p> <pre><code>Employee Table: Username, Name SafetySuggestionsLog Table: ID, Title, Description, Username, StatusID SafetySuggestionsStatus Table: ID, Status </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