Just add a submit button to your form. On the properties for that button, you are able to set wether it should post to email, post to email and store in database or store in database.
Select "Store in database", and you will get a "Form data" tab in your edit mode where you can find all posted data.
Thanks for the reply!
I am doing the same.How do i came to know in which table the values get stores.Like if i want to create new table and want to store xform values inside it then what to do???
You can either attach a event on the xforms-page when saving the form and save it to yout own table. You could also tell the XForm (in edit mode) to send the input parameters to another page, where you could take care of the input.
and you can also just save the data in the EPi-DB table for the xforms as built-in, and programmatically use that table-data later to pick out any saved data from, very handy when you for example have courses people register to attend, you can first check how many persons are already booked and only show/enable-save-button the form if there are free spots to take. So each Xform becomes a data table virtually spoken :-)
Thanks for the reply.
Their is one thing ,I want to know ,suppose I selected save to database in my XForm onclick button , then in which table the content get stored.Lets consider its an Episerver database, I just created an XForm with save to databas eoption.Then how episerver came to know in which table this data should stored.I have installed the demo site for episerver (Alloy technologies)inside it their is an Contact Form . On hit of the submit button , content is saved somewhere but where?????
There's a new line in tblItem for each time a form is posted. (Name column contains xformdata_<GUID>) Not that there's anything useful to do with the data.
As mentioned above, the best way is to programatically use the API to access the forms and fetch/change/post data.
So yoy mean to say their is no specific table in the database.
You will not find you fields mapped to columns in a database no. It is stored as binary serialized objects. If you want data stored in database tables, you could handle the BeforeSubmitPostedData and store the data in your own table.
I'm not sure what your requirements are, but I would recommend working with the API to access your xform data.
Remember EPiServer 6 uses the Dynamic Data Store to save xform data so it is theoretically accessible with a direct query on the database. However I'd advice using LINQ over the xforms store to get hold of the data. There is a good post by Linus Ekström explaining it here:
Thanks for the reply. I am trying to get the form values in the BeforesubmittedPostedData function. My form consist of two fields only one is name and other is info. But in this function ,I am getting none of them.
nither formData.info,nor formdata.name.
control.Data.GetValue("name") will give you the value of the textbox called name
public void XForm_AfterSubmitPostedData(object sender, SaveFormDataEventArgs e)
XFormControl control = (XFormControl)sender;
var name = control.Data.GetValue("name");
Thanks for the reply.I got both the values now in my page. Now I want to send this data in my externalDatabase not inside the episerver database.How do I connect to external database in episerver.
Do just like you would do in any .NET application, there aren't (not to my knowledge) any special helpers for performing tasks in other databases in EPiServer.
Edit: Sorry to cut the line before you there Lars Øyvind, your answer was much more helpful :)
There's no EPiServer magic, use regular .Net code.
SqlConnection connection = new SqlConnection("your connectionstring");connection.Open();
Ahhhh. And refresh the page before posting answers :-D (You were too fast Magnus)
Thanks for the reply. ...............:)
I am new learner of Episerver.I am trying to create the XForm in Episerver (Contact Us Form) I have created form and its also showing up in my page. How to I send the data which is filled in my form to any database.