These are several general questions about writing code behind.
I already read some best practices for asp.net
The questions are:
1. Do I need to use interfaces and/or delegates for simple applications? I just cannot get in simple terms WHEN to use them. (I assume that delegates are not necessary is Asp.net, because they are by default)
2. Do we need to turn off viewstate whenever possible? Is it crucial for perfomance?
3. If I retrieve value from database on page load, how do I pass this value to other functions? For example:
protected void Page_Load(object sender, EventArgs e)
{
int GameID = db.Games.Where(p => p.IsActive == true).Select(p => p.GameID).SingleOrDefault();
}
Do I just copy this statement to different function? for example:
protected void Button1_Click(object sender, EventArgs e)
{
int GameID = d ...
Go to the complete details ...