I have the below c#.net code which works and returns me the url.I want to write equivalent code from javascript/jquery .
HttpContextBase httpContext = new HttpContextWrapper(HttpContext.Current);
Uri uri = httpContext.Request.Url;
string url = UrlHelper.GenerateContentUrl(imageSource, httpContext);
Is there any way I can write its equivalent code in the jquery/javascript or is there a way I can call this c# code from javascript if I have it in a method?