This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| using System.Web; | |
| using System.Web.Helpers; | |
| using System.Web.Mvc; | |
| namespace MyNamespace.Controllers{ | |
| public class SomePathController : Controller{ | |
| // POST: /SomePath/DoSomething |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| using System.Web; | |
| using System.Web.Helpers; | |
| using System.Web.Mvc; | |
| namespace MyNamespace.Controllers | |
| { | |
| [AttributeUsage(AttributeTargets.Method | AttributeTargets.Class, AllowMultiple = false, Inherited = true)] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function myFunction () { | |
| //Grab antiForgeryToken. (Don't forget to add @Html.AntiForgeryToken() to your view or this will be empty) | |
| var antiForgeryToken = $("input[name=__RequestVerificationToken]").val(); | |
| //Prepare parameters | |
| var params = { | |
| FirstName: "Joshua", | |
| LastName: "Harms" | |
| }; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| jQuery.postJSON = function (url, data, success, antiForgeryToken, dataType) { | |
| if (dataType === void 0) { dataType = "json"; } | |
| if (typeof (data) === "object") { data = JSON.stringify(data);} | |
| var ajax = { | |
| url: url, | |
| type: "POST", | |
| contentType: "application/json; charset=utf-8", | |
| dataType: dataType, | |
| data: data, | |
| success: success |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| jQuery.postJSON = function (url, data, success, dataType) { | |
| if (dataType === void 0) { dataType = "json"; } | |
| if (typeof (data) === "object") { data = JSON.stringify(data);} | |
| var ajax = { | |
| url: url, | |
| type: "POST", | |
| contentType: "application/json; charset=utf-8", | |
| dataType: dataType, | |
| data: data, | |
| success: success |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!-- A WinRT XAML page --> | |
| <Page | |
| x:Class="MyApp.MyPage" | |
| xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |
| xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |
| xmlns:local="using:MyApp" | |
| xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | |
| xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | |
| mc:Ignorable="d" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.IO; | |
| using System.Threading.Tasks; | |
| using Windows.UI.Xaml; | |
| using Windows.UI.Xaml.Controls; | |
| using Windows.UI.Xaml.Media.Imaging; | |
| using Windows.UI.Xaml.Navigation; | |
| using Windows.Web.Http; | |
| // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkID=390556 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public async Task<string> YourMethod() | |
| { | |
| //Create a list of your parameters | |
| var postParams = new List<KeyValuePair<string, object>>(){ | |
| new KeyValuePair<string, object>("FirstParameter", "First Value") , | |
| new KeyValuePair<string, object>("SecondParameter", "Second Value") | |
| }; | |
| //Join KVPs into a x-www-formurlencoded string | |
| var formString = string.Join("&", postParams.Select(x => string.Format("{0}={1}", x.Key, x.Value))); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.Collections.Generic; | |
| using System.Globalization; | |
| using System.IO; | |
| using System.Linq; | |
| using System.Net; | |
| using System.Threading.Tasks; | |
| using Newtonsoft.Json; | |
| using Newtonsoft.Json.Linq; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.Linq; | |
| using DDay.iCal; | |
| using Newtonsoft.Json; | |
| public class YourClass | |
| { | |
| public string YourMethod() | |
| { | |
| //Download the .ics file using DDay.iCal package from nuget (install-package dday.ical) |