Class Frontend
- Namespace
- Dynamicweb.Forms
- Assembly
- Dynamicweb.Forms.dll
Class Frontend.
[AddInName("BasicForms")]
public class Frontend : ContentModule, IModule
- Inheritance
-
Frontend
- Implements
- Inherited Members
Methods
CreateMailMessage(string, string, string, string, string, string, string, string)
Creates the mail message.
public MailMessage CreateMailMessage(string subject, string body, string fromName, string fromEmail, string to, string cc, string bcc, string replyto)
Parameters
subject
stringThe subject.
body
stringThe body.
fromName
stringFrom na
fromEmail
stringFrom email.
to
stringTo.
cc
stringThe cc.
bcc
stringThe BCC.
replyto
string
Returns
- MailMessage
System.Net.Mail.MailMessage.
GetMaxSubmit()
Gets the maximum submit.
public int GetMaxSubmit()
Returns
- int
System.Int32.
GetModuleContent()
Override this method and return the HTML output for the module.
public override OutputResult GetModuleContent()
Returns
- OutputResult
Must return the markup that renders the module.
Examples
using Dynamicweb.Extensibility.AddIns;
using Dynamicweb.Modules;
namespace Dynamicweb.Examples
{
[AddInName("ModuleSystemName")]
public class ContentModuleSample : ContentModule
{
public override string GetContent()
{
//Get an instance of a template object
var template = new Dynamicweb.Rendering.Template("ModuleSystemName/Template.cshtml");
//Set a tag named "Text" with the value from the HelloText property
template.SetTag("Text", Properties.Values["HelloText"].ToString());
//Add the page id executing the page with the paragraph where this module is attached
template.SetTag("PageID", this.Pageview.ID);
//Return the parsed template to the event handler
return template.Output();
}
}
}
Remarks
The markup returned is what is inserted into the template tag ParagraphModule
in the paragraph template.
GetSubmitCount()
Gets the submit count.
public int GetSubmitCount()
Returns
- int
System.Int32.
HandleMaxSubmitCountAction()
public OutputResult HandleMaxSubmitCountAction()
Returns
MaxSubmitsReached(Form)
Checks the submit count.
public bool MaxSubmitsReached(Form form)
Parameters
form
Form
Returns
RenderForm()
Renders the form.
public OutputResult RenderForm()
Returns
- OutputResult
System.String.
RenderMail(Submit)
Renders the form mail (website owner) to the Forms/Mail/*.cshtml|HTML template.
public string RenderMail(Submit submit)
Parameters
submit
SubmitThe submitted data to render to the mail template.
Returns
- string
A string of email body in HTML.
RenderMailTemplate(Template, Submit)
Renders the receipt template.
public void RenderMailTemplate(Template template, Submit submit)
Parameters
RenderReceipt()
Renders the receipt.
public string RenderReceipt()
Returns
- string
System.String.
RenderReceiptMail(Submit)
Renders the receipt mail to the Forms/Mail/*.cshtml|HTML template.
public string RenderReceiptMail(Submit submit)
Parameters
submit
SubmitThe submitted data to render to the mail template.
Returns
- string
A string of email body in HTML.
RenderReceiptTemplate(Template, Submit)
Renders the receipt template.
public void RenderReceiptTemplate(Template template, Submit submit)
Parameters
SaveForm()
Saves the form.
public OutputResult SaveForm()
Returns
- OutputResult
System.String.
SaveFormFiles(Field)
Saves the files submitted with a form.
public string SaveFormFiles(Field currentField)
Parameters
currentField
FieldThe file upload field.
Returns
- string
System.String.
SendMail(Submit)
Sends the mail.
public void SendMail(Submit submit)
Parameters
submit
SubmitThe s.
SendReceiptMail(Submit)
Sends the receipt mail.
public void SendReceiptMail(Submit submit)
Parameters
submit
SubmitThe s.