Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Re-load an ASP.Net page

Posted on 2007-03-27
1
Medium Priority
?
171 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 2000 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

Extention Methods in C# 3.0 by Ivo Stoykov C# 3.0 offers extension methods. They allow extending existing classes without changing the class's source code or relying on inheritance. These are static methods invoked as instance method. This…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…

730 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