M
mark
i have a form with buttons - when a button is pressed a boolean is set to
true
to show that the record has been edited
i have lots of buttons and i seem to lose the value on the boolean on page
reload
im using code behind in VB with asp
eg
two example buttons
Private Sub factfindcomp_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles factfindcomp.Click
factfindcomplabel.Text = Date.Today
factfindcomplabel.Visible = True
factfindcomp.Visible = False
LiveEdited = True
End Sub
Private Sub complia_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles complia.Click
compltext.Text = Date.Today
compltext.Visible = True
complia.Visible = False
LiveEdited = True
End Sub
when i click another button called save
it checks the state of liveedited = if its true it saves - only problem is
var liveedited seems to be not keeping its value between button presses
eg
If LiveEdited = True Then
Dim a As String = DBAccess.UpdateLive(mainid, msl, pit, prt, smo, ma, dtma,
ms, lend, lr, sol, off, "", com, comp, poscomnot, "", "", "", tsl, cc, "",
"", mr, "", outc, offchk, "", ffc, subtyp)
If a = "ERROR - Function Is Broke" Then
RegisterStartupScript("startupScript", "<script
language=JavaScript>alert('ERROR 102');</script>")
End If
LiveEdited = False
only seems to be doing it on button clicks
how can i assure save state on a boolean ?
cheers mark
ive tried viewstate but i cant seem to get it to work!
true
to show that the record has been edited
i have lots of buttons and i seem to lose the value on the boolean on page
reload
im using code behind in VB with asp
eg
two example buttons
Private Sub factfindcomp_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles factfindcomp.Click
factfindcomplabel.Text = Date.Today
factfindcomplabel.Visible = True
factfindcomp.Visible = False
LiveEdited = True
End Sub
Private Sub complia_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles complia.Click
compltext.Text = Date.Today
compltext.Visible = True
complia.Visible = False
LiveEdited = True
End Sub
when i click another button called save
it checks the state of liveedited = if its true it saves - only problem is
var liveedited seems to be not keeping its value between button presses
eg
If LiveEdited = True Then
Dim a As String = DBAccess.UpdateLive(mainid, msl, pit, prt, smo, ma, dtma,
ms, lend, lr, sol, off, "", com, comp, poscomnot, "", "", "", tsl, cc, "",
"", mr, "", outc, offchk, "", ffc, subtyp)
If a = "ERROR - Function Is Broke" Then
RegisterStartupScript("startupScript", "<script
language=JavaScript>alert('ERROR 102');</script>")
End If
LiveEdited = False
only seems to be doing it on button clicks
how can i assure save state on a boolean ?
cheers mark
ive tried viewstate but i cant seem to get it to work!