System.Web.HttpCompileException
(0x80004005):
c:\Users\speddi\Desktop\newglobal\OnepointGlobal\OnepointGlobal\usercontrols\ContactUs.ascx(461):
error CS1061: 'ASP.usercontrols_contactus_ascx' does not contain a definition
for 'Button1_click' and no extension method 'Button1_click' accepting a first
argument of type 'ASP.usercontrols_contactus_ascx' could be found (are you
missing a using directive or an assembly reference?) at
System.Web.Compilation.AssemblyBuilder.Compile() 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.GetVPathBuildResult(HttpContext context,
VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean
allowBuildInPrecompile, Boolean ensureIsUpToDate) at
System.Web.UI.TemplateControl.LoadControl(VirtualPath virtualPath) at
System.Web.UI.TemplateControl.LoadControl(String virtualPath) at
umbraco.developer.assemblyBrowser.Page_Load(Object sender, EventArgs e)
<divstyle="height: auto; width: auto; margin-left: 30px;"><divstyle="margin-top: 33px; width: 568px;"><a>If you have a question you want to ask us, simply fill in the form below:</a></div><divstyle="margin-top: 21px; width: 241px;"><asp:DropDownListID="DropDownList1"runat="server"CssClass="dropdown"><asp:ListItem>Mr</asp:ListItem><asp:ListItem>Mrs</asp:ListItem><asp:ListItem>Ms</asp:ListItem><asp:ListItem>Miss</asp:ListItem><asp:ListItem>Doctor</asp:ListItem><asp:ListItem>Other</asp:ListItem></asp:DropDownList></div><divstyle="margin-top: 24px; width: 600px;"><div><asp:TextBoxID="txtName"runat="server"TabIndex="2"onfocus="Focus(this.id,'Name')"Width="239px"onblur="Blur(this.id,'Name')"Text="Name"meta:resourcekey="txtPassWordResource1"AutoCompleteType="None"></asp:TextBox><div><asp:RequiredFieldValidatorValidationGroup="cf1"EnableClientScript="true"ControlToValidate="txtName"runat="server"ErrorMessage="Name required"ID="Requiredfieldvalidator3"> </asp:RequiredFieldValidator><asp:CustomValidatorValidationGroup="cf1"ID="cvdGeneral"runat="server"ErrorMessage="There is a problem with the service. Please use the contact number at the top of the page."> </asp:CustomValidator></div></div></div><divstyle="margin-top: 24px; width: 600px;"><div><asp:TextBoxID="TextBox1"runat="server"TabIndex="2"onfocus="Focus(this.id,'Position')"Width="239px"onblur="Blur(this.id,'Position')"Text="Position"meta:resourcekey="txtPassWordResource1"AutoCompleteType="None"></asp:TextBox></div></div><divstyle="margin-top: 24px; width: 600px;"><div><asp:TextBoxID="TextBox2"runat="server"TabIndex="2"onfocus="Focus(this.id,'Organisation')"Width="239px"onblur="Blur(this.id,'Organisation')"Text="Organisation"meta:resourcekey="txtPassWordResource1"AutoCompleteType="None"></asp:TextBox></div><div></div></div><divstyle="margin-top: 24px; width: 600px;"><div><asp:TextBoxID="TextBox3"runat="server"TabIndex="2"onfocus="Focus(this.id,'Phone')"Width="239px"onblur="Blur(this.id,'Phone')"Text="Phone"meta:resourcekey="txtPassWordResource1"AutoCompleteType="None"></asp:TextBox><asp:RequiredFieldValidatorValidationGroup="cf1"EnableClientScript="true"ControlToValidate="TextBox3"runat="server"ErrorMessage="required"ID="Requiredfieldvalidator1"> </asp:RequiredFieldValidator></div></div><divstyle="margin-top: 24px; width: 600px; height: 233px;"><div><asp:TextBoxID="txtEmail"runat="server"TabIndex="2"onfocus="Focus(this.id,'Email Address')"Width="239px"onblur="Blur(this.id,'Email Address')"Text="Email Address"meta:resourcekey="txtPassWordResource1"AutoCompleteType="None"></asp:TextBox><asp:RequiredFieldValidatorValidationGroup="cf1"EnableClientScript="true"ControlToValidate="txtEmail"runat="server"ErrorMessage="required"ID="rfvEmail"> </asp:RequiredFieldValidator><asp:RegularExpressionValidatorID="revEmail"ControlToValidate="txtEmail"EnableClientScript="true"runat="server"ValidationGroup="cf1"ValidationExpression="[\w\-|_\.]+[\w\-|_]+@[\w\-|_\.]+\.\w{2,3}"ErrorMessage="Format email address correctly"> </asp:RegularExpressionValidator></div><div><divstyle="margin-top: 21px; width: 592px; height: 44px;"><asp:DropDownListID="ddlCountry"runat="server"CssClass="dropdown"><asp:ListItemValue=""Selected="true">Select Country</asp:ListItem><asp:ListItemValue="AF">Afghanistan</asp:ListItem><asp:ListItemValue="AL">Albania</asp:ListItem><asp:ListItemValue="DZ">Algeria</asp:ListItem><asp:ListItemValue="AS">American Samoa</asp:ListItem></asp:DropDownList><asp:RequiredFieldValidatorValidationGroup="cf1"EnableClientScript="true"ControlToValidate="ddlCountry"runat="server"ErrorMessage="required"ID="Requiredfieldvalidator4"> </asp:RequiredFieldValidator></div><divstyle="margin-top: 21px; width: 377px; height: 116px;"><asp:TextBoxID="Textbox5"runat="server"MaxLength="250"TextMode="MultiLine"Height="118px"Width="376px"onfocus="Focus(this.id,'Comments')"onblur="Blur(this.id,'Comments')"Text="Comments"meta:resourcekey="txtPassWordResource1"AutoCompleteType="None"></asp:TextBox></div><divstyle="margin-left: 292px; margin-top: 21px; height: 29px; width: 275px;"><asp:ButtonID="Button1"runat="server"Text="Button"Width="109px"OnClick="Button1_click"/><%--
</a> Put button
<%-- <asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="Button" />--%></div></div></div></div>
cs file is
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Net;
using System.Net.Mail;
namespace global
{
publicpartialclassContactUs : System.Web.UI.UserControl
{
protectedvoid Page_Load(object sender, EventArgs e)
{
SendMailMessage("[email protected]", "[email protected]", "[email protected]", "[email protected]", "Hello", "Hello SRTHSRFTGhFRTGjhnftn RTDHBXDFNY RFTGHBFHN");
}
publicstaticvoid SendMailMessage(string from, string to, string bcc, string cc, string subject, string body)
{
MailMessage mMailMessage = newMailMessage();
mMailMessage.From = newMailAddress(from);
mMailMessage.To.Add(newMailAddress(to));
if ((bcc != null) && (bcc != string.Empty))
{
// Set the Bcc address of the mail message
mMailMessage.Bcc.Add(newMailAddress(bcc));
}
// Check if the cc value is null or an empty valueif ((cc != null) && (cc != string.Empty))
{
// Set the CC address of the mail message
mMailMessage.CC.Add(newMailAddress(cc));
} // Set the subject of the mail message
mMailMessage.Subject = subject;
// Set the body of the mail message
mMailMessage.Body = body;
// Set the format of the mail message body as HTML
mMailMessage.IsBodyHtml = true;
// Set the priority of the mail message to normal
mMailMessage.Priority = MailPriority.Normal;
// Instantiate a new instance of SmtpClientSmtpClient mSmtpClient = newSmtpClient();
mSmtpClient.Host = "10.0.44.30";
// Send the mail message
mSmtpClient.Send(mMailMessage);
}
}
}
I just build the solution and copy the ascx page into usercontrol and dll into bin and create macro and insert it in my template
dotnet user control.
Dear All,
when am trying to run the usercontrol asa macro in umbarco i got this error
pls any idea??? very urgent :(
Thanks in advance...
Regards,
Sravani
Hi,
If you goto the Macro and click the Browse Properties button it should give you the "real" error, which should lead you in the right direction.
Hope this helps,
Tom
Thanks Tom,
this is error
System.Web.HttpCompileException (0x80004005): c:\Users\speddi\Desktop\newglobal\OnepointGlobal\OnepointGlobal\usercontrols\ContactUs.ascx(461): error CS1061: 'ASP.usercontrols_contactus_ascx' does not contain a definition for 'Button1_click' and no extension method 'Button1_click' accepting a first argument of type 'ASP.usercontrols_contactus_ascx' could be found (are you missing a using directive or an assembly reference?) at System.Web.Compilation.AssemblyBuilder.Compile() 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.GetVPathBuildResult(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean ensureIsUpToDate) at System.Web.UI.TemplateControl.LoadControl(VirtualPath virtualPath) at System.Web.UI.TemplateControl.LoadControl(String virtualPath) at umbraco.developer.assemblyBrowser.Page_Load(Object sender, EventArgs e)
At first glance it looks like you might have a <asp:Button with an OnClick event set to "Button1_click" that doesn't exist in the .CS file?
Or did you perhaps forget to copy over the .DLL file also?
-Tom
Hi again,
my ascx page is
cs file is
Thanks Tom,
I got is working now...
Thanks a lot..
is working on a reply...