How to write XML file by using dotnet code?

void CreateXmlFile(String xmlFilePath) { XmlTextWriter xmlWriter = new XmlTextWriter(xmlFilePath, Encoding.UTF8); xmlWriter.WriteStartDocument(true); xmlWriter.WriteStartElement(“Departments”); //Root Element xmlWriter.WriteStartElement(“Department”); //Department Element xmlWriter.WriteStartAttribute(“Name”); //Attribute “Name” xmlWriter.WriteString(“Development”); //Attribute Value xmlWriter.WriteEndAttribute(); xmlWriter.WriteStartElement(“Employees”); //Started Employees Element xmlWriter.WriteStartElement(“Employee”); //Started Employee Element xmlWriter.WriteStartAttribute(“Name”); //Attribute “Name” xmlWriter.WriteString(“Sabu C.Alex”); //Attribute Value xmlWriter.WriteEndAttribute(); xmlWriter.WriteStartAttribute(“Age”);//Attribute “Age” xmlWriter.WriteString(“28”);//Attribute Value xmlWriter.WriteEndAttribute(); xmlWriter.WriteString(“Sabu C.Alex is working as… Continue reading

How to set Globalization setting in web.config for all application?

<globalization enableClientBasedCulture=”true|false” requestEncoding=”any valid encoding string” responseEncoding=”any valid encoding string” fileEncoding=”any valid encoding string” responseHeaderEncoding = “any valid encoding string” resourceProviderFactoryType = “string” enableBestFitResponseEncoding = “true|false” culture=”any valid culture string” uiCulture=”any valid culture string”/>

Is it possible to prevent a browser from caching an ASPX page?

Just call SetNoStore on the HttpCachePolicy object exposed through the Response object’s Cache property, as demonstrated here: <%@ Page Language=”C#” %> <html> <body> <% Response.Cache.SetNoStore (); Response.Write (DateTime.Now.ToLongTimeString ()); %> </body> </html> SetNoStore works by returning a Cache-Control: private, no-store header in the HTTP response. In this example, it prevents… Continue reading