0

in my webpage i can fill some form with user information.

http://hotcont.eu/OnlineVertrag/EContract

after filling it i can see it again if all is filled like i wanted. now it should be send to partner.

my question, how can i read html page source of this page with filled user information inside?

i want to get page source as string an send it as HTML Body with MailMessage.

<tr>
                    <td style="width: 400px;">
                        <b style="font-size: smaller; color: #00008B;">
                            <%= Html.DisplayFor(model => model.NameSeller) %></b>
                        <p style="margin-top: 3px; border-top: solid 1px #fddf99; width: 300px;">
                            Vorname, Nachname</p>
                    </td>
                    <td>
                        <b style="font-size: smaller; color: #00008B;">
                            <%= Html.DisplayFor(econtract => econtract.NameBuyer)%></b>
                        <p style="margin-top: 3px; border-top: solid 1px #fddf99; width: 308px;">
                            Vorname, Nachname</p>
                    </td>
                </tr>
r.r
  • 7,023
  • 28
  • 87
  • 129

1 Answers1

1

You may take a look at the following post which illustrates how you could render a view to a string by passing it a model that you have retrieved after your form was submitted.

And if you are using MVC 3 you may take a look at MvcMailer which is designed exactly for this purpose.

Community
  • 1
  • 1
Darin Dimitrov
  • 1,023,142
  • 271
  • 3,287
  • 2,928
  • what does it mean here??---------------------------------------------------> protected string RenderViewToString(string viewPath, T model) { ViewData.Model = model; using (var writer = new StringWriter()) { var view = new WebFormView(viewPath); var vdd = new ViewDataDictionary(model); – r.r Aug 28 '12 at 11:45
  • T is your the view model that you need to pass to the view. It is the view model your view is strongly typed to. – Darin Dimitrov Aug 28 '12 at 11:57