How can I create and use a GridLengthConverter Object ?

The following example shows how to create and use an ‘instance’ of the GridLengthConverter object. The example defines a custom method called ‘changeCol()’, which passes the ListBoxItem to a GridLengthConverter that converts the Content of a ListBoxItem to an instance of GridLength. The converted value is then passed back as the value of the ‘Width’ property of the ColumnDefinition element. [C#] public void changeColVal(object sender, RoutedEventArgs e) { txt1.Text = ‘Current Grid Column is ‘ + hs1.Value.ToString(); } public void changeCol(object sender, SelectionChangedEventArgs args) { ListBoxItem li = ((sender as ListBox).SelectedItem as ListBoxItem); GridLengthConverter myGridLengthConverter = new GridLengthConverter(); if (hs1.Value == 0) { GridLength gl1 = (GridLength)myGridLengthConverter.ConvertFromString(li.Content.ToString()); col1.Width = gl1; } else if (hs1.Value == 1) { GridLength gl2 = (GridLength)myGridLengthConverter.ConvertFromString(li.Content.ToString()); col2.Width = gl2; } else if (hs1.Value == 2) { GridLength gl3 = (GridLength)myGridLengthConverter.ConvertFromString(li.Content.ToString()); col3.Width = gl3; } }

How can the username and password been created from login control?

Drag and Drop the Login Control VS.NET toolbar under Login , change the form name to ‘Login.aspx’. In the web.config file: Add the codings given below <authentication mode=’Forms’> <forms loginUrl=’Login.aspx’ protection=’All’> <credentials passwordFormat=’Clear’> <user name=’Admin’ password=’Admin’/> <user name=’Super’ password=’Super’/> <user name=’User’ password=’User’/> </credentials> </forms> </authentication> When the user name and corresponding password mentioned above are given , then the login operation will be completed successfully.

What is an Literal Control.

The Literal control is similar to the Label control, except the Literal control does not enable you to apply a style to the displayed text.. <div> <asp:Literal ID=’Literal1′ runat=’server’></asp:Literal> </div> protected void Page_Load(object sender, EventArgs e) { Literal1.Text = ‘LiteralTextDemo’; } Now the Resultant text will be in the format: LiteralTextDemo

How to make VS.Net use FlowLayout as the default layout rather than the GridLayout

For VB.NET, go to path C:\Program Files\Microsoft Visual Studio .NET\Vb7\VBWizards\WebForm\Templates\1033 Change the following line in the existing WebForm1.aspx <body MS_POSITIONING='[!output DEFAULT_HTML_LAYOUT]’> to <body> For C#, go to path C:\Program Files\Microsoft Visual Studio .NET 2003\VC#\VC#Wizards\CSharpWebAppWiz\Templates\1033 Change the following line in the existing WebForm1.aspx <body MS_POSITIONING='[!output DEFAULT_HTML_LAYOUT]’> to <body> Note:Before changing any templates it’s a good idea to make backup copies of them Or rather than above approach you can change the behavior for new files on a per project basis in Visual Studio by: Right clicking on the project name (Ex: ‘WebApplication1)’ in Solution Explorer, and select ‘Properties’. From project properties window, under Common Properties>Designer Defaults>Page Layout change ‘Grid’ to ‘Flow’.