Solved

How to call web service from html href link

Posted on 2015-01-07
2
455 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 80

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 43

Assisted Solution

by:Rob
Rob 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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Windows Process running 3 58
Reason for High TTFB 1 70
What the difference between blend and Visual Studio 3 167
Where did System.Data.Objects go? 2 40
New Relic: Our company recently started researching several products to figure out what were the best ways for us to increase our web page speed and to quickly identify performance problems that we may be having. One of the products we evaluated wa…
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 …
Use Wufoo, an online form creation tool, to make powerful forms. Learn how to selectively show certain fields based on user input using rules to gather relevant information and data from your forms. The rules feature provides you with an opportunity…
Learn how to set-up custom confirmation messages to users who complete your Wufoo form. Include inputs from fields in your form, webpage redirects, and more with Wufoo’s confirmation options.

808 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