I'm having a tiny issue here.. It's a little annoying.. I can't debug my application because of this..
My problem is.. When I try to open a new form automatically by code. It will not open other form. But when you click the button yourself on the form. It will open.. And I think this is a little weird.. Because it uses the same code...
Here is my button code that opens the new form(And it works great.):
private void button1_Click(object sender, EventArgs e)
{
label4.Text = "Login in... Please wait.";
Properties.Settings.Default.username = usernameText.Text;
if (checkBox1.Checked == true)
{
Properties.Settings.Default.check1 = true;
Properties.Settings.Default.password = passwordText.Text;
if (checkBox2.Checked == true)
{
Properties.Settings.Default.check2 = true;
}
}
Properties.Settings.Default.Save();
button1.Enabled = false;
checkBox1.Enabled = false;
checkBox2.Enabled = false;
startLoginWorker();
}
Here is the other code that opens it automatically:
private void loginForm_Load(object sender, EventArgs e)
{
String appDataFolder = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData).ToString();
String gpsPath = appDataFolder + "/GameProfileSaver";
label4.Text = "Checking files...";
if (!File.Exists(gpsPath + #"\ICSharpCode.SharpZipLib.dll") || !File.Exists(gpsPath + #"\ICSharpCode.SharpZipLib.dll"))
{
//startDownload("dll");
button1.Enabled = true;
}
else
{
button1.Enabled = true;
label4.Text = "File check complete. Ready for login.";
progressBar1.Value = 100;
}
if (checkBox2.Checked == true)
{
button1.PerformClick();
}
The "button1.PerformClick()" Just clicks the button by code right? Shouldn't be any difference....
And I have even tried to just put that code into that if statement.. Still nothing.
This is the code that gets run out of it all:
System.Threading.Thread t = new System.Threading.Thread(new System.Threading.ThreadStart(oppenMainForm));
t.SetApartmentState(ApartmentState.STA);
t.Start();
Openmainform:
private void oppenMainForm()
{
Application.Run(new Form1(usernameText.Text));
}
If anyone have any suggestions... Please help me... It's frustrating.
Related
I have a similar question as last time, but no matter how much I hit my head against the wall, solution is not coming. The problem is that the message box gets created too many times, when it should only open once, unsubscribe from documentCompleted and then exit. Thanks again!
private void textBox4_TextChanged(object sender, EventArgs e)
{
if (textBox4.Text.Length >= 3)
{
timer1.Enabled = true;
}
}
private void timer1_Tick_1(object sender, EventArgs e)
{
if (textBox4.Text != "")
{
webBrowser1.ScriptErrorsSuppressed = true;
webBrowser1.Navigate("https://worldofwarcraft.com/en-gb/search?q=" + textBox4.Text);
webBrowser1.DocumentCompleted += GetImg; //sub here
}
}
private void GetImg(object sender, WebBrowserDocumentCompletedEventArgs e)
{
string img_url = "";
foreach (HtmlElement el in webBrowser1.Document.GetElementsByTagName("div"))
{
if (el.GetAttribute("className") == "Avatar-image")
{
img_url = (el.OuterHtml).Substring(el.OuterHtml.IndexOf("https"));
img_url = img_url.Substring(0, img_url.IndexOf(")"));
pictureBox1.ImageLocation = img_url;
}
else if (el.GetAttribute("className") == "Character-level")
{
textBox5.Visible = true;
label7.Visible = true;
string lvl_url = "";
lvl_url = (el.InnerHtml).Substring(3);
lvl_url = lvl_url.Substring(0, lvl_url.IndexOf("<"));
textBox5.Text = lvl_url;
DialogResult YESNO = MessageBox.Show("Is this your character?", "Select your char", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
if (YESNO == DialogResult.Yes)
{
// clean up
webBrowser1.DocumentCompleted -= GetImg; //unsub here
pictureBox1.Enabled = false;
timer1.Dispose();
break;
}
}
}
}
You need to either set timer1.Enabled to false or call timer1.Stop() as soon as you enter the timer1_Tick_1 method, or the timer will keep firing and calling your method every time.
This question already has answers here:
File being used by another process after using File.Create()
(11 answers)
Closed 6 years ago.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.IO;
using Newtonsoft.Json;
namespace Youtube_Player
{
public partial class Authentication : Form
{
public static string AuthenticationApplicationDirectory;
public static string AuthenticationFileName = "Authentication.txt";
StreamWriter w;
public static bool formclosed = false;
static Authentication()
{
AuthenticationApplicationDirectory = Path.GetDirectoryName(Application.LocalUserAppDataPath) + "Authentication";
if (!Directory.Exists(AuthenticationApplicationDirectory))
{
Directory.CreateDirectory(AuthenticationApplicationDirectory);
}
AuthenticationFileName = Path.Combine(AuthenticationApplicationDirectory, AuthenticationFileName);
if (!File.Exists(AuthenticationFileName))
File.Create(AuthenticationFileName);
}
public Authentication()
{
InitializeComponent();
cTextBox1.Text = Form1.AuthenticationValues.ApiKey;
cTextBox2.Text = Form1.AuthenticationValues.UserId;
cTextBox3.Text = Form1.AuthenticationValues.JsonFileDirectory;
label1.Visible = false;
button1.Enabled = false;
button4.Enabled = false;
cTextBox2.WaterMarkForeColor = Color.Blue;
cTextBox3.WaterMarkForeColor = Color.Green;
cTextBox2.WaterMarkActiveForeColor = Color.Blue;
cTextBox3.WaterMarkActiveForeColor = Color.Green;
cTextBox1.ForeColor = Color.Red;
cTextBox2.ForeColor = Color.Blue;
cTextBox3.ForeColor = Color.Green;
cTextBox1.WaterMark = "Enter Api Key";
cTextBox2.WaterMark = "Enter Email Account";
cTextBox3.WaterMark = "Browse To The Json File Location";
}
private void Authentication_Load(object sender, EventArgs e)
{
}
private void cTextBox1_TextChanged(object sender, EventArgs e)
{
if (cTextBox1.Text != "Enter Api Key" && cTextBox1.Text != "")
{
button1.Enabled = true;
}
else
{
button1.Enabled = false;
}
}
private void cTextBox2_TextChanged(object sender, EventArgs e)
{
if (cTextBox2.Text != "Enter Email Account" && cTextBox2.Text != "")
{
button4.Enabled = true;
}
else
{
button4.Enabled = false;
}
}
private void cTextBox3_TextChanged(object sender, EventArgs e)
{
if (cTextBox3.Text != "Browse To The Json File Location" && cTextBox3.Text != "")
button6.Enabled = false;
}
private void button1_Click(object sender, EventArgs e)
{
button1.Text = "Confirmed";
button1.Enabled = false;
label1.Text = "Updating Settings File";
label1.Visible = true;
if (label1.Visible == true)
{
button6.Enabled = false;
button4.Enabled = false;
button1.Enabled = false;
}
FileInfo fi = new FileInfo(AuthenticationFileName);
if (fi.Length == 0)
{
w = new StreamWriter(AuthenticationFileName, true);
w.WriteLine("Api" + "=" + cTextBox1.Text);
w.Close();
}
else
{
w = new StreamWriter(AuthenticationFileName);
w.WriteLine("Api" + "=" + cTextBox1.Text);
w.Close();
}
timer1.Start();
}
private void button4_Click(object sender, EventArgs e)
{
button4.Enabled = false;
label1.Text = "Updating Settings File";
label1.Visible = true;
if (label1.Visible == true)
{
button6.Enabled = false;
button4.Enabled = false;
button1.Enabled = false;
}
w = new StreamWriter(AuthenticationFileName, true);
w.WriteLine("UserId" + "=" + cTextBox2.Text);
w.Close();
timer1.Start();
}
private void button6_Click(object sender, EventArgs e)
{
OpenFileDialog openFileDialog1 = new OpenFileDialog();
openFileDialog1.InitialDirectory = "c:\\";
openFileDialog1.Filter = "Json Files (*.json)|*.json";
openFileDialog1.FilterIndex = 0;
openFileDialog1.RestoreDirectory = true;
openFileDialog1.Multiselect = true;
if (openFileDialog1.ShowDialog() == DialogResult.OK)
{
cTextBox3.BackColor = Color.White;
cTextBox3.ForeColor = Color.Green;
cTextBox3.Text = openFileDialog1.FileName;
label1.Text = "Updating Settings File";
label1.Visible = true;
if (label1.Visible == true)
{
button6.Enabled = false;
button4.Enabled = false;
button1.Enabled = false;
}
w = new StreamWriter(AuthenticationFileName, true);
w.WriteLine("JsonFileDirectory" + "=" + cTextBox3.Text);
w.Close();
timer1.Start();
}
}
private void button2_Click(object sender, EventArgs e)
{
ResetValues(true);
}
int count = 0;
private void timer1_Tick(object sender, EventArgs e)
{
count += 1;
if (count == 2)
{
label1.Visible = false;
timer1.Stop();
count = 0;
}
}
private void Authentication_FormClosing(object sender, FormClosingEventArgs e)
{
ResetValues(false);
}
private void ResetValues(bool DeleteFile)
{
cTextBox1.Text = "";
cTextBox2.Text = "";
cTextBox3.Text = "";
button1.Text = "Confirm";
button4.Text = "Confirm";
button6.Enabled = true;
timer1.Stop();
count = 0;
if (DeleteFile == true)
{
if (File.Exists(AuthenticationFileName))
File.Delete(AuthenticationFileName);
}
Form1.AuthenticationValues.ApiKey = "";
Form1.AuthenticationValues.JsonFileDirectory = "";
Form1.AuthenticationValues.UserId = "";
if (Form1.AuthenticationValues.AuthenticationMenu.Enabled
== false && (Form1.lines.Length < 3 && Form1.lines.Length > 0))
Form1.AuthenticationValues.AuthenticationMenu.Enabled = true;
formclosed = true;
}
}
}
The first problem is in the constructor when checking for the file existing:
if (!File.Exists(AuthenticationFileName))
File.Create(AuthenticationFileName);
This make the file to be busy in use. When later in my code i'm trying to use the file again to write to it i'm getting exception that the file is in use by another process.
The second problem is in the 3 places i'm trying to write to the file.
The first place:
w = new StreamWriter(AuthenticationFileName, true);
w.WriteLine("Api" + "=" + cTextBox1.Text);
w.Close();
Then under it in another place in the code i'm writing again to the file:
w = new StreamWriter(AuthenticationFileName, true);
w.WriteLine("UserId" + "=" + cTextBox2.Text);
w.Close();
And last:
w = new StreamWriter(AuthenticationFileName, true);
w.WriteLine("JsonFileDirectory" + "=" + cTextBox3.Text);
w.Close();
The problems are first the file is busy in use since the checking if exist i'm doing in the constructor.
The second problem is that i want to make that if in the file there is no line that start with "Api" then write the Api part:
w.WriteLine("Api" + "=" + cTextBox1.Text);
But if it does exist and the text is changed in the textBox cTextBox1.Text i want to write to the file the changed text to the place where the Api line is. And to append a new Api line.
Same for all two other places i'm writing to the file.
If i will make it all false not to appen when writing it will write one line each time and will overwrite the line.
But if i'm doing true it will append many Api lines or many UserId lines.
And i want each to time to replace the line with the textBox to overwrite only on this line but with the new text.
If in cTextBox1 there is the text: Hello World
Then i changed it to: Hello World Now
Then replace the Api line Hello World with Hello World Now
Alright, addressing your main concern:
File.CreateFile actually opens a filestream for you to use. Easiest way to solve this is to do File.CreateFile().Close() to close it when you're done.
Next, you are trying to change data in a file, but you never read it to find the information.
You can look up StreamReader and use that, and parse out data and figure out what's where, but there's a much more obvious choice: Just re-write all of the information every time.
I'm writing a program that's supposed to download something off GitHub. It has a link to a raw file on GitHub. I'm using DownloadDataAsync to download it, and I have a progress bar to track how far it is in the download. It always gets to 100%, but then it does nothing.
I've been following a tutorial for a C# updater by BetterCoder (The beginning starts here and the most relevant part would be Part 9 of the series).
This is the part where it stops working properly:
private void DownloadUpdate(SaveyourUpdateXML update)
{
SharpUpdateDownloadForm form = new SharpUpdateDownloadForm(update.Uri, update.MD5, this.applicationInfo.ApplicationIcon);
Debug.WriteLine("form created");
DialogResult result = form.ShowDialog(this.applicationInfo.Context);
Debug.WriteLine("got result");
if (result == DialogResult.OK)
{
String currentPath = this.applicationInfo.ApplicationAssembly.Location;
String newPath = Path.GetDirectoryName(currentPath) + "\\" + update.FileName;
UpdateApplication(form.TempFilePath, currentPath, newPath, update.LaunchArgs);
Application.Exit();
}
}
It never gets to the "got result" part unless I cancel it. Also, this.applicationInfo.Context returns a form. However, it does say "form created".
I think there's something wrong with the way ShowDialog is used or something, but I'm not really sure what.
Edit: This is what happens when a SharpUpdateDownloadForm is created.
internal SharpUpdateDownloadForm(Uri location, String md5, Icon programIcon)
{
InitializeComponent();
if (programIcon != null)
{
this.Icon = programIcon;
}
tempFile = Path.GetTempFileName();
this.md5 = md5;
webClient = new WebClient();
webClient.DownloadProgressChanged += new DownloadProgressChangedEventHandler(webClient_DownloadProgressChanged);
webClient.DownloadFileCompleted += new AsyncCompletedEventHandler(webClient_DownloadFileCompleted);
bgWorker = new BackgroundWorker();
bgWorker.DoWork += new DoWorkEventHandler(bgWorker_DoWork);
bgWorker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(bgWorker_RunWorkerCompleted);
try
{
webClient.DownloadDataAsync(location, this.tempFile);
}
catch
{
this.DialogResult = DialogResult.No;
this.Close();
}
}
This is what should happen when a download is completed:
private void webClient_DownloadFileCompleted(object sender, AsyncCompletedEventArgs e)
{
if (e.Error != null)
{
this.DialogResult = DialogResult.No;
this.Close();
}
else if (e.Cancelled)
{
this.DialogResult = DialogResult.Abort;
this.Close();
}
else
{
lblProgress.Text = "Verifying Download...";
progressBar.Style = ProgressBarStyle.Marquee;
bgWorker.RunWorkerAsync(new string[] {this.tempFile, this.md5});
}
}
This is bgWorker_RunWorkerCompleted
private void bgWorker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
{
this.DialogResult = (DialogResult)e.Result;
this.Close();
}
And bgWorker_DoWork
private void bgWorker_DoWork(object sender, DoWorkEventArgs e)
{
String file = ((string[])e.Argument)[0];
String updateMD5 = ((string[])e.Argument)[1];
if (Hasher.HashFile(file, HashType.MD5) != updateMD5)
e.Result = DialogResult.No;
else
e.Result = DialogResult.OK;
}
When webClient.DownloadDataAsync completes, it fires DownloadDataCompleted event, not DownloadFileCompleted - the one you registered.
The fix is, if you use webClient.DownloadDataAsync, register the DownloadDataCompleted event; Note that the 2nd argument to webClient_DownloadDataCompleted is different.
webClient.DownloadDataCompleted += new DownloadDataCompletedEventHandler(webClient_DownloadDataCompleted);
...
private void webClient_DownloadDataCompleted(Object sender, DownloadDataCompletedEventArgs e)
{
...
}
I have created gui for windows form....!
one side i have groupbox with checkbox and two buttons ">>" and "<<" and on the other side i have one more groupbox.
I need to select one checkbox at a time if the user select more than one checkbox i need to raise error..
if the user selects checkbox and click on ">>" button i need to display number of messages in the other groupbox i.e in the "List of Selected Commands"...
and on the click of ">>" the selected list of message should be deleted from list.
I have included tab control in my gui on click of this tab i need to display some list of commands how can i do it...
can any one help me on this...
This is the code..
namespace Menu_Sample
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
groupBox1.Text = "MSC";
groupBox2.Text = "List Of Selected Commands";
checkBox1.Visible = false;
cb2.Visible = false;
cb3.Visible = false;
cb4.Visible = false;
label1.Visible = false;
label2.Visible = false;
label3.Visible = false;
label4.Visible = false;
}
private void submenu1ToolStripMenuItem_Click(object sender, EventArgs e)
{
groupBox1.Text = "ICP";
checkBox1.Visible = true;
cb2.Visible = true;
cb3.Visible = true;
cb4.Visible = true;
}
private void checkBox1_CheckedChanged(object sender, EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
if (checkBox1.Checked == true)
{
label1.Visible = true;
label1.Text = "ibit";
groupBox2.Controls.Add(label1);
label2.Visible = true;
label2.Text = "Cbit";
groupBox2.Controls.Add(label2);
label3.Visible = true;
label3.Text = "Kbit";
groupBox2.Controls.Add(label3);
label4.Visible = true;
label4.Text = "ibit";
groupBox2.Controls.Add(label4);
}
if (cb2.Checked == true)
{
label1.Visible = true;
label1.Text = "ibit";
groupBox2.Controls.Add(label1);
label2.Visible = true;
label2.Text = "Cbit";
groupBox2.Controls.Add(label2);
label3.Visible = true;
label3.Text = "Kbit";
groupBox2.Controls.Add(label3);
label4.Visible = true;
label4.Text = "ibit";
groupBox2.Controls.Add(label4);
}
}
private void btn6_Click(object sender, EventArgs e)
{
if (label1.Enabled==true)
{
label1.Text = "";
}
}
private void btn5_Click(object sender, EventArgs e)
{
label1.Text = "";
label2.Text = "";
label3.Text = "";
label4.Text = "";
}
private void submenu2ToolStripMenuItem_Click(object sender, EventArgs e)
{
groupBox1.Text = "MCP";
}
private void mDPToolStripMenuItem_Click(object sender, EventArgs e)
{
groupBox1.Text = "MDP";
}
private void mRPPToolStripMenuItem_Click(object sender, EventArgs e)
{
groupBox1.Text = "MRPP";
}
}
}
I am giving you an idea, that how we can do that.
You have to create a group box click event and then use loop for the controls in that groupbox and if that control is checkbox and it is checked, then you just count that no-other checkbox should be checked.
I will be available with the code very shortly.
I have a pretty interesting dilemma that is giving me a hurricane of a headache. I've seen a similar question asked here, but the user posted no code, so it was unresolved. This is a asp.net, sql server, and c# app.
In my application, I use JavaScript to display dummy data in a TextBox to entertain the user while a long process is running. (please note, this is a project, not a professional app).
The problem is, once the app is done executing, the app (I believe) refreshes the page and clears the TextBox. I want to prevent this from happening and continue to display the text after the program is completed.
My question is, where in the following code is the page being refreshed? How can I re-code it to prevent the text from being cleared?
I know there is no issue with the JavaScript or the .aspx page. I have not set or programmed any property to clear the text. If anyone could shed light on the issue, I would greatly appreciate it. If you need more code from me please let me know. I will be very active on this page until it is resolved. Thanks again!
public partial class SendOrders : System.Web.UI.Page
{
protected enum EDIType
{
Notes,
Details
}
protected static string NextBatchNum = "1";
protected static string FileNamePrefix = "";
protected static string OverBatchLimitStr = "Batch file limit has been reached. No more batches can be processed today.";
protected void Page_Load(object sender, EventArgs e)
{
Initialize();
}
protected void Page_PreRender(object sender, EventArgs e)
{ }
protected void btnExit_Click(object sender, EventArgs e)
{
System.Diagnostics.Process.GetCurrentProcess().Kill();
}
protected void Button_Click(object sender, EventArgs e)
{
PutFTPButton.Enabled = false;
Thread.Sleep(3000);
Button btn = (Button)sender;
KaplanFTP.BatchFiles bf = new KaplanFTP.BatchFiles();
KaplanFTP.Transmit transmit = new KaplanFTP.Transmit();
if (btn.ID == PutFTPButton.ID)
{
DirectoryInfo dir = new DirectoryInfo(#"C:\Kaplan");
FileInfo[] BatchFiles = bf.GetBatchFiles(dir);
bool result = transmit.UploadBatchFilesToFTP(BatchFiles);
if (!result)
{
ErrorLabel.Text += KaplanFTP.errorMsg;
return;
}
bf.InsertBatchDataIntoDatabase("CTL");
bf.InsertBatchDataIntoDatabase("HDR");
bf.InsertBatchDataIntoDatabase("DET");
bf.InsertBatchDataIntoDatabase("NTS");
List<FileInfo> allfiles = BatchFiles.ToList<FileInfo>();
allfiles.AddRange(dir.GetFiles("*.txt"));
bf.MoveFiles(allfiles);
foreach (string order in bf.OrdersSent)
{
OrdersSentDiv.Controls.Add(new LiteralControl(order + "<br />"));
}
btnExit.Visible = true;
OrdersSentDiv.Visible = true;
OrdersInfoDiv.Visible = false;
SuccessLabel.Visible = true;
NoBatchesToProcessLbl.Visible = true;
BatchesToProcessLbl.Visible = false;
PutFTPButton.Enabled = false;
BatchesCreatedLbl.Text = int.Parse(NextBatchNum).ToString();
Thread.Sleep(20000);
if (KaplanFTP.errorMsg.Length != 0)
{
ErrorLabel.Visible = false;
SuccessLabel.Visible = true;
ErrorLabel.Text = KaplanFTP.errorMsg;
}
}
}
private void Initialize()
{
KaplanFTP.BatchFiles bf = new KaplanFTP.BatchFiles();
if (!IsPostBack)
{
FileNamePrefix = bf.FileNamePrefix;
NextBatchNum = bf.NextBatchNum;
BatchesCreatedLbl.Text = (int.Parse(NextBatchNum) - 1).ToString();
if (bf.CheckLocalForNewBatch() == true)
{
NoBatchesToProcessLbl.Visible = false;
BatchesToProcessLbl.Visible = true;
if (int.Parse(NextBatchNum) >= 50)
{
ErrorLabel.Text += ErrorLabel.Text + OverBatchLimitStr;
ErrorLabel.Visible = true;
PutFTPButton.Enabled = false;
}
else
{
bf.ReadyFilesForTransmission();
ErrorLabel.Visible = false;
PutFTPButton.Enabled = true;
List<string[]> detStream = bf.GetBatchStream("DET");
List<string[]> hdrStream = bf.GetBatchStream("HDR");
OrdersInfoDiv.Visible = true;
DataTable dt = new DataTable();
dt.Columns.Add("ORDER NUMBER");
dt.Columns.Add("LINE NUMBER");
dt.Columns.Add("ITEM NUMBER/ISBN");
dt.Columns.Add("DESCRIPTION");
dt.Columns.Add("QUANTITY");
dt.Columns.Add("SHIPPING");
Dictionary<string, string> orderShip = new Dictionary<string, string>();
foreach (string[] hdrItems in hdrStream)
{
orderShip.Add(hdrItems[0], hdrItems[2]);
}
foreach (string[] detItems in detStream)
{
List<string> detLineList = new List<string>(detItems);
detLineList.Add(orderShip[detItems[0]]);
detLineList.RemoveAt(13);
detLineList.RemoveAt(12);
detLineList.RemoveAt(11);
detLineList.RemoveAt(10);
detLineList.RemoveAt(9);
detLineList.RemoveAt(8);
detLineList.RemoveAt(7);
detLineList.RemoveAt(4);
detLineList.RemoveAt(2);
detLineList[1] = detLineList[1].TrimStart('0');
detLineList[4] = detLineList[4].TrimStart('0');
dt.Rows.Add(detLineList.ToArray());
}
BatchDetails.DataSource = dt;
BatchDetails.DataBind();
}
}
else
{
NoBatchesToProcessLbl.Visible = true;
BatchesToProcessLbl.Visible = false;
PutFTPButton.Enabled = false;
}
}
}
}
Yes. You will have to determine the state of your calculation and populate the control inside Page_Load in the case where IsPostBack is true:
protected void Page_Load(object sender, EventArgs e) {
if (IsPostBack) {
// re-populate javascript-fill UI
} else {
}
Initialize();
}
You can probably also move Initialize() into the else clause as well.
Since you are handling the button click server side (I'm assuming the problem is happening once the user clicks the button?) there has to be a postback to handle it.
You could try putting your button and label into an updatepanel control - it uses AJAX to refresh its contents.
See this page for more information on updatepanels.