Tuesday, October 16, 2007

Master pages and child pages -Page Excecution.

Lots of people are in confusion whether the master pages are loaded first or content page(child page is loaded first.I want to make it more clear.

Following is page execution structure of the master page and child pages.

First the controls of the master page will instantiated and then control of the child page is instantiated.

Then the first the page_load event of the child page is executed and then page_load of event is executed.
Share:
Monday, October 15, 2007

What is the diffrence between abstract(must inherit) class and inteface

Following are the main difference between abstract class and interface.

1. Abstract class can contain abstract method while interface does not.
2. Abstract class can contain method body while interface does not.
3. Methods in abstract class can contain any valid access specifier while in interface public access specifier is only allowed.
4. Abstract class can contain methods with body while interface can contain only method signature.

For VB.NET abtract class is must inherit class.
Share:

Overriding static member in child class with C#.NET,VB.NET

Static member are accessible without creating the objects of the class so you don't need to create a object for that class.

Micorosft CLR does not permit the static methods to be override in child class. But off course you can hide the static method of parent method with new keyword in child class. Here is the example of that.


public class A
{
public static virtual void Test()
{
}
}
public class B : A
{
public new override static void Test()
{
}
}
Share:

What is diffrence between string and String in C#.net

There is no diffrence between string and String. string is a alias created by microsoft for System.string.

There are some other datatypes for which microsoft has created the alias.

These are the aliases defined:

string->System.String

sbyte->System.SByte

byte->System.Byte

short->System.Int16

ushort->System.UInt16

int->System.Int32

uint->System.UInt32

long->System.Int64

ulong->System.UInt64

char->System.Char

float->System.Single

double->System.Double

bool->System.Boolean

decimal->System.Decimal
Share:
Tuesday, October 9, 2007

How to insert a item in databound dropdownlist at nth position

Hello guys,

Sorry for not posting anything for long time. Actually i was busy about changing my job.

We have use the dropdownlist with millians of time some developer still does not know that how to insert the listitem at particular level.

Suppose your dropdownlist is having 5 items and it isbound with some datasource and you want to insert "--Select---" on the top of the order. You can do it easily with following code.

DropDownList1.Items.Insert(0, new ListItem("--Select---", "0"));

So "--Select--" will be added at the top of the dropdownlist box. You can add it at any index as you want via specifing index as first argument.

If you are using the asp.net 2.0 then it is having one property
AppendDataBoundItems set it to true and write directly a new list item in html code. It will work.

Happy Programing...


Share:
Friday, August 31, 2007

What is Xaml? XAML-Overview

XAML means Extensible Markup Language is a language to write user interfaces in Windows Presentation Foundation applications. XAML simplifies the creating user interfaces with windows presentation foundation and .net framework 3.0. We can create visible user interface controls and component via XAML.

I have found a great article that articles describes whole aspects of XAML with starting from what is XAML? to next level of programming in .net framework 3.0 and windows presentation foundation.

here is the link for that:
http://msdn2.microsoft.com/en-us/library/ms752059.aspx
Share:

ADO.NET Entity Framework Beta 2 & the 1st Entity Framework Tools CTP Released

Microsoft has recently release ADO.NET Entity Framework Beta 2 and the accompanying Entity Framework Tools CTP have been released!

Following are the added features of latest release:

-Events to customize code generation
-Abstract types in EDM models
-Complex types
- support in metadata files
-Entity key serialization
-Increased persistence ignorance in entity data classes
-Improved connection management in ObjectContext
-Improved DataBinding usability
-Metadata annotations
-Better support for span over LINQ to Entities queries
-Improvements to LINQ queries: additional canonical functions and automatic mapping from CLR functions to server functions
-A new event for extensibility of SaveChanges
-Usability and consistency improvements
-Polymorphic results from stored procedures

You can download it form here:

http://www.microsoft.com/downloads/details.aspx?FamilyId=09A36081-5ED1-4648-B995-6239D0B77CB5&displaylang=en

For more details visit following ado.net team blog post:

http://blogs.msdn.com/adonet/archive/2007/08/27/entity-framework-beta-2-the-1st-entity-framework-tools-ctp-released.aspx

Another link related to ADO.NET Entity framework is following:

http://channel9.msdn.com/ShowPost.aspx?PostID=217633

To know what is ado.net entity framework. Please visit following link:

http://blogs.msdn.com/adonet/archive/2006/07/11/662447.aspx

http://blogs.msdn.com/data/

Share:

Support this blog-Buy me a coffee

Buy me a coffeeBuy me a coffee
Search This Blog
Subscribe to my blog

  

My Mvp Profile
Follow us on facebook
Blog Archive
Total Pageviews