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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T08:47:16+00:00 2026-05-13T08:47:16+00:00

In my previous web development experience I have used LAMP setups. I am trying

  • 0

In my previous web development experience I have used LAMP setups. I am trying to learn the Microsoft way as I develop a project using the following tools:

  • ASP.NET 3.5
  • C#
  • MS Visual Studio 2008

Here is my question: How can I tell when code gets executed on the server versus code that is exectued as javascript?

I have added AJAX functionality to my aspx file using tutorials I found online. I have something like:

ASP:

<asp:ScriptManager />
<asp:UpdatePanel>
    <ContentTemplate>
        <input id="inputItem" type="text" runat="server" />
        <asp:Button id="submitButton" runat="server"
                    OnClick="submitButton_clicked"/>
    </ContentTemplate>
</asp:UpdatePanel>

C#:

protected void submitButton_clicked (object sender, EventArgs e)
{
    // Do dynamic stuff on page.
}

I have been able to successfully update elements on the page without requiring a refresh. It is my understanding that the C# function submitButton_clicked() is automatically converted to javascript by Visual Studio when the web application is built (as well as any functions called by it).

I need to be able to submit the user-supplied data in this form to the server so that I can add it to a database. What I do not understand is how to differentiate between code that is automatically converted to javascript and code that is not. I want to be able to call functions from submitButton_clicked() which use LINQ to perform database operations, and have that code executed server-side.

I have been trying to find some online tutorials which explain this distinction cleary but have had no luck so far. Any help is appreciated.

  • 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-13T08:47:16+00:00Added an answer on May 13, 2026 at 8:47 am

    Your code in the submitButton_clicked function is not converted to javascript, it executes on the server side. The use of the UpdatePanel allows your page to refresh the content of the UpdatePanel via javascript (AJAX) calls to the server, so that the user doesn’t experience a full page reload. The server-side code all still runs.

    You should insert some breakpoints in your code (the Page_Load, your submitButton_clicked, other places), and watch what happens when the UpdatePanel refreshes. The page will go through its entire life-cycle on the server-side, and the new state will be passed via AJAX to the controls in the UpdatePanel.

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

Sidebar

Related Questions

On my previous machine I had IIS6 installed and created a web project using
I am writing a simple database with web access. I have previous experience with
Since CS3 doesn't have a web service component, as previous versions had, is there
I'm using Eclipse to develop a java web app and My IT department called
I have been learning to develop websites using ASP.NET MVC 2 for work... and
As an addition to my previous post on Creating a web server in pure
I am managing the development of currently two different web applications of which one
We have a web service that we will be hosting on a public web
I'm moving back into full time web development after a 5 year hiatus. My
I'm going to start a new project that's building web apps from scratch. I

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.