join.aspx returns error on server

Apr 17, 2012 at 2:59 AM

http://www.tftm.keeponhiking.com

This form returns this error when trying to load on server, it works OK locally

500 - Internal server error.

There is a problem with the resource you are looking for, and it cannot be displayed.

 

<script runat="server">  

    private string CreateRow(string label, string value)
    {
        return string.Format(
            "<tr><td><b>{0}</b></td><td>{1}</td></tr>",
            HttpUtility.HtmlEncode(label),
            HttpUtility.HtmlEncode(value));
    }    

    protected void Button1_Click(object sender, EventArgs e)
    {
        using (MailMessage mail = new MailMessage())
        {
            mail.From = new MailAddress(BlogSettings.Instance.Email);

            mail.To.Add("treasurer@tftm.org");
            mail.To.Add("membership@tftm.org");
            mail.To.Add("etracks@me.com");
            
            if (Utils.IsEmailValid(Email.Text))
	        mail.To.Add(Email.Text.Trim());
                        
            mail.Subject =Last_name.Text;

            StringBuilder sb = new StringBuilder();
            sb.Append("<table border=\"1\" cellpadding=\"5\">");

            sb.Append(CreateRow("Submitted First Name", First_name.Text));
            sb.Append(CreateRow("Submitted Last Name", Last_name.Text));
            sb.Append(CreateRow("Submitted Street", Street.Text));
            sb.Append(CreateRow("Submitted City", City.Text));
            sb.Append(CreateRow("Submitted State", State.Text));
            sb.Append(CreateRow("Submitted Zip", Zip.Text));
            sb.Append(CreateRow("Submitted Phone", Phone.Text));
            sb.Append(CreateRow("Submitted Email", Email.Text));
            sb.Append(CreateRow("Submitted Single", Single.Text));
            sb.Append(CreateRow("Submitted Family", Family.Text));
            sb.Append(CreateRow("Submitted Donor", Donor.Text));
            sb.Append(CreateRow("Submitted Sponser", Sponser.Text));
            sb.Append(CreateRow("Submitted Renewal", Renewal.Text));
            sb.Append(CreateRow("Submitted Address_change", Address_change.Text));
            sb.Append(CreateRow("Submitted Performers", Performers.Text));
            sb.Append(CreateRow("Submitted Membership directory", Membership_directory.Text));
            sb.Append(CreateRow("Submitted Concerts volunteer", Concerts_volunteer.Text));
            sb.Append(CreateRow("Submitted Dances volunteer", Dances_volunteer.Text));
            
                                       
            
            
            sb.Append("</table>");

            mail.IsBodyHtml = true;
            mail.Body = sb.ToString();

            string errorMessage = Utils.SendMailMessage(mail);
            if (string.IsNullOrEmpty(errorMessage))
            {
                // success
                Response.Redirect("http://tftm.org/page/Form-confirmation.aspx");
            }
            else
            {
                Response.Write("An error occurred sending the email.  Error: " + errorMessage);
            }
        }
        
    }

    </script>

 

 








    
