All pastes #182860 Raw Edit

Untitled

public text v1 · immutable
#182860 ·published 2006-09-26 12:36 UTC
rendered paste body
protected void FormView1_ItemUpdating(object sender, FormViewUpdateEventArgs e)
		{
			if (Page.IsValid)
			{
				string name = ((TextBox)FormView1.FindControl("NameTextBox")).Text;
				// int carBodyId = int.Parse(Request.QueryString["id"]);
				if (CarBody.Exists(name, Id))
				{
					// cancel update operation
					e.Cancel = true;
					this.ShowMessage(CarBodyDuplicateErrorMessage);
				}
				else
				{
					// update item
					bool archived = ((CheckBox)this.FormView1.FindControl("ArchivedCheckBox")).Checked;
					CarBody .Update(Id, name, archived);
					this.RefreshParentWindow();
					this.ClosePopup();
				}
			}
		}