How to pass a dictionary item into a Macro??? Options
chimnit
Posted: Friday, February 22, 2008 5:56:19 PM
Rank: Devotee

Joined: 10/25/2007
Posts: 52
Hi everybody

I seem to experience an error when trying to pass a dictionary item into a Macro wrapping a .Net control. the following is the code I use in the template:

Code:
<?UMBRACO_GETITEM field="BodyText"/>
<?ASPNET_FORM>
<?UMBRACO_MACRO macroAlias="RequestForm"
HeaderBooking="[#FormHeaderBooking]"
HeaderTo="[#FormHeaderTo]"
HeaderName="[#FormHeaderName]"
HeaderAddress="[#FormHeaderAddress]"
HeaderPhone="[#FormHeaderPhone]"
HeaderMail="[#FormHeaderMail]"
HeaderRequest="[#FormHeaderRequest]"
HeaderComments="[#FormHeaderComments]"
SubmitText="[#SubmitText]"
RedirectId="1074"
RequestMailAddress="[#FormRequestMailAddress]"
RequestMailSubject="[#FormRequestMailSubject]"
RequestMailToAddress="[#FormRequestMailToAddress]"
WrongDateFormat="[#FormWrongDateFormat]"
WrongMailFormat="[#FormWrongMailFormat]"
WrongLastDate="[#FormWrongLastDate]"></?UMBRACO_MACRO>
</?ASPNET_FORM>


Can you see if I'm doing anythin wrong? Of course I have created the corresponding dictionary items, and I'm using umbraco 3.03 :o)

Thanks in advance.

Kind regards,

Kim Løwert
chimnit
Posted: Friday, February 22, 2008 5:58:18 PM
Rank: Devotee

Joined: 10/25/2007
Posts: 52
Oh, I forgot to say that my problem is, that the .Net control is only passed the [#Form...] string in stead of the actual dictionary item.

Am I doing anything wrong???

/Kim
tim
Posted: Saturday, February 23, 2008 11:04:38 AM

Rank: Addict

Joined: 2/19/2007
Posts: 564
Location: Belgium
Hey Kim,

Instead of passing the dictionary items you can acces the dictionary directly from your .net usercontrol. I'll post some code in a minute.

Cheers,
Tim

Umbraco tips and tricks: http://www.nibble.be - umbraco mvp 08/09 - certified level 1 & 2 professional
tim
Posted: Saturday, February 23, 2008 11:08:15 AM

Rank: Addict

Joined: 2/19/2007
Posts: 564
Location: Belgium
After referencing the right library ( I think it is umbraco.dll ) You can do this:

Code:

using umbraco;
.
.
.

litName.Text = umbraco.library.GetDictionaryItem("frmCompeteTitleName");




Umbraco tips and tricks: http://www.nibble.be - umbraco mvp 08/09 - certified level 1 & 2 professional
chimnit
Posted: Saturday, February 23, 2008 7:01:30 PM
Rank: Devotee

Joined: 10/25/2007
Posts: 52
Of course... Thanks ;o)

And of course it automatically returns the correct string based on the current language, right???

/Kim
Users browsing this topic
Guest


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.