<table style="width: 100%">
        <tr>
            <td style="text-align: right; width: 207px">
                First Name</td>
            <td style="width: 128px">
                <asp:TextBox ID="First_name" runat="server"></asp:TextBox>
            </td>
            <td style="width: 96px">
                Last Name</td>
            <td>
                <asp:TextBox ID="Last_name" runat="server"></asp:TextBox>
            </td>
            <td>
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td style="text-align: right; width: 207px">
                Street</td>
            <td style="width: 128px">
                <asp:TextBox ID="Street" runat="server"></asp:TextBox>
            </td>
            <td style="width: 96px">
                City</td>
            <td>
                <asp:TextBox ID="City" runat="server"></asp:TextBox>
            </td>
            <td>
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td style="text-align: right; width: 207px">
                State</td>
            <td style="width: 128px">
                <asp:TextBox ID="State" runat="server"></asp:TextBox>
            </td>
            <td style="width: 96px">
                Zip</td>
            <td>
                <asp:TextBox ID="Zip" runat="server"></asp:TextBox>
            </td>
            <td>
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td style="text-align: right; width: 207px">
                Phone</td>
            <td style="width: 128px">
                <asp:TextBox runat="server" ID="Phone"></asp:TextBox>
            </td>
            <td style="width: 96px">
                Email</td>
            <td>
                <asp:TextBox runat="server" ID="Email"></asp:TextBox>
            </td>
            <td>
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td style="text-align: center; " colspan="6">
                Membership Type</td>
        </tr>
        <tr>
            <td style="text-align: right; width: 207px">
                Single</td>
            <td style="width: 128px">
                <asp:CheckBox ID="Single" runat="server" />
            </td>
            <td style="width: 96px">
                Family</td>
            <td>
                <asp:CheckBox ID="Family" runat="server" />
            </td>
            <td>
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td style="text-align: right; width: 207px; height: 2px;">
                Donor $35.00 -$99.00</td>
            <td style="width: 128px; height: 2px;">
                <asp:CheckBox ID="Donor" runat="server" />
            </td>
            <td style="width: 96px; height: 2px;">
                Sponser $100.00 &amp; up</td>
            <td style="height: 2px">
                <asp:CheckBox ID="Sponser" runat="server" />
            </td>
            <td style="height: 2px">
                </td>
            <td style="height: 2px">
                </td>
        </tr>
        <tr>
            <td style="text-align: right; width: 207px">
                Renewal</td>
            <td style="width: 128px">
                <asp:CheckBox ID="Renewal" runat="server" />
            </td>
            <td style="width: 96px">
                Address change</td>
            <td>
                <asp:CheckBox ID="Address_change" runat="server" />
            </td>
            <td>
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td style="text-align: right; width: 207px">
                What performers would to like to see?</td>
            <td colspan="5">
                <asp:TextBox ID="Performers" runat="server" Height="58px" Width="492px"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td style="text-align: right; width: 207px; height: 55px;">
                Do you want to be included in or membership directory?</td>
            <td style="width: 128px; height: 55px;">
                <asp:CheckBox ID="Membership_directory" runat="server" />
            </td>
            <td style="width: 96px; height: 55px;">
                </td>
            <td style="height: 55px">
                </td>
            <td style="height: 55px">
                </td>
            <td style="height: 55px">
                </td>
        </tr>
        <tr>
            <td style="text-align: right; width: 207px">
                Are you interested in volunteering?</td>
            <td style="width: 128px">
                &nbsp;</td>
            <td style="width: 96px">
                &nbsp;</td>
            <td>
                &nbsp;</td>
            <td>
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td style="text-align: right; width: 207px">
                Concerts</td>
            <td style="width: 128px">
                <asp:CheckBox ID="Concerts_volunteer" runat="server" />
            </td>
            <td style="width: 96px">
                &nbsp;</td>
            <td>
                &nbsp;</td>
            <td>
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td style="text-align: right; width: 207px">
                Dances</td>
            <td style="width: 128px">
                <asp:CheckBox ID="Dances_volunteer" runat="server" />
            </td>
            <td style="width: 96px">
                &nbsp;</td>
            <td>
                &nbsp;</td>
            <td>
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td style="width: 207px">
                &nbsp;</td>
            <td style="width: 128px">
                &nbsp;</td>
            <td style="width: 96px">
                &nbsp;</td>
            <td>
                <asp:Button ID="Button1" OnClick="Button1_Click" runat="server" Text="Submit" />
            </td>
            <td>
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
    </table>  

    
     

  

Coordinator
Apr 17, 2012 at 11:25 AM

Do you mean this URL?

