[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

mail page with content

Posted on 2009-12-28
10
Medium Priority
?
342 Views
Last Modified: 2013-11-08
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 ?
0
Comment
Question by:virafh
  • 6
  • 3
10 Comments
 
LVL 15

Expert Comment

by:rajeeshmca
ID: 26136284
Instead of sending the whole form, u can send the Link for that form with querystrings.

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
0
 
LVL 11

Assisted Solution

by:princeatapi
princeatapi earned 800 total points
ID: 26136668
Well try this .

 At some instance you may supposed to send the mail ( may be a Form what you mentioned ) just put all your from contents inside a div

store the innerHTML contents to a hidden field

hidField.Value = MyDiv.innerHTML ; this would bring whats presently in your form ( Just What You See Is What You Get )

If you require more formatting then apply it in the HiddenField Content and Export to mail .
0
 

Author Comment

by:virafh
ID: 26291073
its giving me error

Cannot get inner content of dv because the contents are not literal.

0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 11

Expert Comment

by:princeatapi
ID: 26291102
may  i have your Javascript code ??
0
 
LVL 11

Expert Comment

by:princeatapi
ID: 26291125


document.getElementById('MyDiv') will give you only the element itself. If you want the contents of the element, you'll need to use innerHTML or some other DOM-based technique to retrieve the contents of that element.

try like this
var MailContent = document.getElementById("MyDiv").innerHTML;
0
 
LVL 11

Expert Comment

by:princeatapi
ID: 26291144
Just assign the value to the a HiddenField and access the hidden field from server
as myHidden.Value
0
 

Author Comment

by:virafh
ID: 26291151
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);
    }

Open in new window

0
 
LVL 11

Expert Comment

by:princeatapi
ID: 26291205
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("MyMailContent").value =  document.getElementById("dv").innerHTML;
   }
    </script>

</head>
<body>
    <form id="form1" runat="server">
        &nbsp;
       
        <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>
0
 
LVL 11

Expert Comment

by:princeatapi
ID: 26291208
Please find the Code Behind

protected void Page_Load(object sender, EventArgs e)
    {
        Test.Attributes.Add("OnClick", "javascript:return Change()");

        Response.Write(MyMailContent.Value.ToString());
    }
0
 

Accepted Solution

by:
virafh earned 0 total points
ID: 26292231
buddy, you did not understand what i want, let me explain again, please see the html codes, when user enter his name and age and then click on submit button, i want the divMain with all its textbox values not actual textbox


<div runat="server" id="dvMain">
        <table width="100%">
            <tr>
                <td>Name:
                </td>
                <td><asp:TextBox runat="server" ID="txtName"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td>Age:
                </td>
                <td><asp:TextBox runat="server" ID="txtAge"></asp:TextBox>
                </td>
            </tr>
        </table>
    </div>
    <div><asp:Button runat="server" ID="btnSubmit" Text="Submit" /></div>

Open in new window

0

Featured Post

Fill in the form and get your FREE NFR key NOW!

Veeam is happy to provide a FREE NFR server license to certified engineers, trainers, and bloggers.  It allows for the non‑production use of Veeam Agent for Microsoft Windows. This license is valid for five workstations and two servers.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
Hello there! As a developer I have modified and refactored the unit tests which was written by fellow developers in the past. On the course, I have gone through various misconceptions and technical challenges when it comes to implementation. I would…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…
Suggested Courses

829 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question