We use exstensive forms for user feedback on out umbraco site. Here is how we do it. (I'll try to write up something a bit more detailed when I get a chance.)
First We create the database table to hold the stored data. We just createt he tables directly in the Umbraco database and prefix them all with "Form" to identify them.
Next I create a LINQ to SQL model in a .Net Class Library(Visual Studio Web Developer 2010 Express, Create a Class Library Project.)
In this object you can navigate to the database table and drag it into the data model. This will build all the DBA code you will need.
Note that to ensure your connecting to the correct databse the connection string will need to be set int he code, I do this with a helper calss and use the umbracoDbDSN setting to simplify things.
Next compile this library and copy the resulting dll over to your umbraco install.
At this point you will be able to save(and read) data from the table we have linked.
I build the web form in a macro with normal HTML markup. You could use .NET USer Controls if you prefer
To do the save logic I use the Umbraco Base subsystem witch allows for simple ajax/lightweight backend code. You could however create the entire form as a User Contol that does a PostBack and contains the save code itself.
Furthermore the /Base calls sent out notification emails and other triggered processes.
We also have added a Data section to the Umbraco backend that lists all the custom tables and lets the managers view and edit the data. This portion is accomplished with User Contols for each table that containd a DataGid. Simple but effective.
Save and get data from database
Hay, I create form from ths website: http://www.diplo.co.uk/blog/2012/5/24/creating-an-umbraco-form-using-pure-razor.aspx
And I have question how to save data from ths form to database and how its get in Razor?
Umbraco have maybe Linq to database?
I use Umbraco 4.11.1
We use exstensive forms for user feedback on out umbraco site. Here is how we do it. (I'll try to write up something a bit more detailed when I get a chance.)
Once you have a LINQ model you can display datime form a macro very simply. Here is a same bit that I use to display a state dropdown.
Macro
View Model in the class library.
is working on a reply...