Advantages and disadvantages of using Session State in asp.net
The advantages of using session state are as follows:
It is easy to implement.
It ensures data durability, since session state retains data even if ASP.NET work process restarts as data in Session State is stored in other process space.
It works in the multi-process configuration, thus ensures platform scalability.
The disadvantages of using session state are:
Since data in session state is stored in server memory, it is not advisable to use session state when working with large sum of data. Session state variable stays in memory until you destroy it, so too many variables in the memory effect performance.
The Top in Salary Negotiations
Talking about money with a potential employer might feel a bit awkward, but coming to terms that leave both sides content is crucial. Below, experts offer suggestions on how to prepare for salary negotiations.
Candidates who land offers at the higher end of a salary range are ones who can demonstrate to an employer that they are worth the price. Some ways to do that include:
- Quantifying experience. ("My client increased sales by 8 percent after implementing my marketing idea.")
- Researching the company beforehand so that you can tailor information to its needs. ("I see the company is interested in becoming 'greener.' Here are some ways I might be of help.")
- Pointing out any extras that set you apart (advanced training, special certifications, knowledge of a second language, etc.).
Ideally, both sides should have similar expectations regarding salary by the time an offer is issued. Yet sometimes there are surprises.
Finally, try to view negotiations as seeking a win-win situation for all involved. An employer with enough interest to go through all the stages leading up to an offer has already invested a fair amount of time and energy. The company may be just as eager as you to make things work.
What is partial classess in .net?
When there is a need to keep the business logic separate from the User Interface or when there is some class which is big enough to have multiple number of developers implement the methods in it, the class can be separated and written in different files as partial class.
The keyword partial must appear in each class.
//syntax for C#
Public partial class MyPartialClassOne
{
//code
}
// this code could be in one file
Public partial class MyPartialClassOne
{
//code
}
// this code could be in another file
Interview Questions: What are Properties in .NET, What are the advantages of using Properties in .NET, How to declare a property in .NET?
The primary building block of any .NET object is Data Members. Data members holds data for each objects and thus separates with other members. Properties provide control access to the fields exposed from the class.
Each Properties in .NET is provided with two methods, Get / Set. Get is called whenever the user wants to access the value of the property, while Set is called whenever the value of the property is set.
It is always better to use properties to be exposed publicly from outside rather than public variable. This gives the programmer ability to validate the data before setting it to the member or determine what value to be sent before getting the value. This makes properties in .NET very useful.
Say for instance
// Private variable for the property
private string m_CategoryName = string.Empty;
// Declare the property now
public string CategoryName
{
get { return m_CategoryName; }
set { m_CategoryName = value; }
}
// Private variable for the property
private MyClass mfield = null;
// Declare the property now
public MyClass MyProperty
{
get
{
this.mfield = this.mfield ?? new MyClass(); // Null coalesce
return this.mfield;
}
set
{
if (value == null)
{
//throw exception
}
else this.mfield = value;
}
}
Here mfield is the mapped data element which is set from outside using MyProperty.
Another way of declaring a property
You can also declare properties in the following way.
public MyClass MyProperty { get;set; }
public string CategoryName { get;set; }
Here, you can see that we have declared properties without declaring private data member for them. This works in the same way as the first code snippet as internally, .NET declares a private member for this property.
Will You Lower Your Salary Expectations
If you do find yourself in the latter category, consider the following factors before deciding to lower your salary requirement -- and by how much.
1. Urgency: "If there's less pressure to find something immediately, then [job seekers] may be able to stick closer to their ideal salary expectation – it just may take longer to find something," says Greg Masiewich of IQ Partners, a Canadian recruiting firm. "If someone needs [a job] immediately, then often lowering salary expectations will help them do that."
2. Competition: "An industry where there is a ton of competition and candidates are plentiful may result in people needing to lower salary expectations," Masiewich says. "If they're in a specialized industry where their skills are still in high demand, then they may not have to ... it comes back to supply and demand."
3. Benefits: Consider what extras -- such as an excellent 401(k) plan, flexible scheduling or a family-friendly corporate culture -- are worth to you. Benefits can make up for a smaller salary.
4. Your bottom line: Although you may be willing to take a pay cut in order to get a new job, it's important to figure out your bottom line -- what you need to make in order to pay your bills and live comfortably -- before accepting a lower salary. If you accept too little money, you may find yourself unable to make ends meet or resenting your low pay, and you'll wind up looking for a new job all over again.
5. Negotiation: "If someone does have to accept a lower level position or take a pay cut, I think they should try and negotiate an offer that contains some sort of pay for performance provision," advises Linda Duffy, president of Leadership Habitude, a career strategy consultancy based in Irvine, Calif. "If they can show the prospective employer their added value and help the employer achieve some specific goals, then they would receive a bonus or bump in base pay on a date certain. Not all companies are willing to make that deal, but it doesn't hurt to ask."