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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T04:28:33+00:00 2026-06-10T04:28:33+00:00

I use GridView & Repeater (and other like DropDownList ) controls extensively in my

  • 0

I use GridView & Repeater (and other like DropDownList) controls extensively in my application along with ObjectDataSource components and classes that serve data for ObjectDataSource (TypeName / SelectMethod attributes on ObjectDataSource). I recently noticed that SelectMethod is only called when

IsPostBack == false

Also, when I bind manually, I always bind when !IsPostBack. I never was curious how controls maintain their data between postbacks, until now (I have to create GridView with sorting/pagination etc and I want to do it efficently).

Could you explain / provide some links with descriptions how it’s done?

Also I don’t get one thing: when working with GridView and I iterate over rows, sometimes I need to access its GridViewRow.DataItem property in order to get backing object (usually to get some kind of ID). And sometimes it’s null – sometimes not. I couldn’t figure out why. However then it’s null, I still can access (for instance) GridViewRow.DataKeys.

Thanks

EDIT: know when answers say that it thanks to ViewState, I have another question: If I data bind 100 business objects which are pretty heavy and I only use a few properties while data binding (let’s say I also use OnRowDataBound event to render some additional data), does it mean that whole objects are serialized?

  • 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-10T04:28:34+00:00Added an answer on June 10, 2026 at 4:28 am

    They store it in a hidden field on the page called ViewState (or more precisely “__VIEWSTATE”). If you do a View Source on your ASPX page, you’ll see it.

    You too can store and retrieve state information for your page in the ViewState by accessing the ViewState property of your Page.

    I’d start here http://msdn.microsoft.com/en-us/library/ms972976.aspx

    So, yes, if you store a large number of large objects, there is a large amount of data being transferred to and fro to the client in the page cycle. Used carefully, Viewstate can be useful, but used carelessly, it can have negative effects.

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

Sidebar

Related Questions

I need to use a SQL statement that is bound to a Gridview &
Im populating a GridView from List so am forced to use TemplateField controls to
I am trying to use some C# code that expands on the GridView functionality
how to use gridview control in my silverlight xaml page in asp.net & c#.net?
I have a fairly big asp.net website that use GridView bound to the same
I would like to use a grid view that can expand its rows, also
I was using Google's Hello GridView Tutorial to learn how use GridView . It
I use DevExpress v10.2.3 grouping gridview with asp.net mvc 4. I can get datas
For a Gridview: I am trying to use a stored procedure for the first
I want to use CSS to format my GridView rows. I've set up my

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.