|
[x]
Posted via EE Mobile
|
||
Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again. |
||
| 04/07/2009 at 12:38AM PDT, ID: 24300986 |
|
[x]
Attachment Details
|
||
|
[x]
The Solution Rating System
|
||
With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.
Your Input Matters If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support. Thank you! |
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76: 77: 78: 79: 80: 81: 82: 83: 84: 85: 86: 87: 88: 89: 90: 91: 92: 93: 94: 95: 96: 97: 98: 99: 100: 101: 102: 103: 104: 105: 106: 107: 108: 109: 110: 111: 112: 113: 114: 115: 116: 117: 118: 119: 120: 121: 122: 123: 124: 125: 126: 127: 128: 129: 130: 131: 132: 133: 134: 135: 136: 137: 138: 139: 140: 141: 142: 143: 144: 145: 146: 147: 148: 149: 150: 151: 152: 153: 154: 155: 156: 157: 158: 159: 160: 161: 162: 163: 164: 165: 166: 167: 168: 169: 170: 171: 172: 173: 174: 175: 176: 177: 178: 179: 180: 181: 182: 183: 184: |
USER CONTROL SOURCE:
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="MimeEmailer.ascx.cs" Inherits="UserControls_MimeEmailer" %>
<script type ="text/javascript" language="javascript">
function ClearTheItXYZ()
{
document.getElementById('<%=txtSubject.ClientID %>').value = '';
document.getElementById('<%=txtMessage.ClientID %>').value = '';
var control = document.getElementById('<%=txtSubject.ClientID %>');
if( control != null ){ control.focus(); }
return false;
}
</script>
<ajaxext:ScriptManagerProxy ID="ScriptManagerProxy1" runat="server">
</ajaxext:ScriptManagerProxy>
<ajaxext:UpdatePanel ID="UpdatePanelA" runat="server">
<ContentTemplate>
<asp:Panel ID="pnlMail" runat="server" CssClass="pnlEMail" Width="600" BackColor="Lime">
<br />
<table id="email" style="position: relative" >
<!-- To -->
<tr>
<td style="width: 75px">
<asp:Label ID="lblTo" runat="server" CssClass="smallerFontSize">To:</asp:Label>
</td>
<td colspan="2">
<asp:DropDownList ID="ddlAddresses" runat="server" Width="325px"></asp:DropDownList>
</td>
</tr>
<tr>
<!-- Row: Blank -->
<td colspan="2" height="12"></td>
</tr>
<!-- Row: Subject -->
<tr>
<td style="width: 75px">
<asp:Label ID="lblSubject" runat="server" CssClass="smallerFontSize" AssociatedControlID="txtSubject" Width="175px" >Subject:</asp:Label>
</td>
<td colspan="2">
<asp:TextBox ID="txtSubject" runat="server" Width="350px"></asp:TextBox>
<asp:RequiredFieldValidator ID="rfvSubject" runat="server" CssClass="smallFontSize" ControlToValidate="txtSubject"
ErrorMessage="Required Field" SetFocusOnError="True" Style="position: relative" ValidationGroup="SendEmail"></asp:RequiredFieldValidator></td>
<!-- End: Row: Subject -->
</tr>
<tr>
<!-- Row: Blank -->
<td colspan="2" height="12"></td>
</tr>
<tr>
<!-- Row: Message -->
<td style="width: 75px">
<asp:Label ID="lblMessage" runat="server" CssClass="smallerFontSize" AssociatedControlID="txtMessage">Message:</asp:Label>
</td>
<td colspan="2">
<asp:TextBox ID="txtMessage" runat="server" TextMode="MultiLine" Width="475px" Height="200px"></asp:TextBox>
<asp:RequiredFieldValidator ID="rfvMessage" runat="server" CssClass="smallFontSize" ControlToValidate="txtMessage"
ErrorMessage="Required Field" SetFocusOnError="True" Style="position: relative" ValidationGroup="SendEmail"></asp:RequiredFieldValidator>
</td>
<!-- End: Row: Message -->
</tr>
<tr>
<!-- Row: Blank -->
<td colspan="2" height="1"></td>
</tr>
<!-- End: table id="email". -->
</table>
<center>
<asp:Button ID="btnSendTheEMail" runat="server" Text="Send" ValidationGroup="SendEmail" CssClass="buttons" OnClick="btnSendTheEMail_Click" />
<asp:Button ID="btnClear" runat="server" Text="Clear" OnClientClick="return ClearTheItXYZ()" CausesValidation="False" />
</center><br />
</asp:Panel>
<!-- <asp:Panel ID=pnlMail"> -->
</ContentTemplate>
</ajaxext:UpdatePanel>
USER CONTROL CODE BEHIND:
using System;
using System.Data;
using System.Text;
using System.Configuration;
using System.Collections;
using System.Collections.Generic;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using DataTransferObjects;
using BusinessLogic;
public partial class UserControls_MimeEmailer : System.Web.UI.UserControl
{
private List<EMailAddress> emailList = new List<EMailAddress>();
protected void Page_Load(object sender, EventArgs e)
{
// Load the Page-specific stylesheet.
//HtmlLink lnk = (HtmlLink)Master.FindControl("cssLink");
HtmlLink lnk = new HtmlLink();
lnk.Href = "~/CSS/UserControls.css";
// txtMessage.Attributes.Add("OnClientClick", "return false;");
if (!Page.IsPostBack)
{
emailList = BusinessLogic.Business.GetEmailAddress();
ddlAddresses.DataSource = emailList;
ddlAddresses.DataTextField = "Name";
ddlAddresses.DataValueField = "Email";
ddlAddresses.DataBind();
ddlAddresses.SelectedIndex = 0;
Session["selectedEmail"] = ddlAddresses.SelectedIndex;
}
else
{
if (Session["selectedEmail"] != null)
{
ddlAddresses.SelectedIndex = (int)Session["selectedEmail"];
}
else
{
ddlAddresses.SelectedIndex = 0;
Session["selectedEmail"] = ddlAddresses.SelectedIndex;
}
}
}
protected void btnSendTheEMail_Click(object sender, EventArgs e)
{
bool isEmailSent = BusinessLogic.Business.SendEmail(ddlAddresses.SelectedValue.ToString(),
System.Configuration.ConfigurationManager.AppSettings["AdminEmail"].ToString(),
txtSubject.Text,
txtMessage.Text + Environment.NewLine + Environment.NewLine);
if (isEmailSent)
{
Response.Write("<script>alert('Your email has been sent.')</script>");
ClearTheFields();
}
else
{
// Message to go here.
}
}
private void ClearTheFields()
{
ddlAddresses.SelectedIndex = 0;
txtSubject.Text = "";
txtMessage.Text = "";
txtSubject.Focus();
}
}
|
Advertisement