Tutorial by Examples: c

Right click on your project folder/name and create new area and name it. In mvc internet/empty/basic application a folder with the name of the area will be created,which will contain three different folders named controller , model and views and a class file called "areanameAreaRegistration.c...
In your App_start folder open routeconfig.cs and do this routes.MapRoute( name: "Default", url: "{controller}/{action}/{id}", defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }, ...
Create a new controller foreg ControllerName: "Home", ActionresultName :"Index" open AreaRegistraion.cs and add the controller name and action name to be rerouted to context.MapRoute( "nameofarea_default", "nameofarea/{controller}/...
using System.Diagnostics.Contracts; public int DivideNumbers(int numerator, int denominator) { Contract.Requires(denominator != 0); return numerator / denominator; }
using System.Diagnostics.Contracts; public int DivideNumbers(int numerator, int denominator) { Contract.Requires<ArgumentOutOfRangeException>(denominator != 0); return numerator / denominator; }
You can place action filters at three possible levels: Global Controller Action Placing a filter globally means it will execute on requests to any route. Placing one on a controller makes it execute on requests to any action in that controller. Placing one on an action means it runs with the...
$ for shell in ash bash dash ksh ksh93 zsh; do > $shell -c "echo '\\\\'$shell'\\\\'" > done \\ash\\ \\bash\\ \dash\ \pdksh\ \\ksh93\\ \zsh\ 'echo' can only be used consistently, across implementations, if its arguments do not contain any backslashes (reverse-solidi...
<asp:ObjectDataSource ID="ObjectDataSourceEmployees" runat="server" TypeName="MyPackage.MyDataAccessClass" DataObjectTypeName="MyPackage.Employee" SelectMethod="GetEmployees" UpdateMethod="SaveEmplo...
<script> (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','//www.goog...
import play.libs.Json; public JsonNode createJson() { // {"id": 33, "values": [3, 4, 5]} ObjectNode rootNode = Json.newObject(); ArrayNode listNode = Json.newArray(); long values[] = {3, 4, 5}; for (long val: values) { listNode.add(val); ...
In the following examples, json contains a JSON object with the following data: [ { "name": "John Doe", "work": { "company": { "name": "ASDF INC", "country": "USA" }, ...
By default, Jackson (the library Play JSON uses) will try to map every public field to a json field with the same name. If the object has getters/setters, it will infer the name from them. So, if you have a Book class with a private field to store the ISBN and have get/set methods named getISBN/setI...
Large scale applications often need different properties when running on different environments. we can achieve this by passing arguments to NodeJs application and using same argument in node process to load specific environment property file. Suppose we have two property files for different enviro...
Use the tar (tape archive) command to compress your files and folders. It is similar to creating .ZIP files in Windows environment. Syntax: tar -zcvf <output tar file> <source file> Example: tar -zcvf outputfile.tar.gz source file Here’s what those switches actually mean: -c: Cr...
Inbound filter is applied when item is added to the search index and allows to specify whether item is included to the index or not. Examples when inbound filter can be used - do not include standard values and previous versions of the item in the index. Inbound filters are set in configuration: ...
Outbound filter can be used to filter the search results. One of the examples of outbound filter usage is removing items which user doesn't have access to from search results. Outbound filters are set in the configuration: <indexing.filterIndex.outbound> <processor type="Sitecore....
A modal is a dialog window which can be displayed over the current page. <!-- Clicking the button will open the modal window --> <button type="button" class="btn btn-success btn-lg" data-toggle="modal" data-target="#theModal">Open The Modal</b...
You can easily open a file from your app package, but Uri scheme must be "ms-appx-web" instead of "ms-appx": var uri = new Uri("ms-appx-web:///Assets/Html/html-sample.html"); this.webView.Navigate(uri);
To open a file from local folder or temp folder, target file must not be located in those folders' root. For security reasons, to prevent other content from being exposed by WebView, the file meant for displaying must be located in a subfolder: var uri = new Uri("ms-appdata:///local/html/html-...
In case when NavigateToString can't handle some content, use NavigateToLocalStreamUri method. It will force every locally-referenced URI inside the HTML page to call to the special resolver class, which can provide right content on the fly. Assets/Html/html-sample.html file: <!DOCTYPE html> ...

Page 538 of 826