Copied to clipboard

Flag this post as spam?

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


  • thanhtien501 28 posts 48 karma points
    Nov 18, 2010 @ 08:36
    thanhtien501
    0

    create a macro using the .NET user control

    Dear all

    Im sorry if i put this question in the wrong place because i don't know where can i put this question.

    I want to use the .net  user control in my macro ( instead of using the xslt file)

    I read an article :http://our.umbraco.org/forum/developers/api-questions/5797-Contact-Form

    and after that i do the following:

    + I write a user control (using the visual studio ) . get the binay (.dll files ) as well as the .ascx file.

    +Put the *.dll in bin folder into the bin folder of the installed umbraco.

    +Put the .ascx file into the usercontrols folder of the isntalled umbraco

    Create a macro  and browser to the ascx file

    Use the macro in the master page

    <umbraco:Macro ID="Macro5" Alias=" My.TestMacro"  runat="server"></umbraco:Macro>


    But there is nothing occur.

    Please help me.

    Thank you for your patience.

     

  • Eduardo 106 posts 130 karma points
    Nov 18, 2010 @ 08:48
    Eduardo
    0

    Hi thantien,

    Sounds weird!

    Is the alias value well written?

    Are you using a Web Deplyment project?

    Could you post the ascx code?

    I need more information...

    Sincere regards,
    Eduardo

  • thanhtien501 28 posts 48 karma points
    Nov 18, 2010 @ 09:09
    thanhtien501
    0

    hi  karma

    I use build--> public website  (visual studio 2008 because i use umbraco 4.6.0 alpha) -->  copy the *.dll in bin folder  and the .ascx file

    My user control is very simple:

    the is only 1 button (named button1 )and 1 label ( named label1)

    the code

    public partial class BIDCContactForm : System.Web.UI.UserControl
    {
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void Button1_Click(object sender, EventArgs e)
    {
    Label1.Text = "Hello you";
    }
    }

     

     

  • Eduardo 106 posts 130 karma points
    Nov 18, 2010 @ 09:21
    Eduardo
    0

    Hi thantien,

    Maybe the macro Alias is misspelled.

    <umbraco:Macro ID="Macro5" Alias=" My.TestMacro"  runat="server">umbraco:Macro>

    Use another Alias name like 'MyTestMacro':

    <umbraco:Macro ID="Macro5" Alias="MyTestMacro"  runat="server">umbraco:Macro>

    Also, take a look at the WIndows Event Viewer.

    HTH

    Regards,
    Eduardo

  • Richard Soeteman 3875 posts 12037 karma points MVP
    Nov 18, 2010 @ 09:50
    Richard Soeteman
    0

    Hi,

    Goto your page and use the the querystring ?umbdebugshowtrace=true

    This will show the complete stack trace including information what is wrong.

    Cheers,

    Richard

  • thanhtien501 28 posts 48 karma points
    Nov 18, 2010 @ 10:10
    thanhtien501
    0

    Hi  , I change the alias of the macro and after that it works. look strange,

    thank all of you so much

     

  • Eduardo 106 posts 130 karma points
    Nov 18, 2010 @ 10:26
    Eduardo
    0

    Hi than,

    You are welcome.

    Sincere regards,
    Eduardo

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies