protected void btnScriptDelete_Click(object sender, EventArgs e) { OSAEScriptManager.PatternScriptDelete(hdnSelectedScriptID.Text); loadScripts(); int selectedRow = Int32.Parse(hdnSelectedScriptRow.Text) - 1; if (selectedRow < 0) { hdnSelectedScriptRow.Text = ""; } else { hdnSelectedScriptRow.Text = selectedRow.ToString(); } }