News

This blog has been shifted to Innovation Escalator.

Sunday, July 31, 2011

How to use multiview in asp.net ??

Multiview and view were the new controls added in ASP.NET 2.0, these controls are very much useful in making tab like control and may be used to create simple image gallery with previous and next buttons. In this tutorial I will explain you how to use multiview and view as a simple image gallery, the tab control will be published after this tutorial on readers appeal.
Here are the simple steps to start working with multiview and view controls:

STEP 1: You need to just drag and drop the multiview control and the number of views you want inside that multiview. (Note - views can only be taken inside a multiview).
It should appear somewhat like the fig below:



 Step 2: Now you need to set the content of each view control, content can be any thing i.e. simple plain text or images or any other asp or HTML control, here we are building a image gallery so we will use images as our content.
Step 3: As from the name multiview its clear that you can set multiple views to a single control and at a time only one is visible, so now its time to change controls on user choice, i will do it on a button click you may do it on whichever event you like. Firstly on page load event we need to set the first view as a default view, he code of this is written in page load function
 protected void Page_Load(object sender, EventArgs e)
{
          if (!IsPostBack)
          {
                     MultiView1.SetActiveView(View1);
                     Label1.Text = MultiView1.Views.Count.ToString();
           }
}
here MultiView1 is the name of the multiview taken and SetActiveView method is used to set the view in active mode i.e which is visible, here its View1. Here the Label1 is used to take a record currently which view is set in active mode.
now on button click you need to change the active view which can be simply done by SetActiveView(). I have taken two buttons Prev and Next. Prev buttons takes you to the previous image and the next button to the next image in the gallery.
Function on Next Button Click

    protected void Next_Click(object sender, EventArgs e)
    {
           int index = MultiView1.ActiveViewIndex;
           int count = Convert.ToInt32(Label1.Text);
           if (index == 0)
             Prev.Enabled = true;
           index = index + 1;
           MultiView1.SetActiveView(MultiView1.Views[index]);
           if (index+1 == count)
            Next.Enabled = false;
    }
Function on Prev Button Click
    protected void Button1_Click(object sender, EventArgs e)
    {
            int index = MultiView1.ActiveViewIndex;
            int count = Convert.ToInt32(Label1.Text);
            if (index+1 == count)
             Next.Enabled = true;
            index = index - 1;
            MultiView1.SetActiveView(MultiView1.Views[index]);
            if (index == 0)
             Prev.Enabled = false;
    }
The above code uses a label which stores the index of the current active view and the index variable stores the number of views present in that multiview:
int index = MultiView1.ActiveViewIndex;
the above line i.e. ActiveViewIndex() gets the number of views present in a multiview.
Hope you enjoy making your image gallery using a simple multiview control rather that using large javascripts.
Request for source code if needed and tab control tutorial via multiview.

Wednesday, June 8, 2011

World IPv6 Day, June 8


Today 8 June, 2011, Google, Facebook, Yahoo!, Akamai and Limelight Networks will be amongst some of the major organisations that will offer their content over IPv6 for a 24-hour “test flight”. The goal of the Test Flight Day is to motivate organizations across the industry – Internet service providers, hardware makers, operating system vendors and web companies – to prepare their services for IPv6 to ensure a successful transition as IPv4 addresses run out.

As the Internet developed there was debate over the network communications protocol to use, but ultimately the fourth revision of IP (IPv4) was implemented for communication between computers and networks. When the Internet was small the 32-bit addressing of IPv4 that limits it to just over 4 billion addresses was perfectly adequate, but recently the last sets of IPv4 addresses have been issued, meaning the size of the IPv4 Internet has reached its maximum.
To overcome this limitation, the Internet Engineering Task Force has been developing a 128-bit addressing system called IPv6 that allows for trillions upon trillions of additional unique addresses (340 undecillion, to be exact). Unfortunately, the addressing between these protocols is vastly different and not directly compatible, and networking companies have been reluctant to implement IPv6 while there was still room for IPv4. Nevertheless, the symbolic limit of IPv4 has come and the pressure is high for companies to start implementing IPv6 if they have not already done so.

What this means is that if you are using various Internet services tomorrow and are experiencing loss of connectivity or slowdowns, then be aware that this is likely because of problems with the IPv6 protocol. Some of the problems you may encounter during these tests include:
  1. Internet servers not responding
  2. intermittent connectivity after delays
  3. unresponsive browsers if you use a built-in search field
  4. slow loading and pauses in downloads, as well as incomplete downloads; and
  5. slow or incomplete actions for Internet-related activities that aren't Web browsing, such as syncing and e-mail.
To help prevent these problems from happening, you can make sure your system is configured to use IPv6 if your ISP supports it.

~via Internet Society