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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T04:29:57+00:00 2026-06-04T04:29:57+00:00

I have used jQuery in my website. I have a navigation bar in my

  • 0

I have used jQuery in my website. I have a navigation bar in my header. When user clicks any link given in my menu bar. It calls my javascript function..and a dialog box appears having a form. For example I have a form say “Add Country”. When user clicks the link “Add country”

A form appears in a dialog box. And then user will be able to add country in the given form.

Now i have a gridview in my page..where im managing my data. My country table has 3 coloumns. Coutry Code, Country Name, Description. I have bound country table as sql datasource with that gridview. I have added a asp button as a template item in that gridview as well. All i want to do is..When user clicks the edit button of the particular row in my grid view..i would get the countryID of that row. And i want to call that country FORM again..where user will be able to edit. How can i call my java script function in c# code so that i would be able to call that form again ? I m relatively a new programmer. Anmy detailed guidance will be highly appreciated.

Lets suppose i have :

protected void EditSeriesButton(object sender, EventArgs e)
{    
    Button btn = (Button)sender;
    GridViewRow row = (GridViewRow)btn.NamingContainer;
    int countryID =Convert.ToInt32(CountryGridView.DataKeys[row.RowIndex].Value);

    //Here i have got the id of that row. Now i want to call the function of my
    //javascript so that i can call my country form.
    //Just please guide me how to call javascript function here to open my 
    // dialog box.
    //i will do rest of the things.
}

Please help me as soon as possible!!

Regards,

  • 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-04T04:29:57+00:00Added an answer on June 4, 2026 at 4:29 am

    You can use gridview’s rowdatabound event to add a onclick attribute to that button to call the javascript function:

    protected void CountryGridView_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            int countryID = Convert.ToInt32(CountryGridView.DataKeys[e.Row.RowIndex].Value);
            Button btnButton = (Button)e.Row.FindControl("btnName");
            btnButton.OnClientClick = "return Dosomething('"+countryID+"');";
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have made the following javascript to be used in my jQuery based website.
I am working on some website , i have used jQuery UI , for
I have used autocomplete in jQuery from this link . In the normal browser
I am using a table navigation menu in my website in that i have
I have created a website loading progress bar using Jquery UI Progress bar. This
I am developing a website in asp.net, I have used jquery image slider and
I am working on a website: http://homegym.sg/index.php/ Have used jquery to create an effect
I have a php website, in which I have used a lot of jquery
I have an personal profile website at http://www.kaidul.web44.net/ and I have used jquery, flash
I have used some jquery components in my web site, Suddenly i'm getting an

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.