예제 #1
0
        public bool IsEqualTo(IUrl other, bool caseSensitive)
        {
            if (other == null)
            {
                return(false);
            }

            if (caseSensitive)
            {
                return(this.ToString() == other.ToString());
            }
            else
            {
                return(this.ToString().ToLower() == other.ToString().ToLower());
            }
        }
예제 #2
0
 public static MvcForm BeginForm(this HtmlHelper htmlHelper, IUrl url, FormMethod method, IDictionary<string, object> htmlAttributes)
 {
     var builder = new TagBuilder("form");
       builder.MergeAttributes(htmlAttributes);
       builder.MergeAttribute("action", url.ToString());
       builder.MergeAttribute("method", HtmlHelper.GetFormMethodString(method), true);
       if (htmlHelper.ViewContext.ClientValidationEnabled)
       {
     builder.GenerateId("form0");
       }
       htmlHelper.ViewContext.HttpContext.Response.Write(builder.ToString(TagRenderMode.StartTag));
       var form = new MvcForm(htmlHelper.ViewContext);
       if (htmlHelper.ViewContext.ClientValidationEnabled)
       {
     // htmlHelper.ViewContext.FormContext.ClientValidationEnabled = true;
     htmlHelper.ViewContext.FormContext.FormId = builder.Attributes["id"];
       }
       return form;
 }
예제 #3
0
 public void SetExportUrl(IUrl ui)
 {
     txtUrl.Text = ui.ToString();
 }
 public static string Url(this HtmlHelper htmlHelper, IUrl url)
 {
   return url.ToString();
 }