?
Solved

new in asp.net

Posted on 2004-10-25
10
Medium Priority
?
973 Views
Last Modified: 2013-11-25
i created a page in asp.net called index.aspx   and it works fine.    i would like to add a contact form written in the syntax below but it generates an error on the server.  do i have to enable anything for C language to work?


<!-- AspEmail .NET Code samples: Simple.aspx -->
<!-- Copyright (c) 2002 Persits Software, Inc. -->
<!-- http://www.persits.com -->


<%@ Import Namespace="System.Web" %>
<%@ Import Namespace="ASPEMAILLib" %>
<%@ Import Namespace="System.Reflection" %>


<script runat="server" LANGUAGE="C#">

void Page_Load(Object Source, EventArgs E)
{
      // Change this to your own SMTP server
      String strHost = "192.168.111.2";      
      
      txtHost.InnerHtml = strHost;      
      
      if( IsPostBack )
      {
            // MailSender object declaration
            ASPEMAILLib.IMailSender objMail;
            objMail = new ASPEMAILLib.MailSender();

            objMail.Host = strHost;

            objMail.From = txtFrom.Value;            // From address
            objMail.FromName = txtFromName.Value;      // optional

            // To address, 2nd argument optional
            objMail.AddAddress(txtTo.Value, Missing.Value);            
            
            // message subject
            objMail.Subject = txtSubject.Value;
            
            // message body
            objMail.Body = txtBody.Value;

            try
            {
                  objMail.Send(Missing.Value);
                  txtMsg.InnerHtml = "<font color=green>Success! Message sent to " + txtTo.Value + ".</font>";
            }
            catch(Exception e)
            {
                  txtMsg.InnerHtml = "<font color=red>Error occurred: " + e.Message + "</font>";
            }
      }
}

</script>
0
Comment
Question by:gianitoo
  • 5
  • 5
10 Comments
 
LVL 1

Author Comment

by:gianitoo
ID: 12403362
here is the page...so u can see the rror

http://www.indianayouthsoccer.org/samples/simple/simple.aspx
0
 
LVL 14

Expert Comment

by:dfu23
ID: 12403371
What's the error?
0
 
LVL 1

Author Comment

by:gianitoo
ID: 12403384
Server Error in '/' Application.
--------------------------------------------------------------------------------

Runtime Error
Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.

Details: To enable the details of this specific error message to be viewable on remote machines, please create a <customErrors> tag within a "web.config" configuration file located in the root directory of the current web application. This <customErrors> tag should then have its "mode" attribute set to "Off".

0
Fill in the form and get your FREE NFR key NOW!

Veeam is happy to provide a FREE NFR server license to certified engineers, trainers, and bloggers.  It allows for the non‑production use of Veeam Agent for Microsoft Windows. This license is valid for five workstations and two servers.

 
LVL 14

Expert Comment

by:dfu23
ID: 12403386
Ok, in order for outsiders like me to be able to see the error you must set:

<customErrors mode="Off"/>

in the web.config file
0
 
LVL 1

Author Comment

by:gianitoo
ID: 12403452
i dont have  a webconfig file for that page.   i can include it though....do you include it as a server side include?
0
 
LVL 1

Author Comment

by:gianitoo
ID: 12403506
ok i got it...this is the output  error

Server Error in '/' Application.
--------------------------------------------------------------------------------

Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: CS0246: The type or namespace name 'ASPEMAILLib' could not be found (are you missing a using directive or an assembly reference?)

Source Error:

 

Line 5:  
Line 6:  <%@ Import Namespace="System.Web" %>
Line 7:  <%@ Import Namespace="ASPEMAILLib" %>
Line 8:  <%@ Import Namespace="System.Reflection" %>
Line 9:  
 

Source File: D:\Websites\IYSA\samples\simple\simple.aspx    Line: 7



Show Detailed Compiler Output:


C:\WINNT\system32> "c:\winnt\microsoft.net\framework\v1.1.4322\csc.exe" /t:library /utf8output /R:"c:\winnt\assembly\gac\system.drawing\1.0.5000.0__b03f5f7f11d50a3a\system.drawing.dll" /R:"c:\winnt\microsoft.net\framework\v1.1.4322\temporary asp.net files\root\9e3ee1a2\297b591d\assembly\dl2\f8c46580\32767da3_f0b6c401\absolutelivesupport.dll" /R:"c:\winnt\assembly\gac\system.web.mobile\1.0.5000.0__b03f5f7f11d50a3a\system.web.mobile.dll" /R:"c:\winnt\microsoft.net\framework\v1.1.4322\temporary asp.net files\root\9e3ee1a2\297b591d\assembly\dl2\70b278db\2a5902dd_57b1c401\absolutenewsletter.dll" /R:"c:\winnt\assembly\gac\system.data\1.0.5000.0__b77a5c561934e089\system.data.dll" /R:"c:\winnt\microsoft.net\framework\v1.1.4322\temporary asp.net files\root\9e3ee1a2\297b591d\assembly\dl2\0faef40b\b09c08eb_aab7c401\absolutenewsmanager.dll" /R:"c:\winnt\assembly\gac\system.enterpriseservices\1.0.5000.0__b03f5f7f11d50a3a\system.enterpriseservices.dll" /R:"c:\winnt\microsoft.net\framework\v1.1.4322\mscorlib.dll" /R:"c:\winnt\assembly\gac\system.web\1.0.5000.0__b03f5f7f11d50a3a\system.web.dll" /R:"c:\winnt\assembly\gac\system\1.0.5000.0__b77a5c561934e089\system.dll" /R:"c:\winnt\assembly\gac\system.web.services\1.0.5000.0__b03f5f7f11d50a3a\system.web.services.dll" /R:"c:\winnt\assembly\gac\system.xml\1.0.5000.0__b77a5c561934e089\system.xml.dll" /R:"c:\winnt\microsoft.net\framework\v1.1.4322\temporary asp.net files\root\9e3ee1a2\297b591d\assembly\dl2\b5d3c9c3\66fe5697_7289c301\dreamweaverctrls.dll" /out:"C:\WINNT\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET Files\root\9e3ee1a2\297b591d\fdkrswpo.dll" /debug- /optimize+ /warnaserror /w:1  "C:\WINNT\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET Files\root\9e3ee1a2\297b591d\fdkrswpo.0.cs"


Microsoft (R) Visual C# .NET Compiler version 7.10.3052.4
for Microsoft (R) .NET Framework version 1.1.4322
Copyright (C) Microsoft Corporation 2001-2002. All rights reserved.

D:\Websites\IYSA\samples\simple\simple.aspx(7,11): error CS0246: The type or namespace name 'ASPEMAILLib' could not be found (are you missing a using directive or an assembly reference?)

 



Show Complete Compilation Source:
0
 
LVL 14

Accepted Solution

by:
dfu23 earned 2000 total points
ID: 12403631
Do you have the assembly (DLL) for ASPEMAILLib? It needs to go into the bin directory on your website ...
0
 
LVL 1

Author Comment

by:gianitoo
ID: 12403780
got it..thanks
0
 
LVL 14

Expert Comment

by:dfu23
ID: 12403792
did that solve the problem or are there still issues?
0
 
LVL 14

Expert Comment

by:dfu23
ID: 12403795
cool
0

Featured Post

Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article, I will show how to use the Ribbon IDs Tool Window to assign the built-in Office icons to a ribbon button.  This tool will help us to find the OfficeImageId that corresponds to our desired built-in Office icon. The tool is part of…
I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:   The Exchange of informatio…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…

580 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question