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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T05:35:13+00:00 2026-06-04T05:35:13+00:00

Can I call a JS function on the SelectedIndexChanged event of a GridView? I

  • 0

Can I call a JS function on the SelectedIndexChanged event of a GridView?
I referred these 2 SO posts –
Post 1 and
Post 2 that address this but they aren’t helping.

I tried

OnSelectedIndexChanged="selectedindexchanged()"

however, in return I recieved –

'ASP.default_aspx' does not contain a definition for 'selectedindexchanged' and no 
extension method 'selectedindexchanged' accepting a first argument of type  
'ASP.default_aspx' could be found (are you missing a using directive or an 
assembly reference?)

Can anyone confirm whether this can be done and if it can the right way to do 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-04T05:35:14+00:00Added an answer on June 4, 2026 at 5:35 am

    OnSelectedIndexChanged is a server event, not a javascript event.

    the Server Control GridView does not allow, out-of-the-box javascript methods to be hooked on.

    You need to extend it and create such methods, or use other Grid Control available as a 3rd party.


    What you can do, so you don’t mess up to much in the code, is, using jQuery, for example, hook up to all rows and fire an event when something on that row was clicked, holding the return (submission of the form back to the server).

    For that, you need to see what’s the output HTML and start from there.

    This was one of many features that I moved to MVC instead of keep using WebForms, in MVC you have total control in what’s happening in your page, and you can do everything by yourself without ever wondering of such things.

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

Sidebar

Related Questions

Can you call a function that has no body but is declared in the
I cant understand why in the class constructor I can call this function but
As we know that we can call any function of Javascript to control's event
Is there any way that I can call a JavaScript function via css? For
Is it possible to create a stored procedure that can call a function/generate C#
i have a function that i can call to apply a rounded corner fix
Is there any way so that you can call a function with a variable?
How can I bind arguments to a Python function so that I can call
In gdb, I can call one function with command call, but how can I
I want a widget that displays an image and (can) call a function with

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.