Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7570805
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T15:30:44+00:00 2026-05-30T15:30:44+00:00

I have following tables in my database: SuggestionsLog Table: ID, Title, Description. Employee Table:

  • 0

I have following tables in my database:

SuggestionsLog Table: ID, Title, Description.

Employee Table: Username, Name

Divisions Table: DivisionCode, DivisionName

I want to show table that consists of SuggestionID, SuggestionTitle, EmployeeName and DivisionName only and when the user clicks on the SuggestionTitle, a pop-up window will be displayed with the description of the suggestion.

Since I am ASP.NET beginner developer, I tried to follow this tutorial to get it but I failed.

What I did is the following:

ASP.NET Code:

<asp:UpdatePanel ID="UpdatePanel1" runat="server">
    <ContentTemplate>
        <asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
            AllowSorting="True" AutoGenerateColumns="False" DataKeyNames="ID" 
            DataSourceID="SqlDataSource1" OnRowDataBound="GridView1_RowDataBound">
            <Columns>
                <asp:BoundField DataField="ID" HeaderText="ID" InsertVisible="False" 
                    ReadOnly="True" SortExpression="ID" />
                <asp:TemplateField HeaderText="Title">
                    <ItemTemplate>
                        <asp:LinkButton runat="server" ID="lnkSuggestionTitle"
                                        Text='<%#Eval("Title") %>' 
                                        OnClick="lnkSuggestionTitle_Click">
                                        </asp:LinkButton>
                    </ItemTemplate>
                </asp:TemplateField>
                <%--<asp:BoundField DataField="Title" HeaderText="Title" SortExpression="Title" />--%>
                <asp:BoundField DataField="Description" HeaderText="Description" 
                    SortExpression="Description" />
                <asp:BoundField DataField="Name" HeaderText="Name" SortExpression="Name" />
                <asp:BoundField DataField="Username" HeaderText="Username" 
                    SortExpression="Username" />
                <asp:BoundField DataField="DivisionName" HeaderText="Division" 
                    SortExpression="DivisionName" />
            </Columns>
        </asp:GridView>

        <asp:Button runat="server" ID="btnModalPopUp" style="display:none" />

        <AjaxToolkit:ModalPopupExtender ID="modalPopUpExtender1" 
                                        runat="server" TargetControlID="btnModalPopUp" PopupControlID="pnlPopUp" BackgroundCssClass="modalBackground" 
                                        OkControlID="btnOk" X="20" Y="100">
        </AjaxToolkit:ModalPopupExtender>

        <asp:Panel runat="server" ID="pnlPopUp" CssClass="confirm-dialog">
            <asp:GridView ID="GridView2" runat="server">
            </asp:GridView>
        </asp:Panel>

        </ContentTemplate>
        </asp:UpdatePanel>
        <br /> 

        <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
            ConnectionString="<%$ ConnectionStrings:testConnectionString %>" 
            SelectCommand="SELECT     dbo.SafetySuggestionsLog.ID, dbo.SafetySuggestionsLog.Title, dbo.SafetySuggestionsLog.Description, dbo.employee.Name, dbo.SafetySuggestionsLog.Username, 
                      dbo.Divisions.DivisionName
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">
        </asp:SqlDataSource>

Code-Behind:

protected void lnkSuggestionTitle_Click(object sender, EventArgs e)
    {
        LinkButton lnkSuggestionTitle = sender as LinkButton;
        string strSuggestionTitle = lnkSuggestionTitle.Text;

        string strConnectionString = ConfigurationManager.ConnectionStrings["testConnectionString"].ConnectionString;
        string strSelect = "SELECT ID, Title, Description FROM  dbo.SafetySuggestionsLog";
        SqlConnection sqlCon = new SqlConnection();
        sqlCon.ConnectionString = strConnectionString;
        SqlCommand cmdSuggestionDetails = new SqlCommand();
        cmdSuggestionDetails.Connection = sqlCon;
        cmdSuggestionDetails.CommandType = System.Data.CommandType.Text;
        cmdSuggestionDetails.CommandText = strSelect;
        cmdSuggestionDetails.Parameters.AddWithValue("@Title", strSuggestionTitle);
        sqlCon.Open();

        SqlDataReader dReader = cmdSuggestionDetails.ExecuteReader();
        GridView1.DataSource = dReader;
        GridView1.DataBind();
        sqlCon.Close();
        modalPopUpExtender1.Show();
    }

Everything is going well and smooth, but in the website, when I clicked on one of the titles, I did not get the ModalPopUp. Also, I got an error notification at the left bottom corner in the Internet Explorer browser, which when I opened it, it gave me the following description:

**

Sys.ArgumentNullException: Value cannot be null. Parameter name:
elements

**

I don’t know why this is happened. Any help please?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T15:30:45+00:00Added an answer on May 30, 2026 at 3:30 pm

    This issue is usually a bad OkControlID or CancelControlID (via here), which could be “btnOk” in this case.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following tables in my database: Employee Table which consists of Name,
I have the following tables: users userId|name items itemId|userId|description What I want to achieve:
I have the following (simplified) database tables: Products - ProductID, int, PK - Name,
I have the following table in a database. I want to be able to
I have the following table in my database. Now what I want to find
I have the following tables in my database: Announcements: - AnnouncementID (PK) - Title
I have the following tables in my SQL Database: authors: name varchar id int
I have the following database tables: Table1: User UserId Username Table2: Role RoleId Rolename
I have the following tables in the database. users ----------------- | id | username
I have the following tables in the database. users ----------------- | id | username

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.