Dharmesh
Dharmesh

Reputation: 85

how to create form in umbraco with database connectivity?

I am new to umbraco and i want to create my own form for registration of user but i don't know how to connect my form with database or is there any other way to create forms in umbraco without paying.

Upvotes: 1

Views: 145

Answers (1)

Mivaweb
Mivaweb

Reputation: 5712

If you search the internet you will find tutorials about creating a form outside of umbraco by using a SurfaceController.

How to

The idea is that you create a controller like in MVC but instead of inheriting of the MVC controller you inherit from SurfaceController.

Why?

Because the SurfaceController is auto routed in umbraco and has access to the Umbraco Helper / Current page / Services like MemberService, ContentService, ...

After that you create a new model with the properties you need in your form.

Create a new Action method in your controller and view that represents the form.

After that you just call the action method and dislay the form on to your page.

Then you can create a new action post method to handle the form submit.

You can find a nice tutorial on Umbraco TV

You have to pay for a license but I found it a very interesting place when you just started with umbraco.

Upvotes: 3

Related Questions