Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/73.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 以字符串形式从带有填充公式的网页获取页面源。asp.NETMVC2_Html_Asp.net Mvc 2 - Fatal编程技术网

Html 以字符串形式从带有填充公式的网页获取页面源。asp.NETMVC2

Html 以字符串形式从带有填充公式的网页获取页面源。asp.NETMVC2,html,asp.net-mvc-2,Html,Asp.net Mvc 2,在我的网页中,我可以用用户信息填写一些表格 填好后,如果一切都按我的要求填好了,我可以再次看到它。现在应该发送给合作伙伴 我的问题是,我如何阅读这个页面的html页面源代码,里面有填充的用户信息 我想以字符串的形式获取页面源代码,并通过邮件消息以HTML正文的形式发送 <tr> <td style="width: 400px;"> <b style="font-size: sm

在我的网页中,我可以用用户信息填写一些表格

填好后,如果一切都按我的要求填好了,我可以再次看到它。现在应该发送给合作伙伴

我的问题是,我如何阅读这个页面的html页面源代码,里面有填充的用户信息

我想以字符串的形式获取页面源代码,并通过邮件消息以HTML正文的形式发送

<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>

model.NameSeller)%%>

沃纳姆

econtract.NameBuyer)%>

沃纳姆


您可以查看,它演示了如何通过向视图传递提交表单后检索到的模型来将视图呈现为字符串


如果您使用的是MVC 3,那么您可以看看哪个是专门为这个目的设计的。

这是什么意思??--------------------------------------------------------------->受保护的字符串RenderViewToString(string viewPath,T model){ViewData.model=model;使用(var writer=new StringWriter()){var view=new WebFormView(viewPath);var vdd=new ViewDataDictionary(model);T是您需要传递给视图的视图模型。它是您的视图强类型化的视图模型。