Solved

new in asp.net

Posted on 2004-10-25
962 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
Question by:gianitoo
    10 Comments
     
    LVL 1

    Author Comment

    by:gianitoo
    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
    What's the error?
    0
     
    LVL 1

    Author Comment

    by:gianitoo
    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
     
    LVL 14

    Expert Comment

    by:dfu23
    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
    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
    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:
    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
    got it..thanks
    0
     
    LVL 14

    Expert Comment

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

    Expert Comment

    by:dfu23
    cool
    0

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to improve team productivity

    Quip adds documents, spreadsheets, and tasklists to your Slack experience
    - Elevate ideas to Quip docs
    - Share Quip docs in Slack
    - Get notified of changes to your docs
    - Available on iOS/Android/Desktop/Web
    - Online/Offline

    What my article will show is if you ever had to do processing to a listbox without being able to just select all the items in it. My software Visual Studio 2008 crystal report v11 My issue was I wanted to add crystal report to a form and show…
    After several hours of googling I could not gather any information on this topic. There are several ways of controlling the USB port connected to any storage device. The best example of that is by changing the registry value of "HKEY_LOCAL_MACHINE\S…
    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…
    Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

    931 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

    Need Help in Real-Time?

    Connect with top rated Experts

    12 Experts available now in Live!

    Get 1:1 Help Now