Solved

Re-load an ASP.Net page

Posted on 2007-03-27
1
168 Views
Last Modified: 2010-04-16
I have two gridviews on an ASP.Net page. Each grid contains the same data, the difference being that the top grid has the data in Field1 set to 1 for each record, and the data in Field1 on grid 2 set to 0. I have a button on each grid for each record. It changes the value of Field1 to 1 or 0, depending on which grid you are using. All of this works, the problem is that when, for example, I click the button next to a record in grid 1, which changes its value to 0, the record goes away, but does not move to grid2. I have to navigate back to the page to see the change reflected. So I think I need a way for the page to re-load after every click. How can I do this? Also, the app is written in C#, but this particular page has no code-behind, as I just used the drag ad drop features of VS 2005 to build this page. Thanks for any help!
0
Comment
Question by:dodgerfan
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 1

Accepted Solution

by:
Reactor earned 500 total points
ID: 18828166
Hi Dodgerfan,

The answer will be setting EnableViewstate =false for both grids.

The Viewstate is designed to persist attributes of controls between round-trips to the server. If, say, you change the colour of a Label in some code, veiwstate should remember this everytime the page loads so that you do not have to repeat the code in every Page_Load event. This is that big hidden, encrypted field called _VIEWSTATE that you will see at the top of the generated HTML if you right click your page when it is running and select "view source" Setting EnableviewState to false just makes the application exclude your two grids from that functionality.

The downside of using EnableViewState=false is simply that any other changes to the attributes of the grids at run-time (in code) will not be "remembered" and will have to be re-set each time. Not a serious drawback though. I work for a high profile financial institution and we never use viewstate unless it is 100% essential as there are some security concerns about using it as well. Nothing serious but it does give a bit of info to would be attackers that is not necessary to divulge.

I hope this has been of help to you, thanks for the points, I really appreciate it. I get as much out of answering questions as I do asking them. I end up researching and learning a lot myself. I will be keen to see your website when it is complete (not that a South African would know anything about baseball)

Chat soon,

Reactor
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

627 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question