public TextWriter Output { get; }
public:
property TextWriter^ Output {
TextWriter^ get ();
}
/** @property */
public TextWriter get_Output()
public function get Output () : TextWriter
示例
<!---->
下面的示例是一个包含 TextBox 控件的 ASP.NET 页,该控件的 TextMode 属性设置为 MultiLine。该页的代码接受用户在 TextMode 中输入的文本,然后使用 HtmlEncode()()() 方法对这些文本进行 HTML 编码,再使用 Output 属性将编码后的字符串显示到该页中。
<%@ Page Language="VB" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
' When the page is posted back, the text box's
' Text property value is HTML encoded and sent
' sent to the current response.
Private Sub btnSubmit_Click(sender As Object, e As EventArgs)
If (IsPostBack = True)
Server.HtmlEncode(txtSubmitString.Text, Response.Output)
End If
End Sub
</script>
<html >
<head>
<title>ASP.NET Example</title>
</head>
<body>
<form id="form1" runat="server">
<p style="font-family:Tahoma; font-size:12">
Enter your comments here:
</p>
<p>
<asp:TextBox id="txtSubmitString" runat="server" Width="181px" TextMode="MultiLine"></asp:TextBox>
</p>
<p>
<asp:Button id="btnSubmit" onclick="btnSubmit_Click" runat="server" Text="Submit"></asp:Button>
</p>
<p>
<asp:Label id="lblEncodedString" runat="server"></asp:Label>
</p>
</form>
</body>
</html>
<%@ Page Language="C#" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
// When the page is posted back, the text box's
// Text property value is HTML encoded and sent
// sent to the current Response.
void btnSubmit_Click(object sender, EventArgs e) {
if (IsPostBack)
{
Server.HtmlEncode(txtSubmitString.Text, Response.Output);
}
}
</script>
<html >
<head>
<title>ASP.NET Example</title>
</head>
<body>
<form id="form1" runat="server">
<p style="font-family:Tahoma; font-size:12">
Enter your comments here:
</p>
<p>
<asp:TextBox id="txtSubmitString" runat="server" Width="181px" TextMode="MultiLine"></asp:TextBox>
</p>
<p>
<asp:Button id="btnSubmit" onclick="btnSubmit_Click" runat="server" Text="Submit"></asp:Button>
</p>
<p>
<asp:Label id="lblEncodedString" runat="server"></asp:Label>
</p>
</form>
</body>
</html>
分享到:
相关推荐
httpResponse . setContent ( { status : true } ) ; httpResponse . setContent ( "Everything is ok" ) ; // or httpResponse . setContent ( new Buffer ( "Something" ) ) ; // or httpResponse . setStatusCode...
python 零基础学习篇
if(httpResponse.getStatusLine().getStatusCode()==200){//连接成功 String result = EntityUtils.toString(httpResponse.getEntity());//获得资源 result = result.replaceAll("\r\n|\n\r|\r|\n", "");...
import org.apache.http.HttpResponse; import org.apache.http.HttpStatus; import org.apache.http.NameValuePair; import org.apache.http.client.entity.UrlEncodedFormEntity; import org.apache....
在网上经常看见有这样的代码HttpResponse response = HttpContext.Current.Response;现在我也来说说这几个东东是什么吧
配置JDK: XP:右键"我的电脑"("属性"("高级"("环境变量" WIN7:右键"我的电脑"("高级系统设置"("环境变量" 新建系统变量: JAVA_HOME,C:\Program Files (x86)\Java\jdk1.6.0_18(JDK安装目录)。 PATH,%JAVA_...
import org.apache.http.HttpResponse; import org.apache.http.HttpStatus; import org.apache.http.NameValuePair; import org.apache.http.client.entity.UrlEncodedFormEntity; import org.apache....
import org.apache.http.HttpResponse; import org.apache.http.HttpStatus; import org.apache.http.NameValuePair; import org.apache.http.client.entity.UrlEncodedFormEntity; import org.apache....
return HttpResponse('%s("我要上鸭王")' %(callback,)); # javascript function submitJsonp4() { $.ajax({ url: 'http://127.0.0.1:9000/xiaokai.html', type: 'GET', //写post 没有用 只能发get dataType: ...
1.浏览器中输入网站地址:172.20.52.163:20014 ...代码实现 server.py #!/usr/bin/python ...def HttpResponse(header,whtml): f = file(whtml) contxtlist = f.readlines() context = ''
背景 ...1.浏览器中输入网站地址:172.20.52.163:20014 ...代码实现 server.py #!/usr/bin/python ...def HttpResponse(header,whtml): f = file(whtml) contxtlist = f.readlines() context = ''.
接受的响应对象,具有statusCode属性,第一参数,并返回true ,如果状态码是内2xx范围,否则返回false 。 可选地,它将回调作为第二个参数,仅当响应不成功时才使用错误对象调用它。 错误设置了statusCode 、 ...
HttpResponse Imap JavaKeyStore JsonArray JsonObject Jwe Jws Jwt KeyContainer Log MailMan Mailboxes MessageSet Mht Mime Ntlm OAuth1 OAuth2 Pem Pfx PrivateKey Prng PublicKey Rest Rsa Rss SFtp SFtpDir ...
import org.apache.http.HttpResponse; import org.apache.http.NameValuePair; import org.apache.http.ParseException; import org.apache.http.client.ClientProtocolException; import org.apache....
import org.apache.http.HttpResponse; import org.apache.http.HttpStatus; import org.apache.http.NameValuePair; import org.apache.http.client.entity.UrlEncodedFormEntity; import org.apache....
在Cookie介绍中 我们了解到Cookie是基于Set Cookie响应头和Cookie请求头工作的 服务器通过response对象的addHeader 方法将cookie发送给浏览器 然后浏览器通过Cookie请求头将cookie再送回服务器
方法说明: 结束响应,告诉客户端所有消息已经发送。当所有要返回的内容发送完毕时,该函数必须被调用一次。 如何不调用该函数,客户端将永远处于等待状态。 语法: 代码如下: response.end([data], [encoding]) ...
String strResult = EntityUtils.toString(httpResponse.getEntity()); Log.e("WeiboKu", "strResult :"+strResult); return strResult; } else { Log.e("WeiboKu", "strResult Error:"+statusCode); return...