Last post Nov 03, 2009 06:28 AM by kirank28
Nov 03, 2009 01:59 AM|kirank28|LINK
i have also put using System.web; refrence but still i m getting this Error
Error: CS0103: The name 'UrlEncode' does not exist in the current context
string strPost = NvpRequest + "&" + buildCredentialsNVPString();
strPost = strPost + "&BUTTONSOURCE=" + UrlEncode(BNCode);
Nov 03, 2009 05:32 AM|ratish_shriyan|LINK
You need to use this,
if you are writing code in the ASPX code behind then you can use,
Hope this helps!
Nov 03, 2009 05:44 AM|nimish_soft|LINK
Nov 03, 2009 05:53 AM|kirank28|LINK
sorry i m getting this Error
The type name 'UrlEncode' does not exist in the type 'System.Web.HttpServerUtility'
on Cs i m just mentioning same .
can i add any refrence for same ?
Nov 03, 2009 05:57 AM|ratish_shriyan|LINK
That was a mistake, use the Server.UrlEncode
Nov 03, 2009 06:05 AM|kirank28|LINK
but where i can use this ?
strPost = strPost + "&BUTTONSOURCE=" + Server.UrlEncode(BNCode);
but it gives an Error 'Server' does not exist in the current context
i have add ref. using System.web; also
Nov 03, 2009 06:11 AM|malcolms|LINK
Try adding HttpContext.Current.Server.UrlEncode.
Nov 03, 2009 06:12 AM|ratish_shriyan|LINK
We assume that you are writing the code in your ASPX code behind. Is that right ?
If yes the your Page, class exposes a property called Server, that how you get to call this method like for example,
protected void Page_Load(object sender, EventArgs e)
string myString = this.Server.UrlEncode("some string");
Nov 03, 2009 06:28 AM|kirank28|LINK
thx malcolms & satish
HttpContext.Current.Server.UrlEncode this get work