Creating forms - how?

Jun 14, 2012 at 2:55 PM
Edited Jun 14, 2012 at 3:10 PM

I'm trying to convert an existing site to RazorC as a test. I can't figure out how to make my contact form work. It is a typical Razor C# form. It doesn't work in a widget or in the main body. Is it possible to do anything other than text, images, and media files in RazorC pages? Thanks.

Edit: I found the discussion at http://razorc.codeplex.com/discussions/352565 that gives the basics. However, RazorC won't let me put that widget in the main body where I need it - only in a section. How can I get a widget into the body?

Please forgive my ignorance. CMS software is a new concept to me and I'm still having trouble getting my mind around it.

Coordinator
Jun 14, 2012 at 3:35 PM
Edited Jun 14, 2012 at 3:35 PM

You can download free contact form and change it to your needs here http://www.razorc.net/ - go to add-ons

When you edit page you can disable "body" part of you site, and use zone below @RenderBody() to display any widget you want ex.

in demo layouts you will find:
@RenderBody()
@RenderSection("rcBottom",false )

so you an use body to render main text of your page and rcBottom to render contact form below that, or yo can disable body part and use rcBottom section to insert as many as you need widgets (contact forms, galleries, etc)

 

Take a look here http://glazeworks.us/gallery-stone STONE text uses body of the page and gallery below is inside rcBottom section

or here http://www.advancedbodylaser.com/testimonials the body is disabled and testimonials it is addon (with paging) inside the zone,  then below you have 2 more widgets inside that zone

Jun 14, 2012 at 3:56 PM
Edited Jun 14, 2012 at 4:05 PM

Thank you. I wrapped my form in the ARTICLE container tag that I normally use to format the body of the site and did what you suggested. Working now.

May 20, 2013 at 11:31 AM
I am also looking for creating custom forms. But I do not understand the method you suggest.

Can you please explore the custom form page creation in detail?

One more thing, can I add my razor code directly to the page creation body part?

Thanks
Coordinator
May 21, 2013 at 2:07 AM
pushpen

under _rcTemplates create page ex. _rcMyForm.cshtml (build it as you would any asp.net web page), if this will be form build one
Then you would be able to access it as template for new widget , so build widget based on it and use it in your page (take a look at files that are already under rcTemplates)

The other option would be to build addon - you can download free contact addon and see how it is done

"One more thing, can I add my razor code directly to the page creation body part? "
if you ask if you can mix html and razor code in the html editor (create/edit pages) - NO , the content of that is stored in db, so it would not work.