TOPIC:

WebAPI not working 1 month 5 days ago #258790

  • Topic Author
  • lifaown01
  • Offline
  • Fresh Breezer
  • Fresh Breezer
  • Posts: 1
  • Thanks: 0
have created a simple .aspx page to show a grid. My requirement is that the entire data should not be loaded at first (except for the first page) but when user clicks on next page and so on the data should come from an API .

I have created the same code as given in the documentation. Now the problem is that the API is called but at the end it includes a forward slash before the query string. You can see below:



The following is my code.

HTML:
<div id="grid"></div>

JAVASCRIPT:
var dataManager = ej.DataManager({
url:"/api/Designs",
adaptor: new ej.WebApiAdaptor()
});

$("#grid").ejGrid({
dataSource: dataManager,
allowPaging: true
});

C# API:
using Some.Repository;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web;
using System.Web.Http;

namespace Some.Sales
{
public class DesignsController : ApiController
{
// GET api/design
public object Get()
{
var queryString = HttpContext.Current.Request.QueryString;

int skip = Convert.ToInt32(queryString["$skip"]);
int take = Convert.ToInt32(queryString["$top"]);

var designs = new DesignRepository().GetDesignAll().ToList();

return new {
Items = designs.Skip(skip).Take(take),
Count = designs.Count
};
}
}
}

Where i am doing wrong, please help me out.

Please Log in or Create an account to join the conversation.

WebAPI not working 1 month 4 days ago #258803

  • tihana.krivic's Avatar
  • tihana.krivic
  • Offline
  • Moderator
  • Moderator
  • Posts: 6086
  • Karma: 3
  • Thanks: 429
Hi,

where did you put this code?

In breezingforms you can use only javascript (in validation, actionscripts, initscripts,submitted script)
or php (in before form pieces, after form pieces, begin submit pieces, end submit pieces).

Regards,
Tihana

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
Time to create page: 0.043 seconds

BreezingForms Pro 1.4.7 for WordPress Released!

Available in the membership section.

September Discount!

Massive discounts on all subscriptions!

Get Your Subscription Here

Quick Links

Downloads

BreezingForms

ContentBuilder

BreezingCommerce

Templates

Documentation

BreezingForms

ContentBuilder

BreezingCommerce

Apprendre BreezingForms (French Community)

Apprendre et maîtriser BreezingForms par des tutoriels et exemples, le tout en français

breezingforms.eddy-vh.com

Questions et réponses sur les forums de l'AFUJ

AFUJ

Special Offer

Summer Sale! All subscriptions at a special price!

Includes prio support, all of our current and future Joomla!® extensions and Joomla!® templates for the duration of your membership.

Get it from here

3rd Party Discount - 25% Off

We help you to keep your costs under control. If you are a new member and purchased a form building tool from a different form vendor, then you'll get a 25% discount on our subscription plans.

How to receive the discount:

Send us a quick email to sales@crosstec.org with a proof of purchase (for example a paypal receipt), await payment instructions and enjoy your membership!