[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 239
  • Last Modified:

Gridview based on Membership class

Hi, I've got a gridview that deletes the users in the Membership class.  I'm trying to set it up so that the gridview refreshes and removes the user after the delete button is hit.  Does anybody know how to perform this? Thanks
protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
    {
        try
        {
            string str = this.GridView1.Rows[e.RowIndex].Cells[0].Text;
            //Deleting files associated with user
            ////string sql = "Delete from UserofFile where FileUser = " + "'" + str + "'";
            
            
            Membership.DeleteUser(str);
 
 
           
 
 
        }
        catch (ArgumentOutOfRangeException ex)
        {
            statuslbl.Text = ex.Message;
        }
 
    }

Open in new window

0
JeffEae
Asked:
JeffEae
1 Solution
 
daveamourCommented:
On line 11 just call the code again which loads the GridView.
Maybe you have a method - LoadGridView() ?
Or just a couple of lines of code:
MyGridView.DataSource = GetMembers();
MyGridView.DataBind()
Something like that should work.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now