views:

64

answers:

1

In c# i need to frame the folllowing URL dynamically,here Action is redirectURL and the Controller is Books,when i post the page i send the url to some other page in follwing format.is it posible to frame the URL with "localhost:7187" dynamically? http://localhost:7187/Books/redirectURL

A: 

Folllwing way i framed the url(http://localhost:7187/Books/redirectURL) dynamically

Classname.WebsitePath + VirtualPathUtility.ToAbsolute(Url.Action("redirectURL", "Books"));

public static string WebsitePath { get { return HttpContext.Current.Request.Url.GetLeftPart(UriPartial.Authority); } }

Nathan