Click here to Skip to main content
15,886,799 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionPopulate word with data Pin
Praveen Kandari3-Feb-16 0:05
Praveen Kandari3-Feb-16 0:05 
AnswerRe: Populate word with data Pin
Nathan Minier3-Feb-16 1:17
professionalNathan Minier3-Feb-16 1:17 
GeneralRe: Populate word with data Pin
Praveen Kandari3-Feb-16 1:20
Praveen Kandari3-Feb-16 1:20 
GeneralRe: Populate word with data Pin
Nathan Minier3-Feb-16 2:21
professionalNathan Minier3-Feb-16 2:21 
GeneralRe: Populate word with data Pin
Praveen Kandari3-Feb-16 18:11
Praveen Kandari3-Feb-16 18:11 
GeneralRe: Populate word with data Pin
Richard Deeming4-Feb-16 1:31
mveRichard Deeming4-Feb-16 1:31 
GeneralRe: Populate word with data Pin
Nathan Minier4-Feb-16 3:21
professionalNathan Minier4-Feb-16 3:21 
QuestionProblem with Post request in my ASP.NET Web API + jQuery Pin
Farhad Eft2-Feb-16 12:18
Farhad Eft2-Feb-16 12:18 
Hi, I have an issue, that when I send get request to my ASP.NET Web API, also my post function in my controller gets called. Here is my code, I'd appreciate if anyone could help.
I'd like to know what do I do wrong when I declare my post function that it also gets called with my get request.

both my get and post function in my controller:


public IHttpActionResult GetAffiliate(int id)
{
Classes.Data d = new Classes.Data();
Tuple<int16, affiliate=""> result = d.getAffiliateById(id);

Int16 status = result.Item1;
Affiliate affiliate = result.Item2;

if (status == 0)
{
return NotFound();
}
return Ok(affiliate);
}

[AcceptVerbs("POST")]
public HttpResponseMessage Post([FromBody]Address address)
{
Classes.Data d = new Classes.Data();
d.addressEdit(address);

return Request.CreateResponse(HttpStatusCode.OK, "Address changed.");
}

my jQuery code where I apply get request:

function getInfo() {
//point to the api
var uri = 'api/affiliate';
//clear the list div first
$("#aff_name").empty();
var aff_id = $('#aff_id').val();
$.getJSON(uri + '/' + aff_id)
.done(function (data) {...

and here is my post request in jquery:

$.ajax({
type: "POST",
data: JSON.stringify(address),
url: "api/affiliate/",
contentType: "application/json"
});

Thank you so much for your consideration.
AnswerRe: Problem with Post request in my ASP.NET Web API + jQuery Pin
F-ES Sitecore2-Feb-16 23:10
professionalF-ES Sitecore2-Feb-16 23:10 
QuestionLinq to Sql: How to Fetch specific row using store procedure and display columns data into textboxes Pin
Ahmer Ali Ahsan Sheikh2-Feb-16 7:38
Ahmer Ali Ahsan Sheikh2-Feb-16 7:38 
QuestionAll my Telterik Control became disabled Pin
indian1431-Feb-16 10:42
indian1431-Feb-16 10:42 
AnswerRe: All my Telterik Control became disabled Pin
ZurdoDev2-Feb-16 8:41
professionalZurdoDev2-Feb-16 8:41 
QuestionI am getting following Telerik errors when Compiling the Application Pin
indian1431-Feb-16 7:31
indian1431-Feb-16 7:31 
AnswerRe: I am getting following Telerik errors when Compiling the Application Pin
Brisingr Aerowing1-Feb-16 9:09
professionalBrisingr Aerowing1-Feb-16 9:09 
GeneralSource code project for complex event processing Pin
Member 1185956231-Jan-16 19:55
Member 1185956231-Jan-16 19:55 
SuggestionRe: Source code project for complex event processing Pin
Richard MacCutchan31-Jan-16 21:25
mveRichard MacCutchan31-Jan-16 21:25 
GeneralRe: Source code project for complex event processing Pin
JHizzle31-Jan-16 22:37
JHizzle31-Jan-16 22:37 
GeneralRe: Source code project for complex event processing Pin
Brisingr Aerowing1-Feb-16 9:13
professionalBrisingr Aerowing1-Feb-16 9:13 
QuestionI am getting the Pin
indian14328-Jan-16 21:45
indian14328-Jan-16 21:45 
AnswerRe: I am getting the Pin
F-ES Sitecore28-Jan-16 21:59
professionalF-ES Sitecore28-Jan-16 21:59 
SuggestionRe: I am getting the Pin
Richard Deeming29-Jan-16 5:07
mveRichard Deeming29-Jan-16 5:07 
GeneralRe: I am getting the Pin
indian14329-Jan-16 6:47
indian14329-Jan-16 6:47 
GeneralRe: I am getting the Pin
Richard Deeming29-Jan-16 6:56
mveRichard Deeming29-Jan-16 6:56 
GeneralRe: I am getting the Pin
indian14329-Jan-16 8:17
indian14329-Jan-16 8:17 
GeneralRe: I am getting the Pin
F-ES Sitecore31-Jan-16 22:13
professionalF-ES Sitecore31-Jan-16 22:13 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.