Answered by:
Need help with the code/drop-down list

Question
-
User414145754 posted
Hi, i am working on a project to configure automatic replies via web form. I have the C# code ready to do the same but the text returned is simple text and do not give end users any option to modify the text. In the current scenario, when user enters the email, internal URL and external URL on the webform, it gets pushed on the mailbox. I want to give users more functionality to modify the text.
Can anyone help me with the code to display textbox with dropdown lists (fonts, size, style, highlight and hyperlink) like below,
HITML code (current)
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="OOF.aspx.cs" Inherits="EWSAPI.OOF" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<style type="text/css">
#Text1 {
height: 129px;
width: 1244px;
}
</style>
</head>
<body>
<form id="form1" runat="server">
<div>
Email
<asp:TextBox ID="Email" runat="server"></asp:TextBox>
<br />
<br />
Internal Reply
<asp:TextBox ID="IR" runat="server" TextMode="MultiLine" Width="944px"></asp:TextBox>
<br />
<br /> External Reply
<asp:TextBox ID="ER" runat="server" TextMode="MultiLine" style="font-family:Calibri" Width="945px"></asp:TextBox>
<br />
<br />
<br />
<br />
<br />
<asp:Button ID="Button12" runat="server" OnClick="Button12_Click" Text="Push" />
</div>
</form>
<p>
</p>
</body>
</html>C# code
using System; using Microsoft.Exchange.WebServices.Data; using Outlook = Microsoft.Office.Interop.Outlook; using System.Drawing.Design; namespace EWSAPI { public partial class OOF : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } protected void Button12_Click(object sender, EventArgs e) { string ServiceAcc = ""; string ServiceAccPWD = ""; string UAcc = Email.Text.ToString(); Mailbox mailbox = new Mailbox(UAcc); WebService ws = new WebService(); ExchangeService service = (ws.webservice_conn(ServiceAcc, ServiceAccPWD, UAcc)); string IRHTML = IR.Text.ToString(); string IRHTML2 = IRHTML.Replace("\r\n", "<br />"); string EXHTML = ER.Text.ToString(); string EXHTML2 = EXHTML.Replace("\r\n", "<br />"); OofSettings OOF = new OofSettings(); OOF.State = OofState.Scheduled; OOF.Duration = new TimeWindow(DateTime.Now, DateTime.Now.AddDays(21)); OOF.ExternalAudience = OofExternalAudience.All; OOF.InternalReply = new OofReply(IRHTML2); OOF.ExternalReply = new OofReply(EXHTML2); service.SetUserOofSettings(UAcc, OOF); //To disable //OOF.State = OofState.Disabled; } } }
Friday, June 29, 2018 7:27 PM
Answers
-
User409696431 posted
"Can anyone help me with the code to display textbox with dropdown lists (fonts, size, style, highlight and hyperlink) like below,"
A TextBox does not have that functionality. You appear to be looking for an HTML Editor for your page, of which there are several to choose from, some free, some not (many inexpensive). Be aware, however, that HTML in email is not straightforward, especially things like fonts. You'd want to limit the options to things that will display correctly in email.
One example of an editor: https://www.obout.com/editor_new/index.aspx
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Saturday, June 30, 2018 11:53 PM
All replies
-
User409696431 posted
"Can anyone help me with the code to display textbox with dropdown lists (fonts, size, style, highlight and hyperlink) like below,"
A TextBox does not have that functionality. You appear to be looking for an HTML Editor for your page, of which there are several to choose from, some free, some not (many inexpensive). Be aware, however, that HTML in email is not straightforward, especially things like fonts. You'd want to limit the options to things that will display correctly in email.
One example of an editor: https://www.obout.com/editor_new/index.aspx
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Saturday, June 30, 2018 11:53 PM -
User414145754 posted
Thank you!!
Sunday, July 1, 2018 6:55 PM