Yes, i have added the parameter to the macro in umbraco as your screenshot shows. I use lowercase for alias and name though, could that have an effect?
I have tried both your suggestions but the result is the same, no value comes trough.
I really need to have this working yesterday, couldent i just put the parameter into a hidden field and then read it when i call the function? I just tested it using the value of the name field and that worked fine... gonna go try.
Problems expanding Contact page
Hello, i am trying to make the contact page from uBootstrap send mails with a subject that includes the querystring of the page.
I use the same method as is used to replace brackets in the message to replace a bracket in the subject field with the querystring.
I pass the querystring to the macro as a parameter via [@subject].
Now, the macro displays @Parameter.subject with no problem when i render the contact form, i cant get the parameter into the SendForm function.
Note: i have tried sending a hardcoded value to the function and this works fine.
Could i perhaps render the parameter into a hidden field in the form and get it like
string strSubject = Library.StripHtml(form.Subject).ToString();
If so, how?
please help... this is driving me nuts.
Hi Andreas,
Did you add the Parameter in Umbraco?
Hi Jorge,
Yes, i have added the parameter to the macro in umbraco as your screenshot shows.
I use lowercase for alias and name though, could that have an effect?
Hi Andreas,
I don't think lowercasing the parameter would cause that problem. Are you using Visual Studio? If so, you should be able to debug the razor view.
Anyway, there are two things you could try:
1) Remove the at symbol in
or 2) Change the helper method SendForm to
and add the parameter in the return
Hope this helps. J
Hi Jorge,
I have tried both your suggestions but the result is the same, no value comes trough.
I really need to have this working yesterday, couldent i just put the parameter into a hidden field and then read it when i call the function?
I just tested it using the value of the name field and that worked fine... gonna go try.
Thank Nonexistant God!
I finaly got it working by doing as i described above: rendering the value into the page and then stripping it back into the function as a parameter.
Still its strange that i can't get a macro parameter into functions in razor...
<div class="clearfix hide">
<div class="input">
<input class="xlarge" id="Subject" name="Subject" type="text" value="@Parameter.subject">
</div>
</div>
is working on a reply...