Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Development Tools
 ASP.NET
 DataGrid control and performance question

Author  Topic 

rtutus
Aged Yak Warrior

522 Posts

Posted - 2006-06-25 : 16:48:54
I am preparing for .Net certif., I had a doubt about the answer to this question:
What is the correct answer pls:

You are creating an ASP.NET page for TestKing. You create a DataGrid control that displays past purchases made by the user. The DataGrid control is populated from an existing database when the page is created.
The page contains TextBox controls that allow users to update their personal information, such as address and telephone number.
You need to ensure that the page is refreshed as quickly as possible when users update their contact information.
What should you do?
A. Set the Enable property of the DataGrid control to false.
B. Set the EnableViewState property of the DataGrid to false.
C. Write code in the Page.Load event handler that populates the DataGrid control only when the
IsPostBack property of the page is false.
D. Write in the Page.Load event handler that populates the DataGrid control only when the IsPostBack property of the page is true.

They said the right answer is: D and I had a doubt about that

Thanks

saglamtimur
Yak Posting Veteran

91 Posts

Posted - 2006-06-25 : 19:42:14
"What should you do?"

I should do lots of things. First of all I should seperate update and datagrid pages. "DataGrid control that displays past purchases " . So best way is to cache this data and set the EnableViewState property of the DataGrid to false. And etc etc. These are not answers for the question. So according to question, to me it seems to be C, but if EnableViewState = true for datagrid (which is by default true).

Go to Top of Page

JBelthoff
Posting Yak Master

173 Posts

Posted - 2006-06-26 : 10:56:03
"You need to ensure that the page is refreshed as quickly as possible when users update their contact information.
What should you do?"


Answer: Only refresh, or repopulate, the page after an update. So D is the best choice from this list.

However, the question is a little limited in that it assumes that a postback is an update which is not always true...

Consider a store checkout for example. It verifies all of the information several times across several postbacks before it submits the order to the payment gateway. These all have the IsPostBack property being true. You certainly don't want to "update" or submit to the gateway before you have validated all of the info or you would be charging the card each time IsPostBack is true.

Unfortunately, the question as posted does not give enough information to make an informed decision and as such it is not a very good question for such a test.

It is like saying: How fast is a bike that has 2 tires?

Answer: That all depends on a lot of things that are unknown from the question....




JBelthoff
• Hosts Station is a Professional Asp Hosting Provider
• Position SEO can provide your company with SEO Services at an affordable price
› As far as myself... I do this for fun!
Go to Top of Page

rtutus
Aged Yak Warrior

522 Posts

Posted - 2006-06-27 : 09:04:31
I think setting the EnableViewState property of the DataGrid to true will add more information into the page and ll make us lose too much bandwith, therefore the page won't refresh quicker. Right?
Since the page is gonna be refreshed anyway, why d we set EnableViewState property of the DataGrid to true. The information of Datagrid will be overridden by the info from the DB after the postback anyway (since the question says that they want the page refreshed and not persisted)
That s just what I thought being a good answer: put EnableViewstate= False
What do u think
Thanks
Go to Top of Page
   

- Advertisement -