5 Technical Reasons to update your website now

Like everything in physical world, websites also degrade over time and may become unusable if not updated from time to time. Here are 5 reasons that may happen.

  1. Update to Browsers:Most popular browsers release several new versions every year. Firefox received more than 12 releases in as many months and chrome version has increased by 12 in last year. It not only impacts their security and performance but also changes how it handles certain features of pages and HTML. It ensures that over time, your site visitor’s experience degrades unless you keep your site updated.

  2. Updates to Google’s Search Algorithm: Google continuously updates its search algorithm to offer the most relevant search results as well as to filter out fake or irrelevant content. It also gives priority to sites which follow more user friendly practices like having SSL or being mobile friendly. There were 5 updates to their search algorithm in 2017 alone. Review your site to ensure that you are following those best practices. Read a few pointers here.

  3. Mobile Phone Usage: Mobile internet usage has crossed desktop usage since some time now. It is important that if you have a website, it is usable on a mobile. It not only turns off the visitor, it turns off google which brings visitors. Even if you are not in the SEO game, you will need to ensure that it works for a visitor who is very likely using mobile device to access your site.

  4. HTML 5 and HTTP 2: HTML 5 has introduced many improvements and features which improve page speed and security. Most major browsers have stopped supporting flash since then. HTTP2 technically does not change how the site is coded but it will definitely help to look at all the css, js, images that are used on your site and identify the scope for improvements in download speed if your hosting provider supports http2 compatible servers.

  5. Updates to CMS and Frameworks: Popular CMS like WordPress, Opencart, Drupal etc. release new versions with bug fixes, improved security, new features and several updates to keep up with all of the above. By updating your CMS you are making it easier to be browser and standard compliant, user friendly as well as search engine friendly.

When was the last time you reviewed your site? Request a free 10 point check on your site from here.

New Use For Control Adapters 1

Control adapters were much discussed when they came out with asp.net 2.0 but nobody seems to have done anything beyond what was given at http://www.asp.net/cssadapters/ .
We found a useful application that solved another problem and I feel there may be more uses we can put it to. Here is the first one we discovered.

The problem
Like most applications, we needed tabs.  JS tabs without iframes would mean keeping all the data on same page. That would have made it complex and data intensive JS tabs would also require a conscious effort so that they degrade gracefully. Another issue was to implement security feature where certain tabs would not be available based on roles of the user.  Maintaining tab selection on postback was another problem.
Iframes are loose and require much more effort to stop them from ruining user experience in some cases with large number of fields and several grids and buttons on a single tab in addition to having some of the problems described above.
Finally we decided that it was best to have separate pages and not use js/iframe based tabs for our purpose.

The Solution:

For a while we used a solution where we created a ul and hide or disabled items as needed.
Later when we were trying to implement a menu adapter for office bar/Ribbon, I realized that it can also be used for generating the tabs as we need.
It would

  1. Make the solution generic.
  2. Integrate with regular .Net security infrastructure
  3. Remove what was essentially a navigation control logic from UI.
The solution was simple enough. We just needed to render appropriate set of ul and li and style them properly.

private void BuildTab(MenuItemCollection TabItem, HtmlTextWriter Writer,string MenuMode)
Writer.Write(“<ul class=’tabsubnav’ id=’ulsubnav’>”);
      int i = 0;
      if (TabItem.Count > 0)
            foreach(MenuItem item in TabItem)
                  string classval = “Unselected”;
                  if (MenuMode== “Add” && i != 0)
                        item.Enabled = false;
                        classval = “selected”;
                  if (HttpContext.Current.Request.
QueryString.Count > 0)
                      item.NavigateUrl += “?” +
                      item.Enabled = true;
                  Writer.Write(“<li id=’tabBasicInfo’>”);
                  if (item.Enabled == true)
Writer.Write(“<a href=” + item.NavigateUrl +
” class='” + classval +“‘><b><span>” +
item.Text + “</span></b></a>”);
                        classval = “disabled”;
                        item.NavigateUrl = “javascript:void(0)”;
                        Writer.Write(“<a href=” + item.NavigateUrl
+ ” class='” + classval + “‘><b><span>” +
item.Text + “</span></b></a>”);

About done.

As soon as this adapter was added to the browser file, it screwed up the Ribbon. Asp.Net Development does not allow to use multiple adapter for the same control for a given browser configuration or to choose adapter on the fly. We were already using menu adapter for the Ribbon. The solution was simply to inherit and create a new class from the asp.net menu.

class Tab : Menu

No additional code was needed.
Sitemap configuration took care of the security aspect of tabs.


   <siteMapNodeurl=~/School.aspxtitle=School roles=Access_School />
   <siteMapNodeurl=~/Locations.aspxtitle=Locationroles=Access_Location />
siteMapNodeurl=~/Grade.aspxtitle=Graderoles=Access_Grade />
siteMapNodeurl=~/Room.aspxtitle=Roomroles=Access_Room” />

The top level node is just to group the children and is not displayed. Thus we can have multiple tab sets configured in a single sitemap file.


Extension Method

Its a very frequent requirement that we have to enable/disable or hide a control based on some business logic. In one particular case, it had to be configurable by administrator as part of security and general administrative control of the site. This implied that it had to work with all the controls on the page with which user can interact and even some labels.
The controls had to be disabled according to configuration but we found out that not all webcontrols can be disabled. Surprisingly a label can be enabled and a hidden field has a visible property. It was decided that those which could not be disabled had to be made invisible.
I needed a way to disable or hide (depending on what was allowed) controls based on a condition. While this could have been as easily done in a loop with an if else block, this seems much easier to read and write. Fortunately Disable property is not used by Web Controls.


    public static void Disable(this Control c)
        Type t = c.GetType();
        PropertyInfo p = t.GetProperty(“Enabled”);
        if (p == null)
            PropertyInfo p1 = t.GetProperty(“Visible”);
            p1.SetValue(c, false, null);
            p.SetValue(c, false, null);

Label.Disable() would disable the label and
HiddenField.Disable() would make it invisible!!.

Kaira Software is Leading ASP.Net web Development, web development Company in India.