Thursday, July 21, 2011

Some Useful Syntex of Asp.Net.........

No. 1 : For Getting  GridView Row  in any event of GridView and Get RowIndex.......


 GridViewRow grrow = (GridViewRow)(((Control)e.CommandSource).NamingContainer);
 ViewState["RowIndex"] = grrow.RowIndex;

No. 2 : For Filtering Perticuler Row From Asp.Net DataTable........

DataRow[] = .Select("=" + + ""); for example : DataRow[] dr= dtGetempdata.Select("EmpName=" + Girish + "");

Tuesday, July 19, 2011

Creating a dynamically Text File & write in it.........

1.   Add These Two NameSpace in NameSpace Area:

using System.Text;
using System.IO;

2.   And write This code...........

  protected void Button1_Click(object sender, System.EventArgs e)
    {
        string appPath = Request.PhysicalApplicationPath;
        string filePath = appPath + "Text.txt";
        StreamWriter w;
        w = File.CreateText(filePath);
        w.WriteLine("This is a test line.");
        w.WriteLine("This is another line.");
        w.Flush();
        w.Close();
        Label1.Text = "File created and write successfully!";
        Label1.Text += filePath;
    }

Monday, July 18, 2011