Mar 27, 2014

Formatting

asp:GridView

 <asp:BoundField DataField="DueDate" HeaderText="Date Requested" SortExpression="DueDate"  DataFormatString="{0:M/d/yyyy}"  >

  <asp:BoundField DataField="PlanAsset" HeaderText="Assets" SortExpression="PlanAsset" ItemStyle-HorizontalAlign="Right"  DataFormatString="{0:C2}"> <HeaderStyle />




 string CensusFileUrl = null;

Session["DataItemName"].ToString();
Session["AllocationNumber"] != null
 Session["PrevccStatusID"] = null,"";

((Label)Master.FindControl("lblMstrHead")).Text = "Retirement Solutions";

Session["InvestmentGroupID"] = Request.QueryString["InvestmentGroupID"];
int.Parse(Session["ProductId"].ToString())
int refId = Convert.ToInt32(Session["UserRefflId"].ToString());



Session["SelectedMenuName"] = "investmentPaging";

protected string SelectedMenuName
        {
            get
            {
return Session["SelectedMenuName"] != null ? Session["SelectedMenuName"].ToString() : "";
            }
        }
        if (resultSet.Count() != 0)
{ grdInvestment.DataSource = resultSet; grdInvestment.DataBind(); } else { this.lblMsg.Attributes.CssStyle.Add("font-size", "30px") lblMsg.Text = "Information not found"; }




        string tableName;
        if(!Page.IsPostBack)
            {            
                tableName = Request.QueryString["tableName"];
                if(!string.IsNullOrEmpty(tableName))
                {
                    this.LoadSearchDropdownList(tableName);
                }
            }

if (Request.QueryString["ProductId"] !=null )
                {
                    Session["ProductId"] = Request.QueryString["ProductId"];
                    Session["InvestmentGroupID"] = null;
                }

Conditional (Ternary) Operator (?:)

condition ? first_expression : second_expression;

int input = Convert.ToInt32(Console.ReadLine());
string classify;

// if-else construction.
if (input > 0)
    classify = "positive";
else
    classify = "negative";

// ?: conditional operator.
classify = (input > 0) ? "positive" : "negative";

?? operator is called the null-coalescing operator.
The null-coalescing operator (??) is used to define a default value for a nullable type. It returns the left-hand operand if it is not null; otherwise it returns the right operand. When we work with databases, we often deal with absent values. These values come as nulls to the program. This operator is a convenient way to deal with such situations.
http://weblogs.asp.net/scottgu/archive/2007/09/20/the-new-c-null-coalescing-operator-and-using-it-with-linq.aspx









No comments:

Post a Comment