Version

Support for Granular ViewState and Setting Client IDs

The new Microsoft® Visual Studio® 2010 now supports enabling ViewState on individual controls and setting client IDs. All of our Ultimate UI for ASP.NET controls support these two features. You can now enable ViewState at the control level rather than enabling at the page level, resulting in high performance. ViewState can be enabled on the controls using the ViewStateMode property which takes an enumeration that has three values: Enabled, Disabled and Inherit. Taking WebTab as an example:

In HTML:

<ig:WebTab ID="WebTab1" runat="server" Height="200px" Width="300px" ViewStateMode="Enabled">
<tabs>
         <ig:ContentTabItem runat="server" Text="Tab 1">
          </ig:ContentTabItem>
           <ig:ContentTabItem runat="server" Text="Tab 2">
            </ig:ContentTabItem>
        </tabs>
 </ig:WebTab>

In C#:

WebTab1.ViewStateMode = System.Web.UI.ViewStateMode.Enabled;

In Visual Basic:

In VB:
WebTab1.ViewStateMode = System.Web.UI.ViewStateMode.Enabled

You can now specify more accurately how the client Id should be generated for the controls using the ClientIDMode which takes one of these values : AutoID, Static, Predictable and Inherit.

Note
Note:

The EnableViewState property of the controls takes precedence over the ViewStateMode property.

In HTML:

<ig:WebTab ID="WebTab1" runat="server" Height="200px" Width="300px" ClientIDMode= "Predictable" >
        <tabs>
            <ig:ContentTabItem runat="server" Text="Tab 1">
            </ig:ContentTabItem>
            <ig:ContentTabItem runat="server" Text="Tab 2">
            </ig:ContentTabItem>
        </tabs>
</ig:WebTab>

In C#:

WebTab1.ClientIDMode = System.Web.UI.ClientIDMode.Predictable;

In Visual Basic:

WebTab1.ClientIDMode = System.Web.UI.ClientIDMode.Predictable

For mor information, see the whitepaper ASP.NET 4 and Visual Studio 2010 Web Development Overview.