Hi,
My client wants a page that they can send as an email through IE, but when I do File>Send>Page by Email it adds a hidden input field at the top of the page with some random letters in it.
I've been asked to remove it...
I've tried EnableViewState=false and removing it from the dom with javascript and even hiding it with CSS but it still keeps showing in the email (not on the page in the browser though) :(
I don't know what you may need to help, so i'll paste it all, here be the codings:
cs:
using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using WorksUnit.Clydesdale.PropertyManager;
using WorksUnit.Clydesdale.PropertyManager.BusinessObjects;
namespace WorksUnit.Clydesdale.PropertyManager.Website.Summary
{
public partial class MaintenanceJobSheet : System.Web.UI.Page
{
private int _cachedPropertyId = 0;
private const string PROPERTYID_QUERY_STRING = "PropertyID";
private int _propertyId
{
get
{
if (_cachedPropertyId == 0 && Request.QueryString[PROPERTYID_QUERY_STRING] != null)
{
int.TryParse(Request.QueryString[PROPERTYID_QUERY_STRING].ToString(), out _cachedPropertyId);
}
return _cachedPropertyId;
}
set { _cachedPropertyId = value; }
}
private int maintenanceId
{
get
{
if (!string.IsNullOrEmpty(Request.QueryString["maintenanceId"]))
{
return Convert.ToInt32(Request.QueryString["maintenanceId"]);
}
else
{
return 0;
}
}
}
protected void Page_Load(object sender, EventArgs e)
{
if (maintenanceId != 0)
{
BusinessObjects.Maintenance maintenance = BusinessObjects.Maintenance.Retrieve(maintenanceId);
LiteralJobNumber.Text = maintenance.JobNumber;
LiteralDescription.Text = maintenance.Description;
LiteralContractor.Text = maintenance.Contractor.Description;
if(maintenance.Date!=DateTime.MinValue)
{
LiteralDate.Text = maintenance.Date.ToShortDateString();
}
if(maintenance.CompletionDate!=DateTime.MinValue)
{
LiteralCompletionDate.Text = maintenance.CompletionDate.ToShortDateString();
}
if(maintenance.DateInvoiced!=DateTime.MinValue)
{
LiteralInvoicedDate.Text = maintenance.DateInvoiced.ToShortDateString();
}
if(maintenance.DatePaid!=DateTime.MinValue)
{
LiteralDatePaid.Text =maintenance.DatePaid.ToShortDateString();
}
LiteralChargeDetails.Text = maintenance.DetailsOfCharging;
LiteralUpdate.Text = maintenance.LatestSummary;
}
}
}
}
front end:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="MaintenanceJobSheet.aspx.cs" EnableViewState="false" Inherits="WorksUnit.Clydesdale.PropertyManager.Website.Summary.MaintenanceJobSheet" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Clydesdale Property Solutions Work Request</title>
<link rel="stylesheet" type="text/css" media="screen" href="/css/screen.css" />
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" type="text/javascript"></script>
</head>
<body>
<form id="form1" runat="server">
<div>
<span><b>Contractor:</b> </span><asp:Literal ID="LiteralContractor" runat="server" />
<br /><br />
<span>Please undertake the following:-</span>
<br /><br />
<table width="600" cellpadding="3" cellspacing="0" border="1px">
<tr>
<td valign="top" width="150">Job Number:</td>
<td><asp:Literal ID="LiteralJobNumber" runat="server" Text="N/A" /></td>
</tr>
<tr>
<td valign="top" width="150">Description:</td>
<td><asp:Literal ID="LiteralDescription" runat="server" /></td>
</tr>
<tr>
<td valign="top" width="150">Date:</td>
<td><asp:Literal ID="LiteralDate" runat="server" /></td>
</tr>
<tr>
<td valign="top" width="150">Completion Date:</td>
<td><asp:Literal ID="LiteralCompletionDate" runat="server" /></td>
</tr>
<tr>
<td valign="top" width="150">Invoiced Date:</td>
<td><asp:Literal ID="LiteralInvoicedDate" runat="server" /></td>
</tr>
<tr>
<td valign="top" width="150">Date Paid:</td>
<td><asp:Literal ID="LiteralDatePaid" runat="server" /></td>
</tr>
<tr>
<td valign="top" width="150">Details of Charging:</td>
<td><asp:Literal ID="LiteralChargeDetails" runat="server" /></td>
</tr>
<tr>
<td valign="top" width="150">Update:</td>
<td><asp:Literal ID="LiteralUpdate" runat="server" /></td>
</tr>
</table>
<br /><br /><br />
<span>Thank You</span>
<br /><br /><br />
Clydesdale Estates,<br />
Tel:02380331234 <br />
Fax:02380335522<br />
Email: [email protected]
</div>
</form>
</body>
</html>
And this is what shows when I View Source on the email:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE>Clydesdale Property Solutions Work Request</TITLE>
<META content="text/html; charset=iso-8859-1" http-equiv=Content-Type>
<BASE href="http://localhost:4659/Summary/MaintenanceJobSheet.aspx">
<LINK rel=stylesheet type=text/css href="/css/screen.css" media=screen>
<META name=GENERATOR content="MSHTML 8.00.6001.18854">
</HEAD>
<BODY>
<FORM id=form1 method=post name=form1 action=MaintenanceJobSheet.aspx>
<!-- random input appears here (wrapped in a div) --><DIV>
<INPUT id=__VIEWSTATE
value=/wEPDwUJNzAyODg3NjY4ZGT+zJss/Xlbkhlxv8we8oRPUGNy9Q== type=hidden name=__VIEWSTATE>
</DIV> <!-- and ends here -->
<DIV><SPAN><B>Contractor:</B> </SPAN> <BR><BR><SPAN>Please undertake the following:-</SPAN> <BR><BR>
<TABLE border=1 cellSpacing=0 cellPadding=3 width=600>
<TD vAlign=top width=150><!-- more content goes here --></TD>
</TR>
</TABLE>
</DIV>
</FORM>
</BODY>
</HTML>
Any help would be greatly appreciated.