I have a couple questions about step 3 in the Try it Out on page 319.
1. I was unable to click anywhere on the Design View to generate the Page_Load handler. Also, the drop down lists at the top of the Document Window for Demos/Email.aspx.
vb had nothing in them. I ended up copying the code from the Source directory and pasting it here. What was I doing wrong?
2. The Partial Class line in my code below did not replace $relurlnamespace_Email with Demos-Email similar to this file in the Source directory. Do have a disconnect here?
Code:
Imports System.Net.Mail
Partial Class $relurlnamespace_Email
Inherits BasePage
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim myMessage As MailMessage = New MailMessage()
myMessage.Subject = "Test Message"
myMessage.Body = "Hello world, from Planet Wrox"
myMessage.From = New MailAddress("you@yourprovider.com", "Sender Name")
myMessage.To.Add(New MailAddress("you@yourprovider.com", "Receiver Name"))
Dim mySmtpClient As SmtpClient = New SmtpClient()
mySmtpClient.Send(myMessage)
End Sub
End Class