how to clear textbox when page is refreshed asp.net c# heres my code not working Code: protected void Page_Load(object sender, EventArgs e) { if(!IsPostBack) { TextBox1.Text = ""; } } Code: protected void Button1_Click(object sender, EventArgs e) { TextBox1.Text = "test"; }
crisjala
Posts
-
how to clear textbox when page is refreshed asp.net c# -
Pls help! how to prevent user to delete prefix value in my texboxi want that my prefix or my first 4 char value in my textbox which is "SPR-" cannot be deleted or modify by the user...how to code that.. plz.
-
HOW TO FIX THIS EVERYTIME I ADD DATA IN MY DATA TABLE THE LASTROW AND FIRSTROW ARE THES SAME [modified]HOW TO ELIMINATE ONE
DataTable dt = dataSet1.Tables["tmpItem_aux"]; DataRow newRow = dt.NewRow(); newRow["itemcode"] = itemcodeTextBox.Text.ToString(); newRow["itemDesc"] = itemDescTextBox.Text.ToString(); newRow["quantity"] = quantityTextBox.Text.ToString(); newRow["unitPrice"] = unitPriceTextBox.Text.ToString(); newRow["total"] =totalTextBox.Text.ToString(); dt.Rows.Add(newRow);
OUTPUT SAMPLE ITEMCODE ITEMDESC QUANTITY UNITPRICE TOTAL TEST123 ITEMTEST 1 50 50 --------SAME IN LASTROW SAMPLE1 ITEMSAMPLE 2 100 200 SAMCODE SAMDESC 3 20 60 TEST123 ITEMTEST 1 50 50 --------SAME IN FIRST ROWmodified on Friday, May 14, 2010 2:34 AM
-
Hi! is it possible that my dbase is sql2005 using php and javascriptHi! is it possible that my dbase is sql2005 using php and javascript becoz our existing system te dbase is sql2005 and we want to publish our system in web using php and javascript but our database is sql2005
-
how to display two column value in combobox DisplayMemberhi i'm having hard time on how to display two column values in combox display member..like custID and custName...any sample code plz help
-
How to filter two columns in bindingsourcehi i want to filter base on lastname and firstname encode by the user in textbox1 and texbox2.. but i'm having hard time for the right code for this..heres my code but not functioning.. plz help hows the right way..
bindingSource1.Filter = "LASTNAME like '" + textBox1.Text.Trim() + "%'" AND FIRSTNAME like '" + textBox2.Text.Trim() + "%'"; bindingSource1.Sort = "LASTNAME";
-
plz help!!error use of unassigned local variablehi i just want to display all empty fieldnames that are not filled up by the user but my code has this errorer ' use of unassigned local variable 'messEmptyField' ; how can i fix this
private void btnSave_Click(object sender, EventArgs e) { string[] FieldName = { "Lastname", "Firstname", "Address", "Model", "Trouble Reported" }; string messEmptyField; int i = 0; foreach (Control ctrl in groupBox1.Controls) { TextBox txt = ctrl as TextBox; if (txt.Text == string.Empty) { messEmptyField += FieldName[i]; //error use of unassigned local variable 'messEmptyField' } i++; } MessageBox.Show(messEmptyField + "please filled up all"); dtDateLog.Focus(); return; }
-
how to get the row index value in datagridviewhi i have a form name frmDataEntry with textboxCustID and textboxCustName and lookup form name frmCustAssist with texboxFilter, button Filter and datagridview then when i double click textboxCustID then frmCustAssist will show i have to look if customer already exist or not then if already exist i hav to get the value of row index ..then the custID and custName of that value selected will be fill in the formDataEntry in textboxCustID and textboxCustName how do code that that plz help my code is here..
in a frmCustAssist private void button1_Click(object sender, EventArgs e) { bindingSource1.Filter = "LASTNAME like '%" + textBox1.Text + "%'"; bindingSource1.Sort = "LASTNAME"; selected row value .. somwthing like that }
in a frmDataEntry selected value custID =textboxCustID selected value custname = textboxCustName -
How do i filter in bindingsourcei want to filter something like string type in my textbox but my code is not working..how do i fix this
private void button1_Click(object sender, EventArgs e) { bindingSource1.Filter = "LASTNAME = LIKE% + textBox1.Text"; bindingSource1.Sort = "LASTNAME ASC"; }
-
how to trap masktextbox control if empty or not filled by userhere's my code but its not functioning plz help how to fix this.... i set my masktextbox to filled up telephone number only
private void button1save_Click(object sender, EventArgs e) { if (maskedTextBox2tel.text == string.Empty) { MessageBox.Show("Plz fill up tel No"); maskedTextBox2tel.Focus(); } }
-
how to empty textbox in a groupboxtnx dude
-
how to empty textbox in a groupboxhi i hava a groubox contain 5 textbox control and i want to empty the all textbox i'm having hard time to solve pls any idea..
-
how can i enable back newToolStripMenuItem to trueerror does not exist in the current context
-
how can i enable back newToolStripMenuItem to truei cant get the intelisense of newToolStripMenuItem.Enabled = true; in the event private void frm2_FormClosed(object sender, FormClosedEventArgs e) my newToolStripMenuItem is in my form1 and i want to show the form2 but disable the newToolStripMenuItem if form2 is loade already. and if form2 is close then the newToolStripMenuItem is enabled
-
how can i enable back newToolStripMenuItem to truemy main form is form1.
private void newToolStripMenuItem_Click(object sender, EventArgs e) { newToolStripMenuItem.Enabled = false; Form2 frm2 = new Form2(); frm2.Owner = this; frm2.Show();
how can i enable back newToolStripMenuItem to true if the form2 to is closed i tried to create if form2 close event but i can't get the intelisense of newToolStripMenuItem -
my function not functioningi want to validate first if the form is already loaded or not. if it is already loaded the form will just prompt it again perform it windows state to normal and focus but does not duplicate the form..
private void newToolStripMenuItem_Click(object sender, EventArgs e) { if (IsFormLoaded("form2")) { return; } Form1 frmshow = new Form1(); frmshow.MdiParent = this; frmshow.Show(); } private bool IsFormLoaded(string formName) { bool Load = false; for (int i = 0; i < (this.OwnedForms.Length) - 1; i++) { if (this.OwnedForms[i].Name.ToString().TrimStart() == "formName") { this.OwnedForms[i].WindowState = FormWindowState.Normal; this.OwnedForms[i].Focus(); Load = true; } } return Load; }
-
what wrong with my code [modified]private void newToolStripMenuItem_Click(object sender, EventArgs e) { if (IsFormLoaded("form1")) return; else { Form1 frmshow = new Form1(); frmshow.MdiParent = this; frmshow.Show(); } } private bool IsFormLoaded(string formName) { bool FormLoaded = false; for (int i = 0; i < (this.OwnedForms.Length) - 1; i++) { if (this.OwnedForms[i].Name.ToString().TrimStart() == "formName") { this.OwnedForms[i].WindowState = FormWindowState.Normal; this.OwnedForms[i].Focus(); FormLoaded = true; } } return FormLoaded; } not functioning modified on Sunday, March 7, 2010 9:52 PM
-
HOW TO TRAP FORM TO LOAD ONLY ONCEcan you give me sample sir on how to do it...
-
HOW TO TRAP FORM TO LOAD ONLY ONCEHI I'M NEW TO C# I'M CREATING MENU AND DONE BUT THE PROBLEM IS WHEN I CLICK THE MENU ITEM 3 TIMES THE FORM WILL SHOW 3 TIMES AND I WANT TRAP THAT IF THE FORM ALREADY LOADED YOU CANT OPEN THE FORM TWICE UNLESS THE USER CLOSE THE FORM.. HOW TO TRAP FORM TO LOAD ONLY ONCE
-
how to disable/enable toolstrip menu item [modified]but i want it programmatically in code because every time the user click the menuItem the form is loaded it disable the menuItem evrytimthe form is close it will enable the menuItem