i have this aspx view :
jQuery('#addjob').click(function () {
if ($('#metier').val().length > 0) {
$('.taglist').append('<li style="line-height: 20px"><a href="" style="width:250px" >' + $('#metier').val() + '<span class="icon-remove"></span></a></li>');
$.ajax({
type: "POST",
url: "JobsEdition.aspx/AjouterMetier",
data: "{'job': '" + $('#metier').val() + "'}",
success: function (msg) {
AjaxSucceeded(msg);
},
error: AjaxFailed
});
}
$('#metier').val('');
});
This is the result i got:

In the code behin i put this method :
public partial class JobsEdition : System.Web.UI.Page
{
List<string> jobs = new List<string>();
[WebMethod()]
public void AjouterMetier(string job)
{
if (job != "")
{
jobs.Add(job);
Session["jobs"] = jobs;
}
}
}
I'm beginner in the use of ajax in Asp.net, so i had always the session variables Session["jobs"] null and the method AjouterMetier was never reached .
- What is the error that I commited?
- How can i fix it?
<myserver>/JobsEdition.aspx/AjouterMetier(where <myserver> is the url to the server your page is on) into your browser's address bar, do you get any ASPX or HTTP error?session is unknown type