web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Routing Visual Studio web service

(0) ShareShare
ReportReport
Posted on by

Hi, I have a web service that creates an event, I use a form to call it. But the routing on Visual Studio is not working.

<div class="jumbotron">
<h1>ASP.NET</h1>
<p class="lead">ASP.NET is a free web framework for building great Web sites and Web applications using HTML, CSS, and JavaScript.</p>
<p><a href="http://www.asp.net" class="btn btn-primary btn-lg">Learn more &raquo;</a></p>
</div>


<div>

<input type="text" id="nombreEvento" placeholder="Nombre del evento"/>
<input type="text" id="capacidad" placeholder="Capacidad" />
<input type="button" value="Enviar" onclick="add();"/>
</div>

<script src="ajax.aspnetcdn.com/.../jquery-2.2.4.js"></script>

<script>
function add() {
var nombre = $('#nombreEvento').val();
var capacidad = $('#capacidad').val();

if (nombre != "") {
var Evento = {
Nombre: nombre,
Capacidad: capacidad
};

var info = JSON.stringify(Evento);
$.get('localhost/.../Values', info , function (data) {

alert("El Evento ha sido creado");
location.reload();
});
}
else {
alert("Todos los campos son obligatorios");
}
}

</script>

I have two arguments

[Route("api/Values/Nombre/{id}/Capacidad/{iCapacity}")]
//[Route("api/{Nombre: id}/{Capacidad: iCapacity}")]
public HttpResponseMessage Get(string id, int iCapacity)
{

*This post is locked for comments

I have the same question (0)
  • Guido Preite Profile Picture
    54,086 Moderator on at

    Hi,

    this is a Dynamics CRM forum, not an ASP.NET one, is your webservice connected to Dynamics in any way?

  • Verified answer
    Community Member Profile Picture
    on at

    yes, this is form CRM... CRM has events remember?

    I´m creating a web service, the thing is, to test it, I´m using Visual Studio to latter upload the web page to CRM...

    Any way,

    The solution is, on VS
    [Route("api/Values/Nombre/{id}/Capacidad/{iCapacity}")]

    on the web page
    <script>
    function add() {
    var nombre = $('#nombreEvento').val();
    var capacidad = $('#capacidad').val();

    if (nombre != "") {
    var Evento = {
    Nombre: nombre,
    Capacidad: capacidad
    };

    var info = JSON.stringify(Evento);
    $.get('localhost/.../Nombre' + nombre + "/Capacidad/" + capacidad, function (data) {

    alert("El Evento ha sido creado");
    location.reload();
    });

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
ScottDurow Profile Picture

ScottDurow 2

#2
GJones Profile Picture

GJones 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans