This article describes the method of Asp.net+js to realize batch coding and decoding. Share to everyone for your reference, specific as follows:
<%@ Page language= "C #" autoeventwireup= "true" codefile= "Default.aspx.cs" inherits= "_default"%> <! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
The
C # code is as follows:
using System; using System.Collections.Generic; using System.Linq; using System.Web; u
Sing System.Web.UI;
Using System.Web.UI.WebControls; Public partial class _default:system.web.ui.page {protected void Page_Load (object sender, EventArgs e) {if (Re
quest["Id"]!=null {string msg = "";
msg + + "<font color= ' red ' > Server gets the value (before decoding):<br/>"; foreach (string s in Request.Form.AllKeys) {msg + string.
Format ("{0}:{1}<br/>", S, Request.form[s]);
MSG + + "server-obtained value (decoded):<br/>"; foreach (string s in Request.Form.AllKeys) {msg + string.
Format ("{0}:{1}<br/>", S, Httputility.urldecode (Request.form[s));
msg + = "</font>"; MSG + String.
Format ("encoded character decoding 1ab&<b> small </b>:{0}", Httputility.urldecode ("1ab&<b> small </b>"));
Response.Write (msg);
Response.End (); }
}
}
I hope this article will help you with ASP.net programming.