November Happy Hour will be moved to Thursday December 5th.

how to get XForm Heading property for a Field in EPiserver 7 MVC

Vote:
 

I using EPiServer MVC 7. I am using the XForm and when user type in the value I generate the mail not Xform but in my code. I use the Name property to get the key and value and print this on my mail. e.g. if key = CustomerName and value = Peter

then its prints as CusturName Peter etc.

Mine is swedish site and I need to enter swedish character as Key but Xform does not take special characters. Then I thought I could use Heading property but I dont see any api to get the same. Can you help me providing some alternative solution on this.

#71555
May 22, 2013 14:11
Vote:
 

You could try going through the list of HtmlFragments in the form. Something like this:

var fragments = currentPage.Form.CreateHtmlFragments();
foreach (dynamic fragment in fragments.Where(f => f is XFormsFragment))
{
    var label = fragment.Label;
}

    

#71594
May 23, 2013 17:27
Vote:
 

what is currentPage Here?  PageData.. I can't get the Form property in it.. Thanks

#72369
Jun 14, 2013 11:54
Vote:
 

currentPage is your strongly-typed page type model that's passed as a parameter in your controller. The Form property is just an XForm property in the model.

#72370
Jun 14, 2013 12:08
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.