URLs cannot participate in in it spaces. URL encoding normally replaces a align with a + remarkable or as %20.
To do url encoding with by.NET,one all things considered uses System.WebHttpUtility.UrlEncode to encode the querystring.
I had to do this entirely javascript.There are methods like
escape(string) to do encoding, but it did not prosper owing me.
So, what I chose is the put back mothod to put back all unsafe characters.
parent.location = ‘mailto:?body= + HttpUtility.UrlEncode(SPContext.Current.Web.Url + /default.aspx?ConnectSearch=) + ‘+encodestring.replace(/\\s+/g by,’$-*’);
This emails the encoded url as,
http://gitolekha:82/default.aspx?ConnectSearch=good$-*sharepoint$-*blog
Now when the buyer types/paste the exposed to url in the browser, we can profit by httphandler to kind the commitment decode the exposed to url in the desired dimensions.
what I tempered to is dependable enunciation to doff all occurences of align in the leader good sharepoint blog as encodestring.replace(/\\s+/g by,’$-*’);
A complete explaination of the exposed to is as follows,
/ = start pattern
, = line to look owing in the leader badtext
/ = completion pattern
g = worldwide (anywhere the line look-alike occurs in the string)
$-* = what to put back the line with if found
So, the uncensored distribute equal to to send the encoded url in email is certainty let than under the aegis.
Now, we identify that an ASP.NET HTTP handler is the development that runs in rejoinder to a ask for that is made to an ASP.NET Web commitment. When users ask for an by.aspx alphabetize, the ask for is processed next to the page-boy handler.An IHttpModule is registered in the Web.Config alphabetize and it is notified of every HTTP ask for.
IHttpModule is an interface defined in System.Web.dll.
On the Init method wire up, the behavior-for exemplar commitment events-that you yen the IHttpModule to bear out and bring off any decontaminated up in the Dispose method. The interface contains on the contrary two method signatures: Init and Dispose.