Free Online Articles Directory
18.11.2008 Sign In Register Hello Guest
Email:
Password:
Remember Me 
forgot your password?


How to Solve a Common Problem With Asp.net Formview Defaultstate Property

Author: Leonardo Paneque Author Ranking Blue | Posted: 29-10-2007 | Comments: 0 | Views: 50 | Rating:  (52) Article Popularity - Blue (?) Got a Question? Ask.
Sign Up Now!

The ASP.NET FormView WebControl is one of the most useful items you can find in the Microsoft Visual Studio .NET Toolbar, now, although is extremely easy to use, you can make mistakes and walk in circles just because you forgot a simple click, especially when using the DefaultState property.

This property defines the “default” state for the webcontrol after an insert/update/delete operation, that is, the state to wich the control will return after any of those operations are perfomed. So, the property DOES NOT CHANGE the current FormView’s state, to do that use the ChangeState method instead. Check this c# code:

//Sets the default mode after a delete/insert/update operation
FormView1.DefaultMode = FormViewMode.ReadOnly;
//This changes the formview's state
FormView1.ChangeMode(FormViewMode.Insert);

A common problem is when you are linking a FormView to a GridView (to do a master-details), if you notice that the behavior is not what you want; check what you are doing with that property. Setting the default value to “ReadOnly” usually works fine. If you need to “change” the state of the FormView because of your programming logic, try the ChangeState method.

Rate this Article: Current: 0 / 5 stars - 0 vote(s).

Article Source: http://www.articlesbase.com/programming-articles/how-to-solve-a-common-problem-with-aspnet-formview-defaultstate-property-246819.html

Print this Article Print article   Email to a Friend Send to friend   Publish this Article on your Website Publish this Article   Send Author Feedback Author feedback  
About the Author:

Leonardo is a .NET programmer who likes to share code and ideas with the people around the globe.
He runs the TeKnowMagic Team and offers several games and tools for download from his site.

Submitting articles has become one of the most popular means to drive traffic to your website and promote yourself and your business. Join us today - It's Free!

Article Comments

Comment on this article Comment on this article
Your Name
Your Email:
Comment Body
Enter Validation Code: Captcha


Related Articles

How to Create a Data Source in Visual Studio.net
By: ProgrammingHelp.com | 27/06/2008 | Programming
This detailed article by James will tell you how to create a Data Source in Visual Studio .NET, along with easy-to-follow screenshots that guide you along the way.

Installing Ajax Toolkit for Visual Studio .net 2005
By: Programminghelp.com | 08/08/2008 | Programming
In this article I will explain how you can integrate the AJAX framework into a web site and very easily create an AJAX enabled web site within Visual Studio 2005 utilizing C#.

Creating a Simple Ajax Control in Asp.net 2.0 and C#
By: Programminghelp.com | 08/08/2008 | Programming
In this article I will explain how you can easily create an AJAX enabled web site within Visual Studio 2005 utilizing C# and how to utilize the AJAX framework to add a simple control from the list of controls available in the AJAX Control Toolkit.

Optimizing Your Asp.Net Pages for Faster Loading and Better Performance.
By: John Belthoff | 27/04/2006 | Programming
If you read the internet and all of the websites dedicated to Asp.Net you will inevitably read about the wonders of the DataGrid, DataList, and Repeater controls. While each of these has its place, if you are only displaying data there is a much faster and more efficient means to do so.

Url Rewriting in Asp.net With Sample Project
By: joggee | 27/06/2008 | Programming
URL rewriting is the process of intercepting an incoming Web request and automatically redirecting it to a different URL. To understand completely follow below link http://msdn.microsoft.com/en-us/library/ms972974.aspx In this article I am going make a simple example which will take only few minutes and you will learn how to achieve URL Rewriting. I believe developer doesn’t have much time to read a complete article of 20 pages.

Should You Be Selling Information Products?
By: Benjamin Scott | 13/09/2005 | ECommerce
Or website design secrets. The surface has just been scratched! Here are just a few of the excellent benefits one will attain from selling information products on.

Learning How to Fish
By: Nicky Pilkington | 29/12/2005 | Sports & Fitness
You have decided that you want to learn to fish. There are several ways of learning, the hardest being trial and error. It would be best to find an instructor for one-on-one lessons.

