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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T21:26:39+00:00 2026-05-15T21:26:39+00:00

JavaScript is used where one want to do something on the client side purely,

  • 0

JavaScript is used where one want to do something on the client side purely, or wants to send something to the server in a manner that postback does not handle.

But in Visual Studio 2008 controls ASP.NET C# I have seen that when the page is displayed in the browser the controls, namely GridView, FormView, and LINKBUTTON (!) all show this javascript:thing when the cursor is hovered on them. Why?

Post back still occurs. Even the linkbutton has this JavaScript thing and whenever you click on it, full post back occurs.

Changing label.text, etc. too is on the pageload event!

  • so why the JavaScript? Why not a simple button? Why linkbutton?
  • 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-15T21:26:40+00:00Added an answer on May 15, 2026 at 9:26 pm

    ASP.NET is stateless. That is, every time a page is requested, the server actually constructs the entire page and its controls & state and then responds to the request. It then renders the appropriate HTML markup as response to the request.

    For any control, if there is the autopostback property set to true then a page is postback to the server if the control causes a postback (like clicking on a link button).

    How does ASP.NET post back the page ?
    It does it using a javascript function called _doPostBack(). The function is –

    function __doPostBack(eventTarget, eventArgument) {
     if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
      theForm.__EVENTTARGET.value = eventTarget;
      theForm.__EVENTARGUMENT.value = eventArgument;
      theForm.submit();
     }
    

    This function is used to submit the form back to the server. _doPostBack accepts arguments – event target and event arguments by using hidden variables __EVENTTARGET and __EVENTARGUMENT. This tells the server which control caused the postback and also passes appropriate arguments to the server.

    if you have this code in your aspx page –

    <asp:LinkButton ID="lnkButton" runat="server">LinkButton</asp:LinkButton>
    

    The corresponding generated markup will be –

    <a id="LinkButton1" href="javascript:__doPostBack('lnkButton','')">LinkButton</a>
    

    So, say you click on a link button, the page is postback by the __doPostBack() function. Then, the page is recreated at server with the respective control state on the page. To get the state of each control on the page mechanisms like viewstate are used. Once the page is loaded, the server computes and renders the response markup.

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

Sidebar

Ask A Question

Stats

  • Questions 499k
  • Answers 499k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer You haven't formed your query properly... update db1.dbo.table1 set db1.dbo.table1.col… May 16, 2026 at 12:31 pm
  • Editorial Team
    Editorial Team added an answer You are returning a pointer to a stack memory location.… May 16, 2026 at 12:31 pm
  • Editorial Team
    Editorial Team added an answer You can do something like that, yes: public event EventHandler… May 16, 2026 at 12:31 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

Does javascript regular expressions support backreferences inside character class? I want to do something
If you have a fair number of regular expressions used by both client (javascript)
I have already used wininet to send some synchronous HTTP requests. Now, I want
I have some javascript code that is used in a few different pages in
I am new to DashCode, upto now I used to design websites with JavaScript,
I have done this using javascript for the edit bug page, where I used
Just finished reading Crockford's JavaScript: The Good Parts and I have a question concerning
intro Hello, I'm trying to develop some plugin or / and object in javascript,
I'm building a set of SVG files that include an unfortunate number of hardcoded
I have an ASP.NET page that contains two div's. Both have search fields and

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.