Nulls.net: Invalid use of Null Error : use, null, invalid, error :)

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


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

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.

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.


Article from articlesbase.com


csharp



Nulls

This is part 1/3. In this tutorial you will learn how to make a sticky note (reminder) application but with better intelligence. We use Microsoft Visual Studio 2008 and we programme using the c sharp language. Please subscribe to our video tutorial channel and rate 5 stars! Created by: Gokujames The #1 Programming Forum: forum.codecall.net – - – - – - – - – - – - – - – - – - – - – - – - – - – - – - – - – - – - – - Follow Codecall onTwitter http RSS Feed codecall.net – - – - – - – - – - – - – - – - – - – - – - – - – - – - – - – - – - – - – - TAGS: executable Making Simple exe Visual Beginners C LanguageFacebook Farmville Bot Tutorial Auto Clicker Cheat bott hacker programming c# C++ php csharp video tutorials forum coding guides programming tutorial hacking moding chipping codecall forums call of duty 6 modern warfare 2 top 10 kills series episode 1 anoj machinima snipes multi-kills ac130 chopper gunner tactical nuke yt:quality=high gameplay noscope throwing knife Call of Duty Modern “Warfare 2″ MW2 UPC 47875333376 PS3 047875837492 XBox 360 XBox360 X360 0047875333376 PC MPN 83747 Infinity Ward Activision “Duty 6″ CoD MW two Visual Studio 2008: C Tutorial: Windows Form Controls


Most Related Posts

You must be logged in to post a comment.


htcell