malaqui
-
5/5/2006 10:30:46 AM
Re: cmseditableRegion
Hello Peter, The page has 2 CMSEditableRegions.I want to recover the text of one of them to include its text in an email.
HTML code:
<%@ Register TagPrefix="cc1" Namespace="Kentico.CMS.CMSControls" Assembly="Kentico.CMS.CMSControls" %> <html> <head> .... </head> <body>
...
<cc1:cmseditableregion id="CMSEditableRegion2" runat="server" DialogHeight="1" DialogWidth="50" RegionType="TextBox" RegionTitle="Título de la página"></cc1:cmseditableregion>
<cc1:cmseditableregion id="CMSEditableRegion1" runat="server" DialogHeight="400" DialogWidth="500" RegionType="HtmlEditor" RegionTitle="Pregunta"></cc1:cmseditableregion>
...
</body> </html>
C# code
protected Kentico.CMS.CMSControls.CMSEditableRegion CMSEditableRegion2; protected Kentico.CMS.CMSControls.CMSEditableRegion CMSEditableRegion1;
....
private void BotEnviar_Click(object sender, System.EventArgs e) { SmtpMail.SmtpServer = ConfigurationSettings.AppSettings["CMSSMTPServer"]; System.Web.Mail.MailMessage msg = new System.Web.Mail.MailMessage(); msg.BodyFormat = MailFormat.Html; msg.From = "Anonimo"; msg.To = ConfigurationSettings.AppSettings["Opinion.Receptor"]; msg.Subject = "Premiamos su opinión"; msg.Body = "<b>" + "PREGUNTA:" + "</b>" + "<br>" + CMSEditableRegion1.Value + "<br>" + "<b>" + "RESPUESTA:" + "</b>" + "<br>" + txtMensaje.Text + "<br>" ; SmtpMail.Send(msg); }
I have created the template and the web page in the Kentico Administration Interface.
When I execute the code, mValue has the text that I have inserted in the CMSEditableRegion, but CMSEditableRegion1.Value is "". And I can´t recover the text. In the first time I thought that the problem that the type HTmlEditor of the CMSEditableRegion Control. But I have tried to recover the text of the TextBox CMSEditableRegion and I have the same problem. What is the wrong thing?
Regards
|