I have a c# method for a redirect
[UIAuthentication()]
[UIMethod("cancelredirect", "mth"), UIMethodGroup("employeradmin")]
public void CancelRedirect(RequestContext Context)
{
Context.Redirect(string.Format("View.mth?EmployerID={0}", _employerID));
}
From this I have made a javascript function which is called if the cancel button on a form is pressed.
function getCancel() {
var confirmCancel = confirm('Are you sure you want to cancel?');
if(confirmCancel)
{
//redirect here
}
else
{
return false;
}
};
<input type="submit" id="Cancel" value="Cancel" name="Cancel" class="input_button" onclick="return getCancel();"/>
I was just wondering how would you call the c# method from the javascript to redirect to the page view.mth? I am not 100% sure how to do this as I have never done one one these before. Thanks for any help which you can give