Link to home
Start Free TrialLog in
Avatar of vbhargav80
vbhargav80

asked on

asp.net LinkButton - DO an ajax request and then submit the form

Dear experts,

I have a form and to submit the form I am using a linkButton. My linkbutton also does some client side validation before submitting the form. A requiremtn has now come in that I do some server side validation before submitting the form. This means the linkbutton first needs to send an ajax request (without doing a page refresh) and based on the result give the user a modal popup. On the modal popup if the user clicks continue, i need to submit the form otherwise cancel submitting the form.

I am really stuck and have no idea if/how thsi can be achieved. Please help!
SOLUTION
Avatar of amar31282
amar31282
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of mahadevan_v
mahadevan_v

I will give you an overview of how it can be done ..

1. write a javascript function and attach it to the link button ,
2. In that function send an ajax request to the page where you have the server side validation.
    Return a value from the server page
3. On the function which process the response, compare the value from server , then open a modal dialog using showmodal dialog function
vReturnValue = window.showModalDialog()
4. now check the return value from the modal for submitting or cancel page progress


Avatar of vbhargav80

ASKER

My LinkButotn already has some javascript attached to it which is doing the client side validation. How can I attach 2 different pieced of javascript to it, 1 that does client side and 1 that does server side?
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial