Thanks very much.
protected void Createuserwizard1_SendingMail(object sender,
MailMessageEventArgs e)
was the proper format.
I was curious how this problem was introduced, since I thought I took it
from ms-help. I took it from within a structure like:
<script runat="server">
void ...
</script>
which suggests that the script context somehow changes this default private
setting to something protected or public.
Thanks for your reply.
About the difference between the same function in aspx inline <script>
section, it is a bit more complex. This is related to the ASP.NET page's
compilation model, functions defined in aspx inline tempate are compiled
into the final executing Page class. While function in codebehind are in a
base class(also dynamically generate at runtime). Therefore, if functions
in codebehind class is marked as private, it will not be visible to the
aspx compiled class(executing page class). This is a potential problem when
you use codebehind function as control's event handler(need to make them
protected or public).
Best regards,
Steven Cheng
Microsoft MSDN Online Support Lead
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we
can improve the support we provide to you. Please feel free to let my
manager know what you think of
the level of service provided. You can send feedback directly to my manager
at: msdnmg@microsoft.com.
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
>X-Trace-PostClient-IP: 70.67.40.71
>From: "jrl" <jrl@newsgroup.nospam>
>Newsgroups: microsoft.public.vsnet.general
>References: <Du4Bj.67330$pM4.7030@pd7urf1no>
<au0JDPogIHA.6844@TK2MSFTNGHUB02.phx.gbl>
>In-Reply-To: <au0JDPogIHA.6844@TK2MSFTNGHUB02.phx.gbl>
>Subject: Re: MailMessageEvent is inaccessible
>Thanks very much.
>protected void Createuserwizard1_SendingMail(object sender,
[quoted text clipped - 27 lines]
>>
>> http://www.codeguru.com/forum/archive/index.php/t-242481.html
http://www.velocityreviews.com/forums/t367225-method-is-inaccessible-due-to-
>> its-protection-level.html
>>
[quoted text clipped - 40 lines]
>>>How do set the protection level so that the application can send this
>> email?