Assign Url.AbsoluteUri URL in ASP.NET

Is it possible to assign an Url.AbsoluteUri in ASP.NET?

0
source share
3 answers

No, this property is read-only.

You can create a new Uri though:

 var url = new Uri("http://absoluteurl.example.com"); // url.AbsoluteUri is now "http://absoluteurl.example.com" 
+1
source share

No, you can’t. But you can create a Uri with the AbsoluteUri desire by building one:

 Uri url = new Uri("http://www.google.com"); 
0
source share

No, you cannot, it is derived from a URI. See the MSDN documentation for Uri.AbsoluteUri .

Example from MSDN

 Uri baseUri = new Uri("http://www.contoso.com"); Uri myUri = new Uri(baseUri,"catalog/shownew.htm?date=today"); 
0
source share

All Articles