How to find the date and time the specified file or directory was last written to
Use namespace System.IO VB.NET dim path as string = Server.MapPath(‘page1.aspx’) Response.Write ( File.GetLastWriteTime(path)) C# string path =Server.MapPath(‘page1.aspx’); Response.Write ( File.GetLastWriteTime(path));
How to convert Color to it’s corresponding Hexadecimal value
VB.NET Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load ’Put user code to initialize the page here Response.Write(ToHexColor(Color.Blue)) End Sub Function ToHexColor(ByVal c As Color) As String Return ‘#’ + c.ToArgb().ToString(‘x’).Substring(2) End Function C# private void Page_Load(object sender, System.EventArgs e) { // Put user code to initialize the page here Response.Write(ToHexColor(Color.Blue)); } string ToHexColor(Color c ) { return ‘#’ + c.ToArgb().ToString(‘x’).Substring(2); }
Why do I get Compilation error ‘<Control> is not a member of <Page>’
You may get this error if you have not give runat=server for a tag
How can I enforce that only one radiobutton gets selected among a list of Radiobutton controls
Set same Groupname for the radiobutton controls
How to read data from the XML file using FileStream and display it in a DataGrid
Use namespace System.IO VB.NET dim ds as new DataSet() dim fs as FileStream = new FileStream (Server.MapPath (‘products.xml’),FileMode.Open , FileAccess.Read ) ds.ReadXml (fs) DataGrid1.DataSource = ds DataGrid1.DataBind () C# DataSet ds= new DataSet (); FileStream fs = new FileStream (Server.MapPath (‘products.xml’),FileMode.Open , FileAccess.Read ); ds.ReadXml (fs); DataGrid1.DataSource = ds; DataGrid1.DataBind ();