Solved

How to call web service from html href link

Posted on 2015-01-07
2
447 Views
Last Modified: 2015-01-28
I have a requirement to be implemented. The functionality should be same as like Google calender guest invitation. The Application is all about workshop scheduling. When there is new workshop identified mails would be sent to all the members of the application. The mail would have following there html buttons,

test.jpg
all the members would give their wish. When a members clicks yes/no/maybe only the status should be updated in our data base server. New tab or new window should not get opened or the page should not get posted. we have tried with web service by assigning the web service url to buttons but when button is clicked the web service url gets opened in new tab.  Any ideas to over come this issue.
0
Comment
Question by:Loganathan Natarajan
2 Comments
 
LVL 79

Accepted Solution

by:
David Johnson, CD, MVP earned 400 total points
ID: 40537032
on the onclick item for the button in the code behind you do the web service call
0
 
LVL 42

Assisted Solution

by:Rob Jurd, EE MVE
Rob Jurd, EE MVE earned 100 total points
ID: 40537211
To expand on David's comment, this is typically done with ajax, rather than redirecting the user to the url of the webservice.

so you've got the above buttons:

<button id='yes'>Yes</button>
<button id='no'>No</button>
<button id='maybe'>Maybe</button>

using javascript (jquery framework www.jquery.com) you can see an example of this here:

http://jsbin.com/miyeji/1/edit?html,js,output

JavaScript has its own caveats because there is security restrictions that the browser has when it has to access another domain outside of where it is served from.  See CORS for more information http://www.w3.org/TR/cors/
0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
wordpress limitations 4 115
pdf file 7 84
Best way to accomplish this task? 3 87
How do ASP.NET and MVC work together? 4 47
If I have to fix slow responding website my first thoughts are server side optimizations: the database may not be optimized or caching is not enabled, or things like that. We often overlook another major part of our web application: the client. We o…
Developer tools in browsers have been around for a while, yet they are still heavily underused by developers. Developers still fix html or CSS then refresh page to see effect, or they put alert or debugger in JavaScript and then try again and again …
This video teaches users how to migrate an existing Wordpress website to a new domain.
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question