protected void Page_Load(object sender, EventArgs e) { if (settings == null) { settings = new BingSettings(); settings = settings.Load(); } btn_Save.Click += new EventHandler(btn_Save_Click); btn_Cancel.Click += new EventHandler(btn_Cancel_Click); if (!Page.IsPostBack) { tbx_BingUser.Text = settings.User; tbx_BingAPI.Text = settings.API; } }
public void ProcessRequest(HttpContext context) { BingSettings settings = new BingSettings(); settings = settings.Load(); context.Response.ContentType = "text/xml"; context.Response.Cache.SetCacheability(HttpCacheability.NoCache); StringBuilder bing = new StringBuilder(); bing.AppendLine("<?xml version=\"1.0\"?>"); bing.AppendLine("<users>"); bing.Append("<user>"); bing.Append(settings.User); bing.Append("</user>"); bing.AppendLine("</users>"); context.Response.Write(bing.ToString()); context.Response.Flush(); }