取消viewstate __viewstate渲染 [英] Suppress viewstate __viewstate rendering
问题描述
我有一个客户想要通过电子邮件发送的ASP.NET页面。所以在IE中我们选择
文件>发送>电子邮件页面,打开Outlook或Outlook
Express,HTML页面内容作为邮件正文。
除了一个令人讨厌的细节是在电子邮件客户端中,< input type =" hidden">
元素呈现为文本框,其中__VIEWSTATE是其中之一,因此
视图状态显示在电子邮件顶部的文本框中。
我已经找到了一些覆盖和确保文本框为
$ b的东西$ b为空,因此HTML呈现
< input type =" hidden"命名= QUOT; __ VIEWSTATE"值="">
但是这仍然显示一个空的TextBox。
有没有办法阻止HTML元素正在写作?我b $ b发现了一个有趣的解释,为什么它在这个地址很难:
http://scottonwriting.net/sowblog/posts/1608.aspx
但是无法将其转化为解决方案。
-
杰森
www.pettysconsulting.com
I have an ASP.NET page that my client wants to e-mail. So in IE we choose
File > Send > Page by E-mail, which opens up either Outlook or Outlook
Express with the HTML page content as the message body.
EXCEPT one nasty detail is that in the e-mail client, <input type="hidden">
elements are rendered as text boxes, which the __VIEWSTATE is one of, and so
the viewstate is displayed in a textbox at the top of the e-mail.
I''ve figured out some overrides and stuff to ensure that the textbox is
empty, so the HTML renders
<input type="hidden" name="__VIEWSTATE" value="">
but this still displays an empty TextBox.
Is there any way to prevent the HTML element from being written at all? I
found an interesting explanation of why it''s hard at this address:
http://scottonwriting.net/sowblog/posts/1608.aspx
But couldn''t translate that into a solution.
--
Jason
www.pettysconsulting.com
推荐答案
只是一个想法
是否有办法将样式显示为无隐藏变量?
vinay
Jason Pettys写道:
Just a thought
Is there way to set style display as none for hidden variable ??
vinay
"Jason Pettys" wrote:
我有一个我的客户想要发送电子邮件的ASP.NET页面。所以在IE中我们选择
File>发送>电子邮件页面,它打开Outlook或Outlook
Express,HTML页面内容作为邮件正文。
除了一个令人讨厌的细节,在电子邮件客户端,< ; input type =" hidden">
元素呈现为文本框,其中__VIEWSTATE是其中之一,因此视图状态显示在电子邮件顶部的文本框中。
我已经找到了一些覆盖和确保文本框为空的东西,因此HTML呈现
< input type =" hidden" ;命名= QUOT; __ VIEWSTATE" value ="">
但是这仍然显示一个空的TextBox。
有没有办法防止HTML元素被写入?我找到了一个有趣的解释,为什么它在这个地址上很难:
http://scottonwriting.net/sowblog/posts/1608.aspx
但无法将其转化为解决方案。
-
Jason
www.pettysconsulting.com
I have an ASP.NET page that my client wants to e-mail. So in IE we choose
File > Send > Page by E-mail, which opens up either Outlook or Outlook
Express with the HTML page content as the message body.
EXCEPT one nasty detail is that in the e-mail client, <input type="hidden">
elements are rendered as text boxes, which the __VIEWSTATE is one of, and so
the viewstate is displayed in a textbox at the top of the e-mail.
I''ve figured out some overrides and stuff to ensure that the textbox is
empty, so the HTML renders
<input type="hidden" name="__VIEWSTATE" value="">
but this still displays an empty TextBox.
Is there any way to prevent the HTML element from being written at all? I
found an interesting explanation of why it''s hard at this address:
http://scottonwriting.net/sowblog/posts/1608.aspx
But couldn''t translate that into a solution.
--
Jason
www.pettysconsulting.com
我尝试了你的建议,但它没有用。请参阅
http://pettysconsulting.com/test.htm 。它具有以下定义:
< style type =" text / css">
input {font-family:Verdana; display:none; }
< / style>
类型=" text"也不键入=" hidden"元素显示在网页上,
但两者都显示在Outlook中(使用Verdana字体)。
" vinay"写道:
I tried your suggestion but it did not work. See
http://pettysconsulting.com/test.htm. It has this defined:
<style type="text/css">
input { font-family: Verdana; display: none; }
</style>
Neither type="text" nor type="hidden" elements are shown in the web page,
but both are shown in Outlook (with Verdana font).
"vinay" wrote:
只是一个想法
有没有办法将样式显示为无隐藏变量?
vinay
Jason Pettys写道:
Just a thought
Is there way to set style display as none for hidden variable ??
vinay
"Jason Pettys" wrote:
我有一个我的客户想要发送电子邮件的ASP.NET页面。所以在IE中我们选择
File>发送>电子邮件页面,它打开Outlook或Outlook
Express,HTML页面内容作为邮件正文。
除了一个令人讨厌的细节,在电子邮件客户端,< ; input type =" hidden">
元素呈现为文本框,其中__VIEWSTATE是其中之一,因此视图状态显示在电子邮件顶部的文本框中。
我已经找到了一些覆盖和确保文本框为空的东西,因此HTML呈现
< input type =" hidden" ;命名= QUOT; __ VIEWSTATE" value ="">
但是这仍然显示一个空的TextBox。
有没有办法防止HTML元素被写入?我找到了一个有趣的解释,为什么它在这个地址上很难:
http://scottonwriting.net/sowblog/posts/1608.aspx
但无法将其转化为解决方案。
-
Jason
www.pettysconsulting.com
I have an ASP.NET page that my client wants to e-mail. So in IE we choose
File > Send > Page by E-mail, which opens up either Outlook or Outlook
Express with the HTML page content as the message body.
EXCEPT one nasty detail is that in the e-mail client, <input type="hidden">
elements are rendered as text boxes, which the __VIEWSTATE is one of, and so
the viewstate is displayed in a textbox at the top of the e-mail.
I''ve figured out some overrides and stuff to ensure that the textbox is
empty, so the HTML renders
<input type="hidden" name="__VIEWSTATE" value="">
but this still displays an empty TextBox.
Is there any way to prevent the HTML element from being written at all? I
found an interesting explanation of why it''s hard at this address:
http://scottonwriting.net/sowblog/posts/1608.aspx
But couldn''t translate that into a solution.
--
Jason
www.pettysconsulting.com
您是否考虑过生成电子邮件的服务器端解决方案,其中包含MailMessage集的
BodyFormat属性到MailFormat.Html?显然我对你的项目并不熟悉,但通常当有人想要发送电子邮件时,这是一个动态生成的某种报告或传单。
如果是这种情况,您可能希望切换到生成
HTML的方法并将其放在PlaceHolder中以进行页面输出,并且可以也可以设置为
MailMessage的Body属性。
HTH
-
Dave Fancher
http://davefancher.blogspot.com
" Jason Pettys" < PE **** @ nospam.nospam>在消息中写道
news:35 ********************************** @ microsof t.com ...
Have you considered a server side solution that generates an e-mail wth the
BodyFormat property of your MailMessage set to MailFormat.Html? Obviously I
am not familiar with your project but typically when someone wants to e-mail
a page, it''s a report or flyer of some sort which is dynamically generated.
If this is the case, you may want to switch to a method that generates the
HTML and puts it in a PlaceHolder for the page output and can also be set as
the Body property of your MailMessage.
HTH
--
Dave Fancher
http://davefancher.blogspot.com
"Jason Pettys" <pe****@nospam.nospam> wrote in message
news:35**********************************@microsof t.com...
我有一个客户想要通过电子邮件发送的ASP.NET页面。所以在IE中我们选择
File>发送>电子邮件页面,它打开Outlook或Outlook
Express,HTML页面内容作为邮件正文。
除了一个令人讨厌的细节,在电子邮件客户端,< ;输入
type =" hidden">
元素呈现为文本框,__VIEWSTATE是其中之一,并且
所以
视图状态显示在文本框中电子邮件的顶部。
我已经找到了一些重要的东西,以确保文本框是空的,所以HTML渲染
< input type =" hidden"命名= QUOT; __ VIEWSTATE" value ="">
但是这仍然显示一个空的TextBox。
有没有办法防止HTML元素被写入?我找到了一个有趣的解释,为什么它在这个地址上很难:
http://scottonwriting.net/sowblog/posts/1608.aspx
但无法将其转化为解决方案。
-
Jason
www.pettysconsulting.com
I have an ASP.NET page that my client wants to e-mail. So in IE we choose
File > Send > Page by E-mail, which opens up either Outlook or Outlook
Express with the HTML page content as the message body.
EXCEPT one nasty detail is that in the e-mail client, <input
type="hidden">
elements are rendered as text boxes, which the __VIEWSTATE is one of, and
so
the viewstate is displayed in a textbox at the top of the e-mail.
I''ve figured out some overrides and stuff to ensure that the textbox is
empty, so the HTML renders
<input type="hidden" name="__VIEWSTATE" value="">
but this still displays an empty TextBox.
Is there any way to prevent the HTML element from being written at all? I
found an interesting explanation of why it''s hard at this address:
http://scottonwriting.net/sowblog/posts/1608.aspx
But couldn''t translate that into a solution.
--
Jason
www.pettysconsulting.com
这篇关于取消viewstate __viewstate渲染的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!