What is the use of Bind method in Asp.net (Gridview) ?

Posted by Rajeshk under ASP.NET on 1/25/2013 | Points: 10 | Views : 961 | Status : [Member] | Replies : 1
hi all,

when we developing websites there we need to bind the data(table) in displaying gridview but we wont use it in windows forms what is the reason behind it?



Posted by: Durgammahesh22 on: 1/30/2013 [Member] Starter | Points: 25


Check this info might help you

Why is there a need to explicitly call GridView.DataBind() in Web apps why this is not needed in Windows

The simple reason is, Web Apps (sites) are stateless.

That is why we have caching / session / cookies variables in web apps. If you could maintain state you wouldn't need to handle caching / sessioning out values that you may need across your entire site. You also wouldn't have to do checks for postbacks.

In Windows Forms your collection can be kept in memory, but in ASP.NET that is not the case. The collection has to be rebuilt from post back to post back.

It doesn't seem to make sense until you start working on web based applications on a daily basis for at least a few weeks. If you are a client win form developer you will notice this at first but you will learn how web apps work the more you work on them.



Rajeshk, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response