Posted on: 5/30/2012 9:22:31 PM | Views : 508

Hello,
I cant seem to get the value of a field in the deleting row when the user clicks the "DELETE" button on a row in my ListView.  The field name is "UserName" and it is in the _ItemDeleteing event.  I need this field name so I can delete rows from other tables.  I get a "Object reference not set to an instance of an object" error.  Here is the code
protected void ListView1_ItemDeleting(object sender, ListViewDeleteEventArgs e) { string strUser; strUser = e.Values["UserName"].ToString(); // Error Here! if (User.Identity.Name != strUser) { //Membership.DeleteUser(strUser, true); } // e.Cancel = true; }  
 
Here is the Form
ge Contacts" Language="C#" MasterPageFile="~/MasterPages/SiteMasterPage.master" AutoEventWireup="true" CodeFile="ManageC ...

Go to the complete details ...