Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Page (load twice)

Status
Not open for further replies.

NaiDanac

Programmer
Mar 25, 2004
96
US
I've got a page with the following:

label1 (Are you sure you want to save)
label2 (Your data has been saved)

textbox1 (data)
textbox2 (data)
textbox3 (data)

button1(Save)
button2(Cancel)

I intially show everything except form label2. Once the user clicks on save, I run a procedure to write the textbox data to the db, and then I would like to redisplay the same page, but with label2 instead of label1. This way I don't have to duplicate the page (since the only diff would be in the labels).

Is there a way of doing this?

Thanks
 
you dont even need two labels. After the post back of the page just set the display of the label to the new Text.

Public sub Save_Click(Sender As Object, e As EventArgs)

'Write to the Database

'set label text
label1.text = "Its Saved"

End Sub

Hope this helps!

Rob
 
Yes, but how do I reload the page!

I should mention that the textbox values are being retrieved from another page through the following piece of code:

Code:
Dim objName As name
            objName = CType(context.Handler, name)
            lbltextbox1.Text = objName.Gettextbox1
            lbltextbox2.Text = objName.Gettextbox2
            lbltextbox3.Text = objName.Gettextbox3

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top