Hello!
I'm creating my custom FormSave Provider and everything looks ok, the problems are when the form is finished and send a Template.
private void PrintTags(string TextToPrint, MsgType TextType)
{
Dynamicweb.Templatev2.Template template = new Dynamicweb.Templatev2.Template(Template);
switch (TextType)
{
case MsgType.Error:
template.SetTag("Registration.Error.Description", TextToPrint);
break;
case MsgType.OK:
template.SetTag("Registration.OK.Description", TextToPrint);
break;
}
HttpContext.Current.Response.Write(template.Output());
}
I'm sending a template with the necessary tags, but nothing happens.
Another problem is the return answer for the method "Save" inside of the FormSave Provider, even returning False the form is saved.
I found this code in other FormSave Provider for return the web site when something is wrong:
HttpContext.Current.Response.Write(String.Format("<script>alert('Email address: \'{0}\' is invalid.');history.back(-1);</script>", mailAddress))
Is this the only way to go back? using javascript.
Thank you!