In the previous article , we learned how to create a simple Grid View at runtime .
Sql Client; public partial class _Default : System.
The first thing is because of us, while the textbox is maintained by ASP. Try deleting the value and pressing the second button again.
You will see that the textbox is now cleared, but our name label keeps the name, because the value we saved to the View State is still there!
aspdotnet-suresh offers C#articles and tutorials,csharp dot net,articles and tutorials, VB.
In this article we create a Gridview from database and add some additional operations such a add, edit and delete data in the Grid View control.
I am assuming that I have to play with record of persons (First Name, Last Name, Age) and I will refer only these data through out this article. just to give you flexibility to not show scroll bar for long screens.
Please keep in mind though, that while cookies and sessions can be accessed from all your pages on your website, View State values are not carried between pages.
Then it dawned in me that, i was checking if the subject (string) of an email (instance/object), what if the email(instance) was already a null at the first place.
How could i check for a subject of an email, if the email is already a null..i checked if the the email was empty, it worked fine.
Here is a simple example of using the View State to carry values between postbacks: Try running the project, enter your name in the textbox and press the first button. This one does nothing at all actually, it just posts back to the server.
The name will be saved in the View State and set to the Label as well. As you will notice, the Name Label still contains the name, but so does the textbox.