Open() Dim cmd As New Sql Command("Select * from stores", con) Dim da As New Sql Data Adapter(cmd) Dim ds As New Data Set() da. Page Private con As New Sql Connection("Data Source=.; Initial Catalog=pubs; User ID=sa; Password=*****") Protected Sub Page_Load(By Val sender As Object, By Val e As System. Load If Not Is Post Back Then load Stores() End If End Sub Protected Sub load Stores() con. 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! Data Bind() Dim columncount As Integer = grid View. " End If End Sub Protected Sub grid View_Row Editing(By Val sender As Object, By Val e As Grid View Edit Event Args) grid View. New Edit Index load Stores() End Sub Protected Sub grid View_Row Updating(By Val sender As Object, By Val e As Grid View Update Event Args) Dim stor_id As String = grid View. aspdotnet-suresh offers C#articles and tutorials,csharp dot net,articles and tutorials, VB.
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.
As described elsewhere in this tutorial, the View State allows ASP.
NET to repopulate form fields on each postback to the server, making sure that a form is not automatically cleared when the user hits the submit button.
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.