Posts

Showing posts with the label asp.net-web-api

How to redirect to external url from Web Api Services

How to redirect to external url from Web Api Services if (order.Payment_Mode == "ONLINE") { int amount = (int)order.Tot_Price; DateTime Today = System.DateTime.Now; string MerchantId = ""; // return Redirect("https://www.google.com/"); return Ok(); } I want to redirect to Payment gateway url by adding values in URL By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

How to define Array Datatype in Angular 5

Image
How to define Array Datatype in Angular 5 My model: export class Customer { CustomerId :number FirstName : string LastName : string Email : string Phone : string ConfirmPassword:string Password : string Address : string//**I want to define address as array.Because I got List of Address from Customer as shown in the image.** } Got Array of Address from customer API.How to Achieve this? It display Like [object Object],[object Object],[object Object] in UI . That error does not change even if you declare it as array . If you are displaying array of objects in template the do it {{Address | json}} – Amit Chigadani Jun 29 at 9:40 It display Like [object Object],[object Object],[object Object] in UI array {{Address | json}} ...

Web api Post call from ajax fails

Web api Post call from ajax fails I have an web api wand I call it method in an ajax with POST method, sending the parameter as data . It gives me a 404 not found error. But when I pass the data in the query string , it works fine. Please help me fixing the matter and get it worked when calling the method with data in the body, not the query string. Note : The web application and Web-api are running on different ports Sending a concrete type object in query string also does not work and received to web api as null config <httpProtocol> <customHeaders> <add name="Access-Control-Allow-Origin" value="*" /> <add name="Access-Control-Allow-Headers" value="Content-Type, contentType, data" /> <add name="Access-Control-Allow-Methods" value="GET, POST, PUT, DELETE, OPTIONS" /> </customHeaders> </httpProtocol> Controller public class RiskC...