In the web.config file, I would try turning off custom errors -- i.e. <customErrors mode="Off">  (it's case sensitive).  This might give you some error details instead of that generic error page.

And/or you might want to also try seeing if any error is logged in App_Data.  It would be a file named logger.txt.

Apr 17, 2012 at 12:39 PM
Edited Apr 17, 2012 at 12:54 PM

I have my web.config like this:

<customErrors mode="Off" defaultRedirect="~/error.aspx" redirectMode="ResponseRewrite">

      <error statusCode="404" redirect="~/error404.aspx"/>

    </customErrors>

Logger text for this page which also has a form, should be the same issue I'm sure.

Url : http://www.tftm.keeponhiking.com/ditd_reg1.aspx
Raw Url : /ditd_reg1.aspx
Message : Could not load file or assembly 'AjaxControlToolkit' or one of its dependencies. The system cannot find the file specified.
Source : System.Web
StackTrace :    at System.Web.UI.TemplateParser.ParseString(String text, VirtualPath virtualPath, Encoding fileEncoding)
   at System.Web.UI.TemplateParser.ParseFile(String physicalPath, VirtualPath virtualPath)
   at System.Web.UI.TemplateParser.ParseInternal()
   at System.Web.UI.TemplateParser.Parse()
   at System.Web.Compilation.BaseTemplateBuildProvider.get_CodeCompilerType()
   at System.Web.Compilation.BuildProvider.GetCompilerTypeFromBuildProvider(BuildProvider buildProvider)
   at System.Web.Compilation.BuildProvidersCompiler.ProcessBuildProviders()
   at System.Web.Compilation.BuildProvidersCompiler.PerformBuild()
   at System.Web.Compilation.BuildManager.CompileWebFile(VirtualPath virtualPath)
   at System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate)
   at System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate)
   at System.Web.Compilation.BuildManager.GetVirtualPathObjectFactory(VirtualPath virtualPath, HttpContext context, Boolean allowCrossApp, Boolean throwIfNotFound)
   at System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath(VirtualPath virtualPath, Type requiredBaseType, HttpContext context, Boolean allowCrossApp)
   at System.Web.UI.PageHandlerFactory.GetHandlerHelper(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath)
   at System.Web.UI.PageHandlerFactory.GetHandler(HttpContext context, String requestType, String virtualPath, String path)
   at System.Web.HttpApplication.MaterializeHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
TargetSite : Void ParseString(System.String, System.Web.VirtualPath, System.Text.Encoding)
Message : Could not load file or assembly 'AjaxControlToolkit' or one of its dependencies. The system cannot find the file specified.
Source : System.Web
StackTrace :    at System.Web.UI.TemplateParser.ProcessException(Exception ex)
   at System.Web.UI.TemplateParser.ParseStringInternal(String text, Encoding fileEncoding)
   at System.Web.UI.TemplateParser.ParseString(String text, VirtualPath virtualPath, Encoding fileEncoding)
TargetSite : Void ProcessException(System.Exception)
Message : Could not load file or assembly 'AjaxControlToolkit' or one of its dependencies. The system cannot find the file specified.
Source : mscorlib
StackTrace :    at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
   at System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
   at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection, Boolean suppressSecurityChecks)
   at System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
   at System.Reflection.Assembly.Load(String assemblyString)
   at System.Web.Configuration.CompilationSection.LoadAssembly(String assemblyName, Boolean throwOnFail)
   at System.Web.UI.TemplateParser.LoadAssembly(String assemblyName, Boolean throwOnFail)
   at System.Web.UI.TemplateParser.AddAssemblyDependency(String assemblyName, Boolean addDependentAssemblies)
   at System.Web.UI.MainTagNameToTypeMapper.ProcessTagNamespaceRegistrationCore(TagNamespaceRegisterEntry nsRegisterEntry)
   at System.Web.UI.MainTagNameToTypeMapper.ProcessTagNamespaceRegistration(TagNamespaceRegisterEntry nsRegisterEntry)
   at System.Web.UI.BaseTemplateParser.ProcessDirective(String directiveName, IDictionary directive)
   at System.Web.UI.TemplateControlParser.ProcessDirective(String directiveName, IDictionary directive)
   at System.Web.UI.PageParser.ProcessDirective(String directiveName, IDictionary directive)
   at System.Web.UI.TemplateParser.ParseStringInternal(String text, Encoding fileEncoding)
