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


C# RouteValueDictionary.GetHashCode方法代码示例

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


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

示例1: SubmitLink

		public static MvcHtmlString SubmitLink(this HtmlHelper helper, string title, string formId, string actionName, string controllerName, ValidationType validationType = ValidationType.All, object htmlAttributes = null, object submitParams = null)
		{
			var url = GetActionUrl(helper.ViewContext.RequestContext, actionName, controllerName);
			var paramsDictionary = new RouteValueDictionary(submitParams);
			var linkTag = GetSubmitTag("a", title, htmlAttributes);
			linkTag.Attributes.Add("href", "#");

			if (paramsDictionary.Count > 0)
			{
				var key = paramsDictionary.GetHashCode();
				var scriptTag = GetWrapperScriptTag(paramsDictionary, key);
				var script = String.Format("submitFormWithParams_{3}(this, event, '#{0}', '{1}', '{2}'); return false;", formId, url, validationType.ToString(), key);
				linkTag.Attributes.Add("onclick", script);
				return MvcHtmlString.Create(scriptTag.ToString(TagRenderMode.Normal) + linkTag.ToString(TagRenderMode.Normal));
			}
			else
			{
				var script = String.Format("submitFormWithoutParams(this, event, '#{0}', '{1}', '{2}'); return false;", formId, url, validationType.ToString());
				linkTag.Attributes.Add("onclick", script);
				return MvcHtmlString.Create(linkTag.ToString(TagRenderMode.Normal));
			}
		}
开发者ID:evkap,项目名称:DVS,代码行数:22,代码来源:SubmitButtonAndLink.cs

示例2: SubmitButton

		public static MvcHtmlString SubmitButton(this HtmlHelper helper, string title, string formId, string actionName, string controllerName, ValidationType validationType = ValidationType.All, object htmlAttributes = null, object submitParams = null, bool addIcon = false, bool isIconFirst = true, string iconClass = null, string additionalScript = null, object routeValues = null)
		{
			if (addIcon)
			{
				var devider = !String.IsNullOrWhiteSpace(title) ? " " : string.Empty;
				var iconTemplate = String.Format("<i class='{0}'></i>", iconClass);
				if (isIconFirst)
				{
					title = String.Format("{0}{2}{1}", iconTemplate, title, devider);
				}
				else
				{
					title = String.Format("{0}{2}{1}", title, iconTemplate, devider);
				}
			}

			var url = GetActionUrl(helper.ViewContext.RequestContext, actionName, controllerName, routeValues);
			var paramsDictionary = new RouteValueDictionary(submitParams);
			var buttonTag = GetSubmitTag("button", title, htmlAttributes);
			buttonTag.Attributes.Add("type", "button");

			if (paramsDictionary.Count > 0)
			{
				var key = paramsDictionary.GetHashCode();
				var scriptTag = GetWrapperScriptTag(paramsDictionary, key);
				var script = String.Format("submitFormWithParams_{3}(this, event, '#{0}', '{1}', '{2}');", formId, url, validationType.ToString(), key);
				script = additionalScript == null ? script : String.Format("{0} {1}", additionalScript, script);
				buttonTag.Attributes.Add("onclick", script);
				return MvcHtmlString.Create(scriptTag.ToString(TagRenderMode.Normal) + buttonTag.ToString(TagRenderMode.Normal));
			}
			else
			{
				var script = String.Format("submitFormWithoutParams(this, event, '#{0}', '{1}', '{2}');", formId, url, validationType.ToString());
				script = additionalScript == null ? script : String.Format("{0} {1}", additionalScript, script);
				buttonTag.Attributes.Add("onclick", script);
				return MvcHtmlString.Create(buttonTag.ToString(TagRenderMode.Normal));
			}
		}
开发者ID:evkap,项目名称:DVS,代码行数:38,代码来源:SubmitButtonAndLink.cs


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