Tips on Finding a Fishing Guide
By: Nicky Pilkington | 12/01/2006 | Sports & Fitness
1. Open Communication matters. It is important that you provide the guide all the information they need so that they will figure out what kind of fishing trip is best for you. Be sure to be honest in telling the guide how much experience you have regardin

Got a Question? Ask.

Ask the community a question about this article:

Frequently Asked Questions

How to manage multiple submit buttons on an asp.net form?
By: beytz | 16-08-2008
I have an asp.net form with multiple text boxes.Also, in this form I have several submit buttons. I want to activate the submit button according to the text box I was in while pressing it... how do I do that?

User and Permission
By: Le Tri Dung | 18-06-2008
How to creat user and  permission in asp.net 2.0 (c#)?Can you tell me?Thanks!

Accessing session objects size?
By: Istarion | 03-06-2008
I guess that's not possible but I'll try... Is there a way to view the objects in memory in the current asp.net session and the size of them??That would be great.And it's possible to use sos.dll during execution to print objects sizes?? Thanks in advance!

How to add e-mail verification?
By: beytz | 27-05-2008
Hello,I'm building an asp.net web site.How do I add to my sign up page e-mail verification? 

What is c#
By: pradeepbaloni | 20-05-2008
what is c#

I need to implement bulk mailing on my site
By: vijen | 25-04-2008
m developing a site using asp.net, I need to implement bulk mailing on my site for my users informing them about new offers.... How can I do that?????

Q&A Powered by:
Powered by Yedda 

Latest Programming Articles

Cool Desktop Wallpapers
By: Danny | 18/11/2008
Cool desktop wallpaper is accomplishments arrangement that displayed in the computer operating system. The wallpapers usually be acclimated in JPEG, BMP and GIF book formats. That wallpaper can be acclimated with Microsoft Windows, Linux and Macintosh Mac OS. Each adviser can be altered requirements, alike admitting wallpaper images advised for accepted monitors can be scaled up or bottomward to the fit size. Those are accessible on the internet for free. Some categories of wallpapers are a

Tips for Buying Software Online
By: Daniel Jowssey | 17/11/2008
Buying software online not only helps save the planet, it also has other benefits, including: * Ease and Simplicity. You can purchase software in your underwear at 4am if you really want to. Shopping online doesn’t have to be done within regular business hours, nor do you need to look your best to do it. It’s also easy to shop around for the best prices and takes less time than driving to the shops.

Mvc Design Pattern
By: TuVinhSoft .,JSC | 14/11/2008
Model-view-controller (MVC) is an architectural pattern used in software engineering. In complex computer applications that present a large amount of data to the user, a developer often wishes to separate data (model) and user interface (View) concerns, so that changes to the user interface will not affect data handling, and that the data can be reorganized without changing the user interface.

Advantages of Low Cost Contract Programmers in Freelance Programming
By: Joanna Gadel | 12/11/2008
It observed that web industry is getting tougher thus the necessity of freelance contract programmer is required for developing more effective website with flexible features. This article states the fruitful advantages of freelance programmers in contract programming.

A Guide to Cnc Kits
By: Martin Applebaum | 09/11/2008
CNC kits are a way in which to construct your CNC machine. This article will provide some information on these machines.

A Guide to Cnc Tube Bending Machines
By: Martin Applebaum | 08/11/2008
Are you familiar with a CNC tube bending machine? This article will shed some light on the main function and components of this machine.

Ways to Hire Dedicated Php Programmers
By: Jucick | 08/11/2008
It’s not at all easy to hire dedicated PHP programmers unless you know where and how to find them. Whether you need to fix, update or enhance your website you naturally want the job done quick and right.

Top 4 Reasons Why Addressing Web Accessibility is Important
By: Matt Cave | 05/11/2008
There are very high chances that web accessibility is more important to the performance of your web site than you realize. Article takes a look at the top 4 reasons why it would be important to address the issue of web accessibility.

More from Leonardo Paneque

How to Connect you Pocket Pc Emulator to your Desktop Computer?
By: Leonardo Paneque | 29/10/2007 | Programming
Is common to have troubles when opening TCP/IP connection from a device emulator to a host machine, this articles explains how to solve that problem.

Article Categories





Give Feedback

Sign up for our email newsletter

Receive updates, enter your email below