Inserting list item Sharepoint 2010 using listdata.svc REST on ASP .net

Posted: February 3, 2012 in web

on postback. be sure to update your reference if you want to add/edit sp list under App_WebReference

tmpDataContext tmpContext = new tmpDataContext(new Uri(""));
  tmpContext.Credentials = GetNetworkCredential(); //user method
        string Name = HttpContext.Current.Request.Form["PersonName"];
        string ItemType = HttpContext.Current.Request.Form["ctype"];
        string Comments = HttpContext.Current.Request.Form["cComments"];
        string lat = HttpContext.Current.Request.Form["lat"];
        string lng = HttpContext.Current.Request.Form["lng"];
        string location = HttpContext.Current.Request.Form["enterlocation"];

        if(HttpContext.Current.Request.Form["selectlocation"] == "current")
             location =  "" + lat + "," + lng;

            new FeedbackItem
                Title = Name,
                ItemType = ItemType,
                Comments = Comments,
                Location = location

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s