T
tshad
I have the following event called from my DataGrid to my Code-Behind file.
I am using VS 2003
private void articleList_DeleteFile(Object sender, DataGridCommandEventArgs
e)
{
//First, get the filename to delete
string fileName = (string)articleList.DataKeys[e.Item.ItemIndex];
errorMessageLabel.Text = "You opted to delete the file " +
fileName + ".<br />" +
"This file could be deleted by calling: " +
"<code>File.Delete(fileName)</code><p>";
// You would want to rebind the Directory's files to the DataGrid after
// deleting the file...
}
But I am getting the following error:
CS0122: 'integration.WebForm1.articleList_ItemDataBound(object,
System.Web.UI.WebControls.DataGridItemEventArgs)' is inaccessible due to its
protection level
I can fix the problem by changing it from private to public.
I get the same problem when I double click an object such as a radio button.
It jumps to my code page and sets up the event for me, but always uses
private that I have to change to public. Is there some directive I have to
set? Why doesn't VS know about this?
Thanks,
Tom
I am using VS 2003
private void articleList_DeleteFile(Object sender, DataGridCommandEventArgs
e)
{
//First, get the filename to delete
string fileName = (string)articleList.DataKeys[e.Item.ItemIndex];
errorMessageLabel.Text = "You opted to delete the file " +
fileName + ".<br />" +
"This file could be deleted by calling: " +
"<code>File.Delete(fileName)</code><p>";
// You would want to rebind the Directory's files to the DataGrid after
// deleting the file...
}
But I am getting the following error:
CS0122: 'integration.WebForm1.articleList_ItemDataBound(object,
System.Web.UI.WebControls.DataGridItemEventArgs)' is inaccessible due to its
protection level
I can fix the problem by changing it from private to public.
I get the same problem when I double click an object such as a radio button.
It jumps to my code page and sets up the event for me, but always uses
private that I have to change to public. Is there some directive I have to
set? Why doesn't VS know about this?
Thanks,
Tom