当前位置: 首页>>代码示例>>C#>>正文


C# HttpResponseMessage.GetDirectUriRequest方法代码示例

本文整理汇总了C#中System.Net.Http.HttpResponseMessage.GetDirectUriRequest方法的典型用法代码示例。如果您正苦于以下问题:C# HttpResponseMessage.GetDirectUriRequest方法的具体用法?C# HttpResponseMessage.GetDirectUriRequest怎么用?C# HttpResponseMessage.GetDirectUriRequest使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Net.Http.HttpResponseMessage的用法示例。


在下文中一共展示了HttpResponseMessage.GetDirectUriRequest方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: RenderOpenIdMessageTransmissionAsAnchorAttributes

		/// <summary>
		/// Adds attributes to an HTML &lt;A&gt; tag that will be written by the caller using
		/// <see cref="HtmlTextWriter.RenderBeginTag(HtmlTextWriterTag)" /> after this method.
		/// </summary>
		/// <param name="writer">The HTML writer.</param>
		/// <param name="response">The response.</param>
		/// <param name="windowStatus">The text to try to display in the status bar on mouse hover.</param>
		protected void RenderOpenIdMessageTransmissionAsAnchorAttributes(HtmlTextWriter writer, HttpResponseMessage response, string windowStatus) {
			Requires.NotNull(writer, "writer");
			Requires.NotNull(response, "response");

			// We render a standard HREF attribute for non-javascript browsers.
			writer.AddAttribute(HtmlTextWriterAttribute.Href, response.GetDirectUriRequest().AbsoluteUri);

			// And for the Javascript ones we do the extra work to use form POST where necessary.
			writer.AddAttribute(HtmlTextWriterAttribute.Onclick, this.CreateGetOrPostAHrefValue(response) + " return false;");

			writer.AddStyleAttribute(HtmlTextWriterStyle.Cursor, "pointer");
			if (!string.IsNullOrEmpty(windowStatus)) {
				writer.AddAttribute("onMouseOver", "window.status = " + MessagingUtilities.GetSafeJavascriptValue(windowStatus));
				writer.AddAttribute("onMouseOut", "window.status = null");
			}
		}
开发者ID:Adilson,项目名称:dotnetopenid,代码行数:23,代码来源:OpenIdRelyingPartyControlBase.cs

示例2: CreateGetOrPostAHrefValue

		/// <summary>
		/// Gets the javascript to executee to redirect or POST an OpenID message to a remote party.
		/// </summary>
		/// <param name="requestRedirectingResponse">The request redirecting response.</param>
		/// <returns>
		/// The javascript that should execute.
		/// </returns>
		private string CreateGetOrPostAHrefValue(HttpResponseMessage requestRedirectingResponse) {
			Requires.NotNull(requestRedirectingResponse, "requestRedirectingResponse");

			Uri directUri = requestRedirectingResponse.GetDirectUriRequest();
			return "window.dnoa_internal.GetOrPost(" + MessagingUtilities.GetSafeJavascriptValue(directUri.AbsoluteUri) + ");";
		}
开发者ID:Adilson,项目名称:dotnetopenid,代码行数:13,代码来源:OpenIdRelyingPartyControlBase.cs


注:本文中的System.Net.Http.HttpResponseMessage.GetDirectUriRequest方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。