R
Regus
I have a form with 2 buttons
* submit
* cancel
When the submit-button is clicked, the form must be submitted. When the
cancel-button is clicked, the page must redirect to the start page.
The problem is this : the cancel-button makes a postback , so my code
doesn't work good. My code is :
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
if page.ispostback then
'submit form
endif
end sub
The cancel-button event
Private Sub Cancel_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs)
Response.Redirect("../start.aspx")
End Sub
In this way, the form is submitted when the submit-button is clicked, but
also when the cancel-button is clicked.
Is there a way to solve this ?
* submit
* cancel
When the submit-button is clicked, the form must be submitted. When the
cancel-button is clicked, the page must redirect to the start page.
The problem is this : the cancel-button makes a postback , so my code
doesn't work good. My code is :
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
if page.ispostback then
'submit form
endif
end sub
The cancel-button event
Private Sub Cancel_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs)
Response.Redirect("../start.aspx")
End Sub
In this way, the form is submitted when the submit-button is clicked, but
also when the cancel-button is clicked.
Is there a way to solve this ?