Kendo UI – Drop down list Setting Value autoBind = false setting

I am evaluating kendo ui right now to use in our big application. We have a situation where we have much values in dropdowns (like 200+) and there are more than 1 drop down with that size. So if we have a complex form. The Page Load takes time to render the form. (Due to that each box needs to be loaded from service and filled up).

We avoided this by writing our own asp.net web control with on demand support (like autoBind property) in the drop down list in kendo ui.

Now, DropDownList from KendoUI serves the purpose with autobind = false, BUT when setting value it fetches data from remote binding first and then selects appropriate value. (this is cool and really good for small lists) but Potentially this will mean that when we load the page and set the value it will issue remote binding calls for each of the drop downs.

Now,

Can we set value/ text to appear without issuing the remote binding. We want remote binding to be done ONLY when the user clicks on the drop down itself. (not when we are filling form). This will save extra calls to system and help quickly render the form to user.

Here is JS Bin

http://jsbin.com/ayivad/3/edit

If somebody from kendo ui would like me to help out – let me know, but this idea will allow us to use kendo ui drop downs with good use.

Read full post thread here ….

http://stackoverflow.com/questions/16803782/kendo-ui-drop-down-list-setting-value-autobind-false-setting

 

JQuery Mobile and Asp.net WebForms 4.5

Hi,

I was searching for some examples on the responsive web design and frameworks and i was impressed by JQuery mobile and it’s roadmap towards the future and it’s broad capabilities. You can view JQuery Mobile at http://view.jquerymobile.com/1.3.0/

So, in further searches – it was obvious that lesser people have tried it with web forms. I didn’t find any examples (may be there are.. but nothing good appeared on google search).

So here is a another to the point simple example:

Steps

  1. Create Empty Web Forms Project (VS 2012)
  2. From NuGet – Add Jquery
  3. Add Jquery UI (For normal site)
  4. Add JQuery Mobile (For Mobile Site)
  5. Add “Site.Master” Master page
  6. Add “Site.Mobile.Master” Page (To used as master page for mobile site)
  7. Add Default.aspx
  8. Add Default.mobi.aspx
  9. Add Global.asax

Main Idea

“Every .aspx page in normal page has its respective .mobi.aspx” It’s hybrid project and we will simple use asp.net url routing to map if the request comes from mobile site (only in case of .aspx) – All other things remain same.

So,

Here are questions:

  1. How to do URL Rewrite?
  2. How to setup jQuery Mobile?

1- How to do URL Rewrite?

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.SessionState;
using System.Web.Routing;
namespace Test.WebWithMobile
{
public class Global : System.Web.HttpApplication
{
        protected void Application_BeginRequest(object sender, EventArgs e)
        {
            if (Request.Browser.IsMobileDevice)
            {
                //Request.Url.MakeRelativeUri(new Uri(Request.Url.AbsoluteUri)).ToString() + Request.Url.AbsoluteUri.Replace(“.aspx”, “.mobi.aspx”)
                if ((!Request.Url.OriginalString.ToLower().Contains(“mobile”)
                    && Request.Url.OriginalString.ToLower().EndsWith(“.aspx”))
                    || Request.Url.OriginalString.IndexOf(“.aspx”) == -1)
                {
                    var url = Request.Url.OriginalString;
                    if (url.ToLower().IndexOf(“.aspx”) == -1)
                        url += “Default.aspx”;
                    url = url.Replace(“.aspx”, “.mobi.aspx”);                    
                    var path = Request.Url.MakeRelativeUri(new Uri(url));
                    HttpContext.Current.RewritePath(“~/” + path);
                }//Request.ApplicationPath);
            }
}
}

2- How to setup jQuery Mobile?

<head runat=”server”>
<meta name=”viewport” content=”width=device-width, initial-scale=1, maximum-scale=1″ />
<title></title>
<link href=”Content/jquery.mobile-1.3.0.min.css” rel=”stylesheet” />
    <script src=”Scripts/jquery-1.9.1.min.js”></script>
    <script src=”Scripts/jquery.mobile-1.3.0.min.js”></script>
<asp:ContentPlaceHolder ID=”head” runat=”server”>
</asp:ContentPlaceHolder>

</head>
<body>
<form id=”form1″ runat=”server”>
<div data-role=”page”>
            <div data-role=”header”>Mobile Header</div>
            <div data-role=”content”>
<asp:ContentPlaceHolder ID=”ContentPlaceHolder1″ runat=”server”>
</asp:ContentPlaceHolder>
</div>
        </div>
</form>
</body>

That’s It !!!

Surprised … but that’s it… This will get your going with query mobile and setting up web solution.

  1. Intro to JQuery Mobile
  2. Responsive Web Design
  3. PluralSight Training
  4. Download Source Code

JQM