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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T18:53:09+00:00 2026-06-05T18:53:09+00:00

How to add JavaScript on ASP.NET Dropdownlist, pass that Dropdownlist Id to that same

  • 0

How to add JavaScript on ASP.NET Dropdownlist, pass that Dropdownlist Id to that same JavaScript function which is called? How to do the same for Dropdownlist which is a template field of Gridview?

  • 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-05T18:53:11+00:00Added an answer on June 5, 2026 at 6:53 pm

    You can add onchange event in dropdown if you do not need anything from database/server end

    <ItemTemplate> <asp:DropDownList ID="DropDownList1" runat="server" onchange="BindEng(this);" Height="16px" Width="179px"> <ItemTemplate>
    

    Add RowDataBound event to gridview and access dropdown for each row and assign javascript to it, here you can access data of datasource if required for javascript function.

    protected void GrdViewUsers_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        if(e.Row.RowType == DataControlRowType.DataRow)
        {
            DropDownList ddl = e.Row.FindControl("YourDropDownListID") as DropDownList;
            //The statment below will pass the client id of drop down to function in javascript
            ddl.Attributes.Add("onchange", "YourjavascriptMethodCall('" + ddl.ClientID + "'");
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a gridview in ASP.net 2.0 that has a small peace of javascript
how to add multiple fckeditor field on asp.net mvc page ok here is the
I want to add javascript to asp.net page dynamically. can anybody point me towards
You are implementing an ASP.NET application that uses data-bound GridView controls in multiple pages.
How would I add a javascript MessageBox in ASP.NET in the code behind pages
I have a website on which I dynamically create Javascript code using ASP.NET handler
I want to call a javascript function from my ASP.NET (C#) code, I want
I have the javascript code below which disables an asp.net button during page postback.
I have the need to add a javascript include to my ASP.NET page. The
I want to add javascript into my template to detect that every time users

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.