My webpage comes out empty yet it has data
Please help
Partial Public Class modifyuser
Inherits System.Web.UI.Page
Private username As String
Private email As String
Protected Sub Page_Load(sender As Object, e As EventArgs)
If Not IsPostBack Then
BindGridview()
End If
End Sub
' This Method is used to bind gridview
Protected Sub BindGridview()
gvDetails.DataSource = Membership.GetAllUsers()
gvDetails.DataBind()
End Sub
' This event is used to cancel the edit mode
Protected Sub gvDetails_RowCancelingEdit(sender As Object, e As GridViewCancelEditEventArgs)
gvDetails.EditIndex = -1
BindGridview()
End Sub
' This event is used to make our girdivew editable
Protected Sub gvDetails_RowEditing(sender As Object, e As GridViewEditEventArgs)
gvDetails.EditIndex = e.NewEditIndex
BindGridview()
End Sub
' This event is used to delete our gridview records
Protected Sub gvDetails_RowDeleting(sender As Object, e As GridViewDeleteEventArgs)
username = gvDetails.Rows(e.RowIndex).Cells(1).Text
Membership.DeleteUser(username)
lblResult.Text = String.Format("{0} Details deleted Successfully", username)
lblResult.ForeColor = Color.Green
BindGridview()
End Sub
' This event is used to update gridview data
Protected Sub gvDetails_RowUpdating(sender As Object, e As GridViewUpdateEventArgs)
Dim index As Integer = gvDetails.EditIndex
Dim gvrow As GridViewRow = gvDetails.Rows(index)
username = gvDetails.Rows(e.RowIndex).Cells(1).Text
email = (CType(gvrow.Cells(2).Controls(0), TextBox)).Text
Dim user As MembershipUser = Membership.GetUser(username)
If user IsNot Nothing Then
user.Email = email
Membership.UpdateUser(user)
lblResult.Text = String.Format("{0} Details updated Successfully", username)
lblResult.ForeColor = Color.Green
End If
gvDetails.EditIndex = -1
BindGridview()
End Sub
End Class