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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T21:34:52+00:00 2026-06-16T21:34:52+00:00

I am new to creating ASP.Net pages. I have a basic asp.net page with

  • 0

I am new to creating ASP.Net pages. I have a basic asp.net page with a GridView object, and I have written a RowDataBound Event to change the row colors based on a condition. I need some help on how to link my function/event to the acutal GridView object. Should the function/event be placed on the client side or server-side?

ps. Im using Visual Studio 2010, if there is a way to add functions to an object using the toolbar options that would be awesome.

  • 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-16T21:34:53+00:00Added an answer on June 16, 2026 at 9:34 pm

    RowDataBound event is handled on the server side. You can either have the event code/logic in the “code-behind” file, or you can add an inline script in your HTML file.

    <%@ Page Language="C#" %>  
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">  
    
    <script runat="server">  
        protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) 
        {   
           // logic here
        }  
    </script>  
    
    <html xmlns="http://www.w3.org/1999/xhtml">  
    <head id="Head1" runat="server">  
        <title>GridView RowDataBound Event</title>  
    </head>  
    <body>  
        <form id="form1" runat="server">  
        <div>  
            <h2 style="color:Navy">GridView OnRowDataBound</h2>  
            <asp:SqlDataSource   
                ID="SqlDataSource1"  
                runat="server"  
                ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>"  
                SelectCommand="SELECT ProductID, ProductName, UnitPrice FROM Products"  
                >  
            </asp:SqlDataSource>  
            <asp:GridView   
                ID="GridView1"  
                runat="server"  
                DataSourceID="SqlDataSource1"  
                ForeColor="AliceBlue"  
                BackColor="DarkSalmon"  
                BorderColor="Salmon"  
                HeaderStyle-BackColor="Crimson"  
                AllowPaging="true"  
                AutoGenerateColumns="true"  
                DataKeyNames="ProductID"  
                OnRowDataBound="GridView1_RowDataBound"  
                >  
            </asp:GridView>          
        </div>  
        </form>  
    </body>  
    

    It is important to note that the OnRowDataBound property must have the same name as your even method. For example OnRowDataBound="GridView1_RowDataBound" has the same name as the event handler signature GridView1_RowDataBound(object sender, GridViewRowEventArgs e).

    For more info, see here.

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

Sidebar

Related Questions

i have an issue with creating an object in ASP.net My Page Load function
I have created a new ActionFilter for an ASP.NET MVC application that I'm creating.
I have an ASP.NET page that is the base to many more derived pages
I am thinking about creating my new asp.net mvc web application compatible with native
I'm creating new Site Definitions using this method: http://weblogs.asp.net/paulballard/archive/2007/04/09/creating-a-custom-sharepoint-2007-portal-site-definition-using-the-portalprovisioningprovider-class.aspx and when they get created,
We're creating a new consumer/public-facing ASP.Net web app. There are two concerns: --Use cookie
I'm working on creating a new base class for an asp.net app in order
I have an ASP.NET page that needs to make calls to multiple web services
We have a very simple ASP.Net page for uploading a file to our webserver.
I have a basic Authentication system on my Asp.net MVC Website [HttpPost] public ActionResult

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.