How can you apply skin styles to button?

Apply Skin Styles to webcontrols(Textbox,button) private Style CreateStyle(Color backClr, Color foreClr, int borderWidth, string fntName, int fntSize, bool fntBold, bool fntItalic /*Youcanaddmoreparameters to the method */) { Style s = new Style(); s.BackColor = backClr; s.ForeColor = foreClr; s.BorderWidth = borderWidth; s.Font.Name = fntName; s.Font.Size = fntSize; s.Font.Bold = fntBold; s.Font.Italic = fntItalic; return s; } // This method applies a Style object to a WebControl private void SetControlStyle(System.Web.UI.WebControls.WebControl ctrl,Style s) { ctrl.ApplyStyle(s); } private void Button1_Click(object sender, System.EventArgs e) { Style st = CreateStyle(Color.Green, Color.Yellow, 3,’Verdana’, 10, true, true); SetControlStyle(TextBox1, st); st = CreateStyle(Color.Red, Color.Black, 2,’Verdana’, 12, true, true); SetControlStyle(Button1, st); }

How can we convert an ASP.NET page to HTML?

We can use the following codings to convert the ASP.NET page to HTML page, using System; using System.Data; using System.Configuration; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using System.IO; using System.Net; publicpartialclass_Default : System.Web.UI.Page { WebRequest mywebRequest; WebResponse mywebResponse; StreamReader sr; string strHTML; StreamWriter sw; protected void Page_Load(object sender, EventArgs e) { mywebRequest = WebRequest.Create(‘http://www.syncfusion.com/Corporate/default.aspx’); mywebResponse = mywebRequest.GetResponse(); sr = new StreamReader(mywebResponse.GetResponseStream()); strHTML = sr.ReadToEnd(); sw = File.CreateText(Server.MapPath(‘temp.html’)); sw.WriteLine(strHTML); sw.Close(); } } Now the Html Code of (‘http://www.syncfusion.com/Corporate/default.aspx’) will be placed in the application folder by the name temp.html

When I run a page, I get the error ‘The page cannot be displayed’ and an HTTP 502 Proxy Error. Why?

This error can occur if you are running ASP.NET Web pages using the Visual Web Developer Web server, because the URL includes a randomly selected port number. Proxy servers do not recognize the URL and return this error. To get around the problem, change your settings in Internet Explorer to bypass the proxy server for local addresses, so that the request is not sent to the proxy. In Internet Explorer, you can make this change in Tools > Internet Options. In the Connections tab, click LAN Settings and then select Bypass proxy server for local addresses.