Das ist meine ASHX
Datei, wo ich mehrere Parameter von der Anfrage-URL mit httpcontext
fangen, und es funktioniert ordnungsgemäß, aber wenn ich einen Hash einschließe (#) Wert in Textparameter über die URL. Es nimmt nicht den Wert von FLOW, der ein anderer Parameter ist (neben dem Text-Parameter).Wie kann ich ein Pfundzeichen (#) von URL mit mehreren Werten in ASHX-Dateien fangen
So funktioniert es für:
http://localhost:10326/ussd.ashx?user=MSL&pass=MSL663055&tid=65506&msisdn=8801520101525&text=***3333**&flow=begin&momt=mo
Und es funktioniert nicht für:
http://localhost:10326/ussd.ashx?user=MSL&pass=MSL663055&tid=65506&msisdn=8801520101525&text=***3333#**&flow=begin&momt=mo
Meine ASHX Dateien:
public void ProcessRequest(HttpContext context)
{
HttpRequest httpRequest = context.Request;
string user = httpRequest.QueryString["user"].ToString();
string pass = httpRequest.QueryString["pass"].ToString();
string tid = httpRequest.QueryString["tid"].ToString();
string msisdn = httpRequest.QueryString["msisdn"].ToString();
string text = httpRequest.QueryString["text"].ToString();
flow = httpRequest.QueryString["flow"].ToString();
HttpContext.Current.Session["user"] = user;
HttpContext.Current.Session["pass"] = pass;
HttpContext.Current.Session["tid"] = tid;
HttpContext.Current.Session["msisdn"] = msisdn;
HttpContext.Current.Session["text"] = text;
HttpContext.Current.Session["flow"] = flow;
korrekt, Funktionen für die URL-Codierung sind .Net: 'Httputility.UrlEncode()', Javascript: 'encodeURI()' oder 'encodeURIComponent()' – par
Abschnitt 3 hat sogar eine nette [ASCII-Grafik] (https: // tools.ietf.org/html/rfc3986#section-3), die die URI-Teile einschließlich des Fragments zeigt –