Tag Archives: ASP.NET

Injecting Values for Default MVC Model Binding

In a recent project, due to security concerns, we want to encrypt all QueryString values into a single encrypted value before placing the link in web pages, then decrypt it back to individual name/value pairs and pass them to default … Continue reading

Posted in ASP.NET, MVC | Tagged , | Leave a comment

Src=” causes double page requests

A html tag with src=” (ie img) will cause the browser to try to request that resource at the same URL as the current page, hence causes double requests.

Posted in ASP.NET | Tagged , | Leave a comment

Formatting Dates, Times and Numbers in C#

Good reference (with examples)  http://www.4guysfromrolla.com/articles/111010-1.aspx

Posted in ASP.NET | Tagged , | Leave a comment

C# String Format examples for Double

From http://www.csharp-examples.net/string-format-double/ The following examples show how to format float numbers to string in C#. You can use static method String.Format or instance methods double.ToString and float.ToString. Digits after decimal point This example formats double to string with fixed number … Continue reading

Posted in .NET | Tagged , | Leave a comment

Why EntitySet not auto-generated by LINQ-to-SQL?

It turns out the the child table must have a primary key. If not set in database level, that can be set in the *dbml file. Multiple-field primary key works too.

Posted in ASP.NET | Tagged , | Leave a comment

Roundup of ASP.NET Dynamic Data

Dynamic Data is a very nice tool comes with .NET 3.5 SP1. It offers CRUD support out of box (scaffolding) and is also very easy to customize! Add to an existing web applicataion: for many web applications (especially those existing … Continue reading

Posted in ASP.NET | Tagged | Leave a comment

MachineKey in web.config

There are few scenarios that you want to add MachineKey into your web application’s web.config: You have a web farm and in each server the machine.config set to auto generate machinekey. You want to use “Encyrpted” password format in ASP.NET … Continue reading

Posted in ASP.NET | Tagged | 8 Comments

Mysterious Double Post Back/Page Request

Recently I run into a strange situation that one of my pages was always loaded twice for each reqeust. This happened only when I enable  “URL Rewrite” feature for the site.  After almost a hour of debugging, I found it’s … Continue reading

Posted in ASP.NET | Tagged | 2 Comments