string.AddHashFragment(string)

Here are the examples of the csharp api class string.AddHashFragment(string) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

2 Examples 7

1. Example

Project: osharp
Source File: StringExtensionsTests.cs
View license
[Fact()]
        public void AddHashFragmentTest()
        {
            const string url = "http://localhost:801";
            string excepted = url + "#title";
            Assert.Equal(url.AddHashFragment("title"), excepted);
        }

2. Example

View license
HttpResponseMessage Execute()
        {
            var responseMessage = new HttpResponseMessage(HttpStatusCode.Redirect);
            var url = _response.RedirectUri;

            var query = _response.ToNameValueCollection().ToQueryString();

            if (_response.Request.ResponseMode == Constants.ResponseModes.Query)
            {
                url = url.AddQueryString(query);
            }
            else
            {
                url = url.AddHashFragment(query);
            }

            responseMessage.Headers.Location = new Uri(url);

            if (_response.IsError)
            {
                Logger.Info("Redirecting to: " + url);
            }
            else
            {
                Logger.Info("Redirecting to: " + _response.RedirectUri);
            }

            return responseMessage;
        }