TargetSite : System.Reflection.RuntimeAssembly _nLoad(System.Reflection.AssemblyName, System.String, System.Security.Policy.Evidence, System.Reflection.RuntimeAssembly, System.Threading.StackCrawlMark ByRef, Boolean, Boolean, Boolean)

Apr 17, 2012 at 1:07 PM
Edited Apr 17, 2012 at 1:22 PM

 

ditd_reg1.aspx is working, there is nothing in logger.text for join.aspx, I think it may be in the  may be in this code.
Also maybe it takes some time for the logger.text to update.
<script runat="server">  

    private string CreateRow(string label, string value)
    {
        return string.Format(
            "<tr><td><b>{0}</b></td><td>{1}</td></tr>",
            HttpUtility.HtmlEncode(label),
            HttpUtility.HtmlEncode(value));
    }    

    protected void Button1_Click(object sender, EventArgs e)
    {
        using (MailMessage mail = new MailMessage())
        {
            mail.From = new MailAddress(BlogSettings.Instance.Email);

            mail.To.Add("treasurer@tftm.org");
            mail.To.Add("membership@tftm.org");
            mail.To.Add("etracks@me.com");
            
            if (Utils.IsEmailValid(Email.Text))
	        mail.To.Add(Email.Text.Trim());
                        
            mail.Subject =Last_name.Text;

            StringBuilder sb = new StringBuilder();
            sb.Append("<table border=\"1\" cellpadding=\"5\">");

            sb.Append(CreateRow("Submitted First Name", First_name.Text));
            sb.Append(CreateRow("Submitted Last Name", Last_name.Text));
            sb.Append(CreateRow("Submitted Street", Street.Text));
            sb.Append(CreateRow("Submitted City", City.Text));
            sb.Append(CreateRow("Submitted State", State.Text));
            sb.Append(CreateRow("Submitted Zip", Zip.Text));
            sb.Append(CreateRow("Submitted Phone", Phone.Text));
            sb.Append(CreateRow("Submitted Email", Email.Text));
            sb.Append(CreateRow("Submitted Single", Single.Text));
            sb.Append(CreateRow("Submitted Family", Family.Text));
            sb.Append(CreateRow("Submitted Donor", Donor.Text));
            sb.Append(CreateRow("Submitted Sponser", Sponser.Text));
            sb.Append(CreateRow("Submitted Renewal", Renewal.Text));
            sb.Append(CreateRow("Submitted Address_change", Address_change.Text));
            sb.Append(CreateRow("Submitted Performers", Performers.Text));
            sb.Append(CreateRow("Submitted Membership directory", Membership_directory.Text));
            sb.Append(CreateRow("Submitted Concerts volunteer", Concerts_volunteer.Text));
            sb.Append(CreateRow("Submitted Dances volunteer", Dances_volunteer.Text));
            
                                       
            
            
            sb.Append("</table>");

            mail.IsBodyHtml = true;
            mail.Body = sb.ToString();

            string errorMessage = Utils.SendMailMessage(mail);
            if (string.IsNullOrEmpty(errorMessage))
            {
                // success
                Response.Redirect("http://tftm.org/page/Form-confirmation.aspx");
            }
            else
            {
                Response.Write("An error occurred sending the email.  Error: " + errorMessage);
            }
        }
        
    }

    </script>
I removed the code above and still will not load, guess maybe I should build the page again from scratch. Still nothing in logger.text for join.aspx.
Apr 17, 2012 at 1:58 PM

Thanks for helping me to help myself Ben, I rebuilt the page a step at a time and it is working on the server and the mail code you helped me with awhile back is working fine with this form, of course I copied, pasted and then applied it to the fields on the form.

Thanks again for your help, BE rocks!

Coordinator
Apr 18, 2012 at 8:19 AM

Glad you figured it out, and thanks for letting me know ... so I don't unnecessarily look into it.