Skip to main content

Posts

Showing posts from May, 2013

Can we run asp.net application without WEB.CONFIG file ?

Yes, we can run an asp.net application without the WEB.CONFIG file. If we are not setting any configuration in WEB.CONFIG file then it will take MACHINE.CONFIG file for default configurations. This config file will automatically installed when your application getting executed. i.e MACHINE.CONFIG file contains defaults settings for all the asp.net web applications. Because all the configuration settings will be available under MACHINE.CONFIG file by default these settings will be applied to all asp.net applications. Note: Web application run without web.config but the run without debugging mode  In 2005 The VS When we trying to run first time any application the 2005 VS gives us warning that want to run application without web.config file. The MACHINE.CONFIG file will be automatically loaded when .net framework is installed. 

About The X: prefix?

In the previous root element example, the prefix x: was used to map the XAML namespace http://schemas.microsoft.com/winfx/2006/xaml , which is the dedicated XAML namespace that supports XAML language constructs. This x: prefix is used for mapping this XAML namespace in the templates for projects. The XAML namespace for the XAML language contain several programming constructs that you will use very frequently in your XAML. The following is a listing of the most common x: prefix programming constructs you will use:  x:Key: Sets a unique key for each resource in a ResourceDictionary (or similar dictionary concepts in other frameworks) Example < Grid >     < Grid.Resources >         < Style x : Name ="StyleName" x : Key ="StyleKey" />     </ Grid.Resources >     < Button Style ="{ StaticResource StyleKey }" /> </ Grid > x:Class: Specifies the CLR namespace and class name for the class that

WPF: TextBlock Vs Label

Every WPF developer asked himself is why we have Label and TextBlock controls in WPF When it used. TextBlock and Label both are used to display text. TextBlock Label Textblock inherits from FrameworkElement Label Inherits from System.Windows.Control Lightweight Heavy Weight control Does not Supports access key Label supports access key TextBlock don’t have the IsEnabled Proerty Label’s IsEnabled property returns false its text color change into gray Simple control More complex control TextBlock does not have link to other controls as Target It has a Target property Label has an important focus handling responsibility. Its purpose is to allow you to place a caption with an access key. It has a Target property, which indicates the target of the access key.  Example < Label Target ="{Binding ElementName=name}"> User Name: &

How to check that RadioButtonList has a selected value

RadioButtonList has two property to find out any item is selected or not. 1) SelectedIndex 2) SelectedItem HTML < asp : RadioButtonList ID ="RadioButtonList1" runat ="server"> < asp : ListItem Value ="0" Selected ="True"> YES </ asp : ListItem > < asp : ListItem Value ="1"> NO </ asp : ListItem > </ asp : RadioButtonList > Sometime you need to check to see if a value has been selected before you do anything in coding CS Code if (RadioButtonList1.SelectedItem != null ) {      RadioButtonList1.SelectedItem.Selected = false ; } Or  if (RadioButtonList1.SelectedIndex<>-1) {      RadioButtonList1.SelectedItem.Selected= false ; }