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

  • SEARCH
  • Home
  • 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 8899463
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T00:51:47+00:00 2026-06-15T00:51:47+00:00

I have a jQuery dialog that pops up when a button is pressed. There

  • 0

I have a jQuery dialog that pops up when a button is pressed. There I have a GridView which contains results from my database. I want to make the GridView to display the results that I have searched for. Therefore, I added a asp:textbox and a asp:button, the idea is that when I press the button, it will call the function that connects with my database and then display the results in the GridView. So basically, when the jQuery pops it should display an empty GridView(or none) and then when I search for something it should display the result.
Here is my main.aspx code:

 <div id="ViewPlaces">
                <asp:TextBox ID="viewPlaceTextbox"  runat="server" placeholder="Search..." />
                <asp:Button ID="viewPlaceBtn" OnClick="getSearchedPlace" runat="server" Text="Search for place" />
                        <asp:GridView ID="GridView1" AllowPaging="true" GridLines="None" CssClass="mGrid" PagerStyle-CssClass="pgr" AlternatingRowStyle="alt" runat="server" AllowSorting="True"
                            AutoGenerateColumns="False"
                            Width="750px"
                            CausesValidation="False" ShowHeaderWhenEmpty="true" ShowHeader="true">
                           <Columns>
                                <asp:BoundField DataField="place_id" HeaderText="Id" ReadOnly="True" />
                                <asp:BoundField DataField="place_name" HeaderText="Name" />
                                <asp:BoundField DataField="place_city" HeaderText="City" />
                                <asp:BoundField DataField="place_land" HeaderText="Land" />
                                <asp:BoundField DataField="place_desc" HeaderText="Description" />                        
                            </Columns>
                        </asp:GridView>
            </div>

Here is the jQuery code:

$('#ViewPlaces').dialog(dialogOpts5);
        $.fx.speeds._default = 500;
        $(function () {
            $("#ViewPlaces").dialog({
                autoOpen: false,
                show: "blind",
                hide: "explode",
            });

            $("#viewallplaces").click(function () {
                $("#ViewPlaces").dialog("open");
                return false;
            });
        });

In my c# code the problem is that if I don’t call the function for getting the results from the database in the Page_Load, then the GridView is not loaded when I press the button for opening the jQuery dialog. Otherwise, the function looks like this:

 protected void getPlaces()
{
    List<Place> pl = new List<Place>();
    pl = functions.getPlaces();
    GridView1.DataSource = pl;
    GridView1.DataBind();
}

And the getPlaces() function returns a list of the places. That is not a problem, it works and I have tested it.

  • 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-06-15T00:51:48+00:00Added an answer on June 15, 2026 at 12:51 am

    in this scenario you will either use the webforms controls like gridview and updatepanel and forego jquery, or you will use basic HTML elements and wire up jquery to call an endpoint (url) and render the result client side. But not both.

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

Sidebar

Related Questions

I have a simple Jquery dialog box, that dialog contains a button which sends
I have a jquery-ui-dialog that contains a <form> which contains a <input type=file >
I have a small form that contains a jQuery UI dialog to ask for
I have the following Jquery that returns values from a dialog Box and fills
I have some JQuery that pops up a JQuery Dialog ( http://docs.jquery.com/UI/Dialog ) box
I have a jQuery UI dialog that opens when the user clicks a button,
In my Rails 3.1 application I have a Jquery dialog that pops up when
I have a confirmation dialog in jquery that pops up and show some confirmation
I have a jQuery dialog that holds multiple tabs, each tab contains a form,
I have a view with a button that opens a jquery dialog via partial

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.