troubleshooting Question

ajax jquery + webapi mvc

Avatar of ITsolutionWizard
ITsolutionWizardFlag for United States of America asked on
ASP.NETjQueryAJAX
1 Comment1 Solution8 ViewsLast Modified:
I use c# to call webapi below on another server, and it works fine.
Can you show me how to convert to jquery call? I am very new in ajax jquery....

Thanks,

  public string GetFleetList(string FleetMasterType, string responseType)
        {
            string RegIDvalue = "0";
            using (System.Net.WebClient client = new System.Net.WebClient())
            {
                var reqparm = new System.Collections.Specialized.NameValueCollection();
                reqparm.Add("FleetMasterType", FleetMasterType);
                byte[] responsebytes = client.UploadValues(domain + "/api/Fleet/GetFleetList?type="+ responseType, "POST", reqparm);
                string responsebody = Encoding.UTF8.GetString(responsebytes);
                RegIDvalue = responsebody;
            }
            return RegIDvalue;
        }
ASKER CERTIFIED SOLUTION
Zvonko
Systems architect

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Top Expert 2006

The Distinguished Expert awards are presented to the top veteran and rookie experts to earn the most points in the top 50 topics.

Join our community to see this answer!
Unlock 1 Answer and 1 Comment.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 1 Comment.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros