This is one method..
Create a javascript funtion as below (please note - Syntax is wrong. .this
is psudo code)
<script>
function Confirm(var QueryParameters)
{
if(window.confirm("'Do you want to process more?"))
{
//javascript code to redirect to specific page with QueryParameters
}
else
{
//javascript code to redirect to main page
}
}
</script>
in code behind after //Form data will be saved into database...
string QueryParameters = //construct query params here
Page.RegisterStartupScript("somename","<script>Con firm(' " + QueryParameters
+ " ') </script>")
When the code behind done with execution, it will emit a javascript to call
the javascript function "Confirm"
"TJ" wrote:
Hi,
I would like to ask something to user after user submits the form...
I know I can ask user whehter they want to submit the form or not using
client-script code such as onClick or onSubmit by adding into attributes
collections...
My problem is a little bit different than that...
I would like to ask user something after submission is done
Suppose that this is the behind code when user clicks the submit button...
private void btnSubmit_Click(object sender, System.EventArgs e)
{
//..blah..
//..blah...
//..blah...
//Form data will be saved into database...
//At this point, I would like to ask user something.like..
// if(confirm('Do you want to process more?') == true) {
// redirect to specific page with QueryParameters
// }
// else
// {
// redirect to main page..
// }
}
Any idea?
Thanks.