예제 #1
0
        public static MvcHtmlString JQueryRouteLink(this AjaxHelper ajaxHelper, string linkText, string routeName, System.Web.Routing.RouteValueDictionary routeValues, JQueryOptions jQueryOptions, System.Collections.Generic.IDictionary <string, object> htmlAttributes)
        {
            if (string.IsNullOrEmpty(linkText))
            {
                throw new System.ArgumentException("MvcResources.Common_NullOrEmpty", "linkText");
            }
            string targetUrl = UrlHelper.GenerateUrl(routeName, null, null, routeValues ?? new System.Web.Routing.RouteValueDictionary(), ajaxHelper.RouteCollection, ajaxHelper.ViewContext.RequestContext, false);

            return(MvcHtmlString.Create(JQueryExtension.GenerateLink(linkText, targetUrl, JQueryExtension.GetJQueryOptions(jQueryOptions), htmlAttributes)));
        }
예제 #2
0
        public static MvcHtmlString JQueryActionLink(this AjaxHelper ajaxHelper, string linkText, string actionName, string controllerName, string protocol, string hostName, string fragment, System.Web.Routing.RouteValueDictionary routeValues, JQueryOptions jQueryOptions, System.Collections.Generic.IDictionary <string, object> htmlAttributes)
        {
            if (string.IsNullOrEmpty(linkText))
            {
                throw new System.ArgumentException("MvcResources.Common_NullOrEmpty", "linkText");
            }
            string targetUrl = UrlHelper.GenerateUrl(null, actionName, controllerName, protocol, hostName, fragment, routeValues, ajaxHelper.RouteCollection, ajaxHelper.ViewContext.RequestContext, true);

            return(MvcHtmlString.Create(JQueryExtension.GenerateLink(linkText, targetUrl, jQueryOptions, htmlAttributes)));
        }
예제 #3
0
 public static MvcHtmlString JQueryActionLink(this AjaxHelper ajaxHelper, string linkText, string actionName, string controllerName, string protocol, string hostName, string fragment, object routeValues, JQueryOptions jQueryOptions, object htmlAttributes)
 {
     System.Web.Routing.RouteValueDictionary dictionary = new System.Web.Routing.RouteValueDictionary(routeValues);
     System.Collections.Generic.Dictionary <string, object> dictionary2 = JQueryExtension.ObjectToCaseSensitiveDictionary(htmlAttributes);
     return(ajaxHelper.JQueryActionLink(linkText, actionName, controllerName, protocol, hostName, fragment, dictionary, jQueryOptions, dictionary2));
 }
예제 #4
0
 public static MvcHtmlString JQueryRouteLink(this AjaxHelper ajaxHelper, string linkText, string routeName, object routeValues, JQueryOptions jQueryOptions, object htmlAttributes)
 {
     return(ajaxHelper.JQueryRouteLink(linkText, routeName, new System.Web.Routing.RouteValueDictionary(routeValues), jQueryOptions, JQueryExtension.ObjectToCaseSensitiveDictionary(htmlAttributes)));
 }
예제 #5
0
 public static MvcHtmlString GlobalizationScript(this AjaxHelper ajaxHelper, System.Globalization.CultureInfo cultureInfo)
 {
     return(JQueryExtension.GlobalizationScriptHelper(AjaxHelper.GlobalizationScriptPath, cultureInfo));
 }
예제 #6
0
 private static string GenerateLink(string linkText, string targetUrl, JQueryOptions jQueryOptions, System.Collections.Generic.IDictionary <string, object> htmlAttributes)
 {
     return(string.Format("<a href=\"{0}\" onclick=\"{1}\">{2}</a>", targetUrl, JQueryExtension.GenerateAjaxScript(jQueryOptions, "$(this).ajaxLink({0});return false;"), HttpUtility.HtmlEncode(linkText)));
 }
예제 #7
0
 public static JQueryForm JQueryBeginRouteForm(this AjaxHelper ajaxHelper, string routeName, object routeValues, JQueryOptions jQueryOptions, object htmlAttributes)
 {
     System.Collections.Generic.Dictionary <string, object> dictionary = JQueryExtension.ObjectToCaseSensitiveDictionary(htmlAttributes);
     return(ajaxHelper.JQueryBeginRouteForm(routeName, new System.Web.Routing.RouteValueDictionary(routeValues), jQueryOptions, dictionary));
 }