virafh
asked on
mail page with content
Dear Friends,
i know how to send email using codes with html format.
my requirement:
i have a form with text box, dropdown, radion buttons etc.
now i want to send the form as it is with the selected and inserted values in the form.
how can i ?
i know how to send email using codes with html format.
my requirement:
i have a form with text box, dropdown, radion buttons etc.
now i want to send the form as it is with the selected and inserted values in the form.
how can i ?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
its giving me error
Cannot get inner content of dv because the contents are not literal.
Cannot get inner content of dv because the contents are not literal.
may i have your Javascript code ??
document.getElementById('M
try like this
var MailContent = document.getElementById("M
Just assign the value to the a HiddenField and access the hidden field from server
as myHidden.Value
as myHidden.Value
ASKER
please see the attached test code
<body>
<form id="form1" runat="server">
<div runat="server" id="dv">
<asp:TextBox runat="server" ID="txt"></asp:TextBox>
</div>
<p>
<asp:Button ID="Button1" runat="server" Text="Button" onclick="Button1_Click" />
</p>
</form>
</body>
protected void Button1_Click(object sender, EventArgs e)
{
string str = dv.InnerHtml;
Response.Write(str);
}
you can get like this
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>
<script type="Text/javascript">
function Change()
{
document.getElementById("M yMailConte nt").value = document.getElementById("d v").innerH TML;
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div runat="server" id="dv">
<asp:TextBox runat="server" ID="txt"></asp:TextBox>
</div>
<asp:Button ID ="Test" runat ="server" Text ="ClickMe" />
<asp:HiddenField ID ="MyMailContent" runat="server" />
</form>
</body>
</html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>
<script type="Text/javascript">
function Change()
{
document.getElementById("M
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div runat="server" id="dv">
<asp:TextBox runat="server" ID="txt"></asp:TextBox>
</div>
<asp:Button ID ="Test" runat ="server" Text ="ClickMe" />
<asp:HiddenField ID ="MyMailContent" runat="server" />
</form>
</body>
</html>
Please find the Code Behind
protected void Page_Load(object sender, EventArgs e)
{
Test.Attributes.Add("OnCli ck", "javascript:return Change()");
Response.Write(MyMailConte nt.Value.T oString()) ;
}
protected void Page_Load(object sender, EventArgs e)
{
Test.Attributes.Add("OnCli
Response.Write(MyMailConte
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
If at all u would like to send the complete form, you will have to frame the html such that it is by default selected.
Otherwise frame the selected items to a text and send it