namespace NestedClass
{
class Program
{
static void Main(string[] args)
{
A a = new A();
A.AA aa = new A.AA();
}
}
public class A
{
public class AA
{
public int i = 10;
A x = new A();
A.AA xx = new AA();
}
}
}
Tuesday, November 9, 2010
Application state in ASP.NET
- Application is a server side state mechanism in ASP.NET.
- It is a global way to store data in ASP.NET applications.
- It stores as key/value pair.
- application state is an instance of HttpApplicationState class
Different state management techniques in ASP.NET
client side state management techniques:
Server side state management techniques
- ViewState
- ControlState
- Cookies
- Hidden fields
Server side state management techniques
- Session
- Application
String is a reference type. In the below code, what would be the output?
class Program
{
static void Main(string[] args)
{
string s = "abc";
CallMethod(s);
Console.WriteLine(s);
Console.Read();
}
static void CallMethod(string s)
{
s = "xyz";
}
}
Output: abc
{
static void Main(string[] args)
{
string s = "abc";
CallMethod(s);
Console.WriteLine(s);
Console.Read();
}
static void CallMethod(string s)
{
s = "xyz";
}
}
Output: abc
difference between server.transfer and response.redirect
Both Respone.Redirect and Server.Transfer open up another page, but the interaction between client(browser) and server(asp.net) differs in each situation.
Resonse.Redirect simply tell the browser to visit another page.
Its the reponsibility of the browser to open up the another page.
External sites can be opened.
Server.Transfer works for only sites which runs on the server.
External sites cannot be opened.
Sharing states between pages is much easier using Server.Transfer.
Server.Transfer keeps the URL the same. This may lead to confusion.
Resonse.Redirect simply tell the browser to visit another page.
Its the reponsibility of the browser to open up the another page.
External sites can be opened.
Server.Transfer works for only sites which runs on the server.
External sites cannot be opened.
Sharing states between pages is much easier using Server.Transfer.
Server.Transfer keeps the URL the same. This may lead to confusion.
Tuesday, October 19, 2010
unit testing void methods
Assert class does not allow us to test void methods. So the work around would be to throw Exceptions from the void method, and handle it in your test class.
NUnit.Framework provides a method level attibute - ExpectedException for handling exceptions in your test class.
Reference: http://www.nunit.org/index.php?p=exception&r=2.2.10
NUnit.Framework provides a method level attibute - ExpectedException for handling exceptions in your test class.
Reference: http://www.nunit.org/index.php?p=exception&r=2.2.10
Wednesday, August 4, 2010
Team building games
1. fit for you card
- FFY
- its an employee feedback method
- what makes you satisfied work with your organization
- helps to improve relationships with your manager/peer/team lead
2. cross LAVA river & stay safe
- rule1: work together
- rule2: use potoons(paper plates) to cross river.
- rule3: At any point of time human contact should be there on potoons
- rule4: potoons disappear without human contact, so work together
- Good luck and have fun!
potoons - call it as magic plates
3. Musical chair
- strom came and took away
1. everyone whoz wearing company badge
2. everyone who is smart
3. everyone has black hair
4. everyone has black shoe
- If team size is 25, arrange 24 chairs, one person would be the instructor
- You should look for a chair in your right hand side,
- do not sit on the adjacent chair/same chair
- Enjoy!
Note: This is the best game can be played after a heavy lunch as this requires physical invlovement.
References:
Team Building Activities, Initiative Games, & Problem Solving Exercises:
http://wilderdom.com/games/InitiativeGames.html
- FFY
- its an employee feedback method
- what makes you satisfied work with your organization
- helps to improve relationships with your manager/peer/team lead
2. cross LAVA river & stay safe
- rule1: work together
- rule2: use potoons(paper plates) to cross river.
- rule3: At any point of time human contact should be there on potoons
- rule4: potoons disappear without human contact, so work together
- Good luck and have fun!
potoons - call it as magic plates
3. Musical chair
- strom came and took away
1. everyone whoz wearing company badge
2. everyone who is smart
3. everyone has black hair
4. everyone has black shoe
- If team size is 25, arrange 24 chairs, one person would be the instructor
- You should look for a chair in your right hand side,
- do not sit on the adjacent chair/same chair
- Enjoy!
Note: This is the best game can be played after a heavy lunch as this requires physical invlovement.
References:
Team Building Activities, Initiative Games, & Problem Solving Exercises:
http://wilderdom.com/games/InitiativeGames.html
Subscribe to:
Posts (Atom)