Protection level

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top