I have created a user control (*.ascx) file, its very simple just to test my theory before creating the entire form. It is simply 2 different aspx:Text box (firstname and surname), a button and some code that emails the information entered to the client (I tried Contour but I couldnt skin it as the client wants it - probably my CSS limitation).
The ascx looks like so...
Having copied the DLL and ascx file, I created a macro - that just references the control...
I then insert the macro into my content and it renders it exactly as I'd expect...
Then something unexpected happens (at least unexpected to me), when I save it... the aspx:text boxes and button disapear. If I view the HTML thay are also missing from it... Clearly when I view it then, there are two labels but no fields or buttons.
I cant work out why my fields disappear. Any pointers?
It's probably just to do with the macro rendering in the WYSIWYG editor. That is very limited in how it works as it has to run in-proc to generate the HTML to return.
I turn off the WYSIWYG editor rendering of macros because:
It'll reduce overhead of loading the WYSIWYG
It doesn't give editors a false impression that they can interact with the macro from the backoffice
Also, you don't have to insert into the rich text editor, you can also use macro's in your templates (master page), unless you really need editors to be able to insert the form at some pages.
+1 for @slace his comments, you better use the MacroContainer picker in 4.5.2, but since you are on 4.0.2.1 You can use the MacroPicker package I wrote ages ago so you don't need to use the macro functionality in the WYSIWYG edito.
.Net User Controls
Hi all,
My dev system is.. Umbraco 4.0.2.1, VS2.5
I have created a user control (*.ascx) file, its very simple just to test my theory before creating the entire form. It is simply 2 different aspx:Text box (firstname and surname), a button and some code that emails the information entered to the client (I tried Contour but I couldnt skin it as the client wants it - probably my CSS limitation).
The ascx looks like so...
Having copied the DLL and ascx file, I created a macro - that just references the control...
I then insert the macro into my content and it renders it exactly as I'd expect...
Then something unexpected happens (at least unexpected to me), when I save it... the aspx:text boxes and button disapear. If I view the HTML thay are also missing from it... Clearly when I view it then, there are two labels but no fields or buttons.
I cant work out why my fields disappear. Any pointers?
Many thanks in advance
Tony
It's probably just to do with the macro rendering in the WYSIWYG editor. That is very limited in how it works as it has to run in-proc to generate the HTML to return.
I turn off the WYSIWYG editor rendering of macros because:
Also, you don't have to insert into the rich text editor, you can also use macro's in your templates (master page), unless you really need editors to be able to insert the form at some pages.
HI Tony,
+1 for @slace his comments, you better use the MacroContainer picker in 4.5.2, but since you are on 4.0.2.1 You can use the MacroPicker package I wrote ages ago so you don't need to use the macro functionality in the WYSIWYG edito.
Cheers,
Richard
Slace - You got it! Turning the rendering off fixed it. Many thanks.
Sebastian - Good point and I guess it makes it less likely the editors will break anything
Thanks Umbraco world
Tony
is working on a reply...