Add Prefix

Jan 8, 2009 at 2:54 AM
Hi,

How can I add prefix to the form input element names so the data posted for all inputs will be prefixed.
I want the posted data to be "data.Name=Dima&data.IsActive=true" instead of "Name=Dima&IsActive=true".

I expected to write something like:
Html.XForm<Customer>(""data", data)
or
Html.XForm<Screen>(data).Prefix("data")

I don't see any option for that in Html.XForm<Customer>(data) for that.

So how can I do that for all elements?
Coordinator
Jan 23, 2009 at 4:37 PM
Hi dnagir,

You can do this if you set the FullID of the form:

<% Html.XForm<Customer>(data).Form(form => { %>
<% form.FullID = "data"; %>

It's a bit of a hack; there really should be a setting on the form as you suggest.

Cheers,
Jon