Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • sravani 50 posts 70 karma points
    Jun 06, 2011 @ 15:23
    sravani
    0

    dotnet user control.

    Dear All,

    when am trying to run the usercontrol asa macro in umbarco i got this error 

    Error creating control (usercontrols/ContactUs.ascx).
    Maybe file doesn't exists or the usercontrol has a cache directive, which is not allowed! See the tracestack for more information!

    pls any idea??? very urgent :(

    Thanks in advance...

    Regards,

    Sravani

  • Tom Fulton 2030 posts 4998 karma points c-trib
    Jun 06, 2011 @ 15:41
    Tom Fulton
    0

    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

  • sravani 50 posts 70 karma points
    Jun 06, 2011 @ 16:37
    sravani
    0

    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)

     

  • Tom Fulton 2030 posts 4998 karma points c-trib
    Jun 06, 2011 @ 16:40
    Tom Fulton
    0

    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

  • sravani 50 posts 70 karma points
    Jun 06, 2011 @ 16:40
    sravani
    0

    Hi again,

    my ascx page is

         <div style="heightautowidthautomargin-left30px;">
                    <div style="margin-top33pxwidth568px;">
                        <a>If you have a question you want to ask us, simply fill in the form below:</a>
                    </div>
                    <div style="margin-top21pxwidth241px;">
                        <asp:DropDownList ID="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>
                    <div style="margin-top24pxwidth600px;">
                        <div>
                            <asp:TextBox ID="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:RequiredFieldValidator ValidationGroup="cf1" EnableClientScript="true" ControlToValidate="txtName"
                                    runat="server" ErrorMessage="Name required" ID="Requiredfieldvalidator3">&nbsp;</asp:RequiredFieldValidator><asp:CustomValidator
                                        ValidationGroup="cf1" ID="cvdGeneral" runat="server" ErrorMessage="There is a problem with the service. Please use the contact number at the top of the page.">&nbsp;</asp:CustomValidator>
                            </div>
                        </div>
                    </div>
                    <div style="margin-top24pxwidth600px;">
                        <div>
                            <asp:TextBox ID="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>
                    <div style="margin-top24pxwidth600px;">
                        <div>
                            <asp:TextBox ID="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>
                    <div style="margin-top24pxwidth600px;">
                        <div>
                            <asp:TextBox ID="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:RequiredFieldValidator ValidationGroup="cf1" EnableClientScript="true" ControlToValidate="TextBox3"
                                runat="server" ErrorMessage="required" ID="Requiredfieldvalidator1">&nbsp;</asp:RequiredFieldValidator>
                        </div>
                    </div>
                    <div style="margin-top24pxwidth600pxheight233px;">
                        <div>
                            <asp:TextBox ID="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:RequiredFieldValidator ValidationGroup="cf1"
                                    EnableClientScript="true" ControlToValidate="txtEmail" runat="server" ErrorMessage="required"
                                    ID="rfvEmail">&nbsp;</asp:RequiredFieldValidator><asp:RegularExpressionValidator
                                        ID="revEmail" ControlToValidate="txtEmail" EnableClientScript="true" runat="server"
                                        ValidationGroup="cf1" ValidationExpression="[\w\-|_\.]+[\w\-|_]+@[\w\-|_\.]+\.\w{2,3}"
                                        ErrorMessage="Format email address correctly">&nbsp;</asp:RegularExpressionValidator>
                        </div>
                        <div>
                            <div style="margin-top21pxwidth592pxheight44px;">
                                <asp:DropDownList ID="ddlCountry" runat="server" CssClass="dropdown">
                                    <asp:ListItem Value="" Selected="true">Select Country</asp:ListItem>
                                    <asp:ListItem Value="AF">Afghanistan</asp:ListItem>
                                    <asp:ListItem Value="AL">Albania</asp:ListItem>
                                    <asp:ListItem Value="DZ">Algeria</asp:ListItem>
                                    <asp:ListItem Value="AS">American Samoa</asp:ListItem>
                                                                  
                                </asp:DropDownList>
                                <asp:RequiredFieldValidator ValidationGroup="cf1" EnableClientScript="true" ControlToValidate="ddlCountry"
                                    runat="server" ErrorMessage="required" ID="Requiredfieldvalidator4">&nbsp;</asp:RequiredFieldValidator>
                            </div>
                            <div style="margin-top21pxwidth377pxheight116px;">
                                <asp:TextBox ID="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>
                            <div style="margin-left292pxmargin-top21pxheight29pxwidth275px;">
                                <asp:Button ID="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
    {
        public partial class ContactUs : System.Web.UI.UserControl
        {
            protected void Page_Load(object sender, EventArgs e)
            {
                SendMailMessage("[email protected]""[email protected]""[email protected]""[email protected]""Hello""Hello SRTHSRFTGhFRTGjhnftn RTDHBXDFNY RFTGHBFHN");
    
            }
    
    
    
    
    
            public static void SendMailMessage(string from, string to, string bcc, string cc, string subject, string body)
            {
    
                MailMessage mMailMessage = new MailMessage();
    
    
                mMailMessage.From = new MailAddress(from);
    
                mMailMessage.To.Add(new MailAddress(to));
    
                if ((bcc != null) && (bcc != string.Empty))
                {
                    // Set the Bcc address of the mail message
                    mMailMessage.Bcc.Add(new MailAddress(bcc));
                }
    
                // Check if the cc value is null or an empty value
                if ((cc != null) && (cc != string.Empty))
                {
                    // Set the CC address of the mail message
                    mMailMessage.CC.Add(new MailAddress(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 SmtpClient
                SmtpClient mSmtpClient = new SmtpClient();
                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 
    Can i miss any thing????

  • sravani 50 posts 70 karma points
    Jun 06, 2011 @ 16:42
    sravani
    0

    Thanks Tom,

    I got is working now...

    Thanks a lot..

Please Sign in or register to post replies

Write your reply to:

Draft