Click here to Skip to main content
15,847,263 members
Home / Discussions / ASP.NET
   

ASP.NET

 
Answer[Repost] Programatically click a button using http POST request Pin
Richard MacCutchan10-Jun-17 10:16
mveRichard MacCutchan10-Jun-17 10:16 
QuestionHow to run jquery in visual studio 2008 asp.net web application project Pin
HedwigO10-Jun-17 2:36
HedwigO10-Jun-17 2:36 
AnswerRe: How to run jquery in visual studio 2008 asp.net web application project Pin
F-ES Sitecore12-Jun-17 0:11
professionalF-ES Sitecore12-Jun-17 0:11 
GeneralRe: How to run jquery in visual studio 2008 asp.net web application project Pin
HedwigO13-Jun-17 5:56
HedwigO13-Jun-17 5:56 
GeneralRe: How to run jquery in visual studio 2008 asp.net web application project Pin
Richard Deeming13-Jun-17 6:04
mveRichard Deeming13-Jun-17 6:04 
GeneralRe: How to run jquery in visual studio 2008 asp.net web application project Pin
HedwigO13-Jun-17 6:22
HedwigO13-Jun-17 6:22 
GeneralRe: How to run jquery in visual studio 2008 asp.net web application project Pin
Richard Deeming13-Jun-17 6:27
mveRichard Deeming13-Jun-17 6:27 
QuestionWebAPI: When to use multiple endpoint or multiple route for single action Pin
Mou_kol8-Jun-17 23:54
Mou_kol8-Jun-17 23:54 
code taken from this area https://www.codeproject.com/Articles/1005485/RESTful-Day-sharp-Security-in-Web-APIs-Basic#_Toc423441907

[GET("allproducts")]
[GET("all")]
public HttpResponseMessage Get()
{
 
}
 

[GET("productid/{id?}")]
[GET("particularproduct/{id?}")]
[GET("myproduct/{id:range(1, 3)}")]
public HttpResponseMessage Get(int id)
{
 
}
 
[POST("Create")]
[POST("Register")]
public int Post([FromBody] ProductEntity productEntity)
{
 
}
 

[PUT("Update/productid/{id}")]
[PUT("Modify/productid/{id}")]
public bool Put(int id, [FromBody] ProductEntity productEntity)
{
 
}
 
// DELETE api/product/5
[DELETE("remove/productid/{id}")]
[DELETE("clear/productid/{id}")]
[PUT("delete/productid/{id}")]
public bool Delete(int id)
{
 
}


1) in what kind of scenario people use multiple http verbs for single action because it create multiple route for single action which may confuse people.......should the the below approach is good or not ?

[GET("productid/{id?}")]
[GET("particularproduct/{id?}")]
[GET("myproduct/{id:range(1, 3)}")]
public HttpResponseMessage Get(int id)
{}


2)PUT and DELETE is different verbs. how one can use different verbs for single action....is it right approach.

[DELETE("remove/productid/{id}")]
[DELETE("clear/productid/{id}")]
[PUT("delete/productid/{id}")]
public bool Delete(int id)
{
 if (id > 0)
     return _productServices.DeleteProduct(id);
 return false;
}


the person who wrote this article he is codeproject MVP it means he has good command over technology then how he can follow a wrong approach ?

any idea?

please discuss in details. thanks
AnswerRe: WebAPI: When to use multiple endpoint or multiple route for single action Pin
Richard MacCutchan9-Jun-17 1:24
mveRichard MacCutchan9-Jun-17 1:24 
AnswerRe: WebAPI: When to use multiple endpoint or multiple route for single action Pin
F-ES Sitecore9-Jun-17 4:58
professionalF-ES Sitecore9-Jun-17 4:58 
GeneralRe: WebAPI: When to use multiple endpoint or multiple route for single action Pin
Mou_kol12-Jun-17 4:42
Mou_kol12-Jun-17 4:42 
QuestionWeb API: different way of attribute routing Pin
Mou_kol8-Jun-17 6:05
Mou_kol8-Jun-17 6:05 
Questionuser control Pin
caradri8-Jun-17 4:01
caradri8-Jun-17 4:01 
QuestionQuestion regarding asp.net web forms Pin
Member 132480908-Jun-17 2:52
Member 132480908-Jun-17 2:52 
AnswerRe: Question regarding asp.net web forms Pin
Afzaal Ahmad Zeeshan8-Jun-17 6:38
professionalAfzaal Ahmad Zeeshan8-Jun-17 6:38 
GeneralRe: Question regarding asp.net web forms Pin
ZurdoDev8-Jun-17 6:43
professionalZurdoDev8-Jun-17 6:43 
GeneralRe: Question regarding asp.net web forms Pin
Afzaal Ahmad Zeeshan8-Jun-17 6:49
professionalAfzaal Ahmad Zeeshan8-Jun-17 6:49 
GeneralRe: Question regarding asp.net web forms Pin
ZurdoDev8-Jun-17 6:53
professionalZurdoDev8-Jun-17 6:53 
GeneralRe: Question regarding asp.net web forms Pin
Member 1324809013-Jun-17 2:13
Member 1324809013-Jun-17 2:13 
QuestionObjectDataSource Pin
pollilop7-Jun-17 6:10
pollilop7-Jun-17 6:10 
AnswerRe: ObjectDataSource Pin
Richard Deeming7-Jun-17 7:12
mveRichard Deeming7-Jun-17 7:12 
GeneralRe: ObjectDataSource Pin
pollilop11-Jun-17 23:35
pollilop11-Jun-17 23:35 
SuggestionRe: ObjectDataSource Pin
Yoqueuris13-Jun-17 6:04
Yoqueuris13-Jun-17 6:04 
Questioni have writen c# code to render google map from server side at runtime. but when i execute this code, map is not getting displayed on browser. can any one please tell me what is a error or what changes i need to do. Pin
Member 107737173-Jun-17 21:32
Member 107737173-Jun-17 21:32 
AnswerRe: i have writen c# code to render google map from server side at runtime. but when i execute this code, map is not getting displayed on browser. can any one please tell me what is a error or what changes i need to do. Pin
Richard Deeming5-Jun-17 9:37
mveRichard Deeming5-Jun-17 9:37 

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.