Question : Asp.net Errors on compiling & runtime, Could not load type 'EmailSubscribers' &

Asp.net Errors on compiling & runtime, Could not load type 'EmailSubscribers' &  Mail ??

Run time error:

Parser Error
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.

Parser Error Message: Could not load type 'EmailSubscribers'.

Source Error:


Line 1:  
Line 2:  <%@ Page language="VB" Debug="true" Inherits="EmailSubscribers" CodeBehind="EmailSubscribers.aspx.vb" AutoEventWireup="false" validateRequest="false" %>
Line 3:  
Line 4:  <html>
 



Complie errors
--------------------------------------------
Error      4      Could not load type 'EmailSubscribers'.      C:\WebSite2\Annonymous\EmailSubscribers.aspx      2      
Error      5      Overload resolution failed because no accessible 'New' accepts this number of arguments.      C:\WebSite2\Annonymous\EmailSubscribers.aspx.vb      77      25      C:\WebSite2\
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
119:
120:
121:
122:
123:
124:
125:
126:
127:
128:
129:
130:
131:
132:
133:
134:
Imports System
Imports System.Collections
Imports System.ComponentModel
Imports System.Data
Imports System.Data.SqlClient
Imports System.Configuration
Imports System.Drawing
Imports System.IO
Imports System.Net
Imports System.Web
Imports System.Net.Mail
Imports System.Web.SessionState
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports System.Web.UI.HtmlControls
Imports System.Text

Public Class EmailSubscribers : Inherits System.Web.UI.Page
    Protected RtnHomeButton As System.Web.UI.WebControls.HyperLink
    Protected MyDataGrid As System.Web.UI.WebControls.DataGrid

    '*******************************************************
    '
    ' The Page_Load event handler on this User Control is used to
    ' obtain a DataReader of contact information from the Contacts
    ' table, and then databind the results to a DataGrid
    ' server control.  It uses the ASPNetPortal.ContactsDB()
    ' data component to encapsulate all data functionality.
    '
    '*******************************************************

    Private Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
        If Not IsPostBack Then
            Dim myConnection As New SqlConnection("ASPNETDBConnectionString")
            Dim myCommand As New SqlCommand("SELECT emailID email FROM subscriptions", myConnection)

            myConnection.Open()

            Dim dr As SqlDataReader = myCommand.ExecuteReader()

            MyDataGrid.DataSource = dr
            MyDataGrid.DataBind()

            myConnection.Close()

        End If
    End Sub

    Private Sub GetSelections_Click(ByVal sender As Object, ByVal e As System.EventArgs)
        Dim rowCount As Integer = 0
        Dim gridSelections As New StringBuilder()

        'Loop through each DataGridItem, and determine which CheckBox controls
        'have been selected.
        For Each DemoGridItem As DataGridItem In MyDataGrid.Items

            '(TextBox)(e.Item.Cells[1].FindControl("edit_Address1"));
            Dim myCheckbox As CheckBox = DirectCast(DemoGridItem.Cells(0).FindControl("myCheckbox"), CheckBox)
            If myCheckbox.Checked = True Then
                rowCount += 1
                gridSelections.AppendFormat("The checkbox for {0} was selected<br>", MyDataGrid.DataKeys(DemoGridItem.ItemIndex).ToString())

                'Trace.Write("test:2" + MyDataGrid.DataKeys[DemoGridItem.ItemIndex].ToString());


                Dim myConnection1 As New SqlConnection("ASPNETDBConnectionString")
                Dim myCommand As New SqlCommand("select Email from Pilots Where PilotsID = '" + MyDataGrid.DataKeys(DemoGridItem.ItemIndex).ToString() + "'", myConnection1)

                myConnection1.Open()

                Dim drn As SqlDataReader = myCommand.ExecuteReader()
                drn.Read()
                Dim ToEmail As String = DirectCast(drn("Email"), [String])

                If ToEmail <> "" Then

                    Dim Email As New System.Net.Mail.MailMessage(ToEmail)
                    Email.Subject = "Used Vocational Trucks.com - Sale Notices"
                    Email.Body = "To Contact Us:<br>Used Vocational Trucks.com<br>PO Box 503145<br>White City, OR  97503  USA<br>541-690-4735<br>[email protected]<br>www.usedvocationaltrucks.com"
                    Dim mailClient As New System.Net.Mail.SmtpClient()

                    'This object stores the authentication values
                    Dim basicAuthenticationInfo As New System.Net.NetworkCredential("[email protected]", "xxxxxNeedDave's email Paswd")

                    'Put your own, or your ISPs, mail server name onthis next line
                    mailClient.Host = "[email protected]"
                    mailClient.UseDefaultCredentials = False
                    mailClient.Credentials = basicAuthenticationInfo

                    mailClient.Send(Email)
                End If
                myConnection1.Close()
            End If
        Next

        Response.Redirect(Request.ApplicationPath)
    End Sub

End Class

--------------

<%@ Page language="VB" Debug="true" Inherits="EmailSubscribers" CodeBehind="EmailSubscribers.aspx.vb" AutoEventWireup="false" validateRequest="false" %>

<html>
<head>
<title>
   <p>E-Mail Subscribers Posted Sales</p>
</title>
</head>
<body>

	<table border="0" cellspacing="0" cellpadding="0" width="600">
		<tr>
			<td align="left"><b>Send Email to Subscribers</b>(check send mail box)</td>
			<td align="right"><asp:hyperlink id="RtnHomeButton" cssclass="printbutton" NavigateUrl="~/Annonymous/index.aspx"
					runat="server">Home</asp:hyperlink></td>
		</tr>
	</table>
	<form id="default" method="post" runat="server">

		<P><asp:button id="GetSelections" runat="server" Text="Send Email to Subscribers"></asp:button></P>
		<P><asp:label id="ResultsInfo" runat="server"></asp:label></P>
		<asp:datagrid id="MyDataGrid" runat="server" DataKeyField="Email">
			<Columns>
				<asp:TemplateColumn HeaderText="Selected">
					<ItemTemplate>
						<asp:CheckBox ID="myCheckbox" Checked="True" Runat="server" />
					</ItemTemplate>
				</asp:TemplateColumn>
			</Columns>
		</asp:datagrid></form>
</body>
</html>

Answer : Asp.net Errors on compiling & runtime, Could not load type 'EmailSubscribers' &

Sorry, use this formula:

=AND(RIGHT($A2,6)=" Count",RIGHT($A1,6)<>" Count")
Random Solutions  
 
programming4us programming4us