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 4036618
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T12:14:44+00:00 2026-05-20T12:14:44+00:00

Basically when a user clicks a button I have a javascript code that runs

  • 0

Basically when a user clicks a button I have a javascript code that runs that displays the hidden DIV, my question is how do I make it so when the users click it executes the SQL code (which is already written to select the data) and then it displays it in the DIV that I want. Would the only way to do this be add a label to the DIV and then use LabelName.Text to populate it or can this be accomplished some other way? I am using Visual Studio 2008 and coding in c#

  • 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-20T12:14:44+00:00Added an answer on May 20, 2026 at 12:14 pm

    First you have to decide if you want to populate the content using JavaScript (and AJAX) or via postback to the server using ASP.NET’s code behind design.

    Postback is easier (but not quite as good a user experience depending on connection speed.) To do this you need to make an event handler for the buttons click event and then change the contents of the page in C#. There are many examples of this and any book on ASP.NET will describe it. Search for “Changing page contents via button click C#”, or something similar.
    (edit: or look at @Nikhil’s answer — he gives a good skeleton of how to do it.)

    AJAX is harder. Here you will need to define a API web service to return the data you want and then code in JavaScript to call the service and render the results. There are many JavaScript libraries that can make this easier — jQuery is very accessible and will even has working examples of this very functionality on their documentation page.

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

Sidebar

Related Questions

Basically I have a single page site that scrolls when the user clicks on
I have a problem with web.py. Basically the user clicks a button, which makes
Basically I have a refresh button, when the user clicks the refresh button it
I have an ASP.NET page that is basically a search form. My code for
I have Java application which adds JTextFields @ runtime to JPanel. Basically user clicks
Basically, I have a page that contains a form. When a user submits that
Basically I have a script that checks database every 10 seconds and notifys user
I have ASCX control, that basically contains just a DIV with few ASP buttons
i have this template code: <script type=text/javascript> $(function(){ //submit new messages when the user
Basically I have a tabbed Panel I'm creating. When the user click on a

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.