In my asp.net projects the button submit_click methods are always private and it works because it is called by the class itself. I am not sure I understand why in your case you want to call this method from another class, default.aspx.cs.
>Slowly playing and trying things to learn ASP.NET when time permits...
>
>I have a simple page with a submit button so I can see how it goes to the next page (child's play, right?)
>
>I have the following button:
>
>< asp:button id="btnNext" runat="server" Text="Next" Onclick="btnNext_Click" >< /asp:button >
>
>
>"default.aspx.cs" has the following excerpt:
>
>private void btnNext_Click(object sender, System.EventArgs e)
>{
> Response.Redirect("page2.aspx");
>}
>
>I get the following compiler error:
>
>myproj.WebForm1.btnNext_Click(object, System.EventArgs)' is inaccessible due to its protection level
>
>If I change "
private void
" to "
public void
" it works. Why is private not accessible?
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham