Currently browsing category

ASP.NET

XSS02

Cross-site Scripting (XSS) Attack

What is Cross-site Scripting? Hackers are constantly experimenting with a wide repertoire of hacking techniques to compromise websites and web applications and make off with a treasure trove of sensitive data including credit card numbers, social security numbers and even medical records. Cross-site Scripting (also known as XSS or CSS) …

Telerik MVC Grid Refresh

If you need to refresh telerik MVC grid for example every seconds you have to use javascript function setInterval. Step 1: add “.ClientEvents(events => events.OnComplete(“OnComplete”))” to your grid definition @(Html.Telerik().Grid<CurrentJobs>() .Name(“Grid”) .DataKeys(keys => keys.Add(model => model.lRefNo)) .DataBinding(dataBinding => { dataBinding.Ajax().Select(“CustOnline”, “OnlineCustGrid”); }) .Columns(columns => { columns.Bound(model => model.lRefNo).Width(100).ReadOnly(); columns.Bound(model => …

C# Razor Syntax Quick Reference

There are good guides about Razor available, but it’s focused on covering the basics of web programming using Razor and inline pages and not just the Razor syntax. So I thought it might be handy to write up a a really concise quick reference about the Razor syntax. Syntax/Sample Razor …

C# Razor Syntax Quick Reference

  Syntax/Sample Razor Web Forms Equivalent (or remarks) Code Block @{ int x = 123; string y = “because.”; } <% int x = 123; string y = “because.”; %> Expression (Html Encoded) <span>@model.Message</span> <span><%: model.Message %></span> Expression (Unencoded) <span> @Html.Raw(model.Message) </span> <span><%= model.Message %></span> Combining Text and markup @foreach(var …

The Razor View Engine

ASP.NET MVC 3 comes with a new view engine named Razor which is getting popular these days because of simplicity and easy to learn and I have to say that I really love the syntax it uses. One of the primary things that’s kept me from using ASP.NET MVC in …