Category 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

Why the view doesn’t display the new values set in the post back method

In MVC, when you post back any changes, it’s recommended that you follow the PRG (Post-Redirect-Get) pattern to the View page. However, if you want to display the same model data back in the same request, there might be something … Continue reading

Posted in 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)

Posted in ASP.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

Client-side validator not firing in FF, only in IE

Symptom: For a legacy web app converted from older version of ASP.NET, the client javascript form validation only fires in IE, not in FF. Fix: Change this line in web.config <xhtmlConformance mode=”Legacy”/> to: <xhtmlConformance mode=”Transitional”/>

Posted in ASP.NET | Leave a comment

Tricks using Full Text Search with Chinese content

SQL Full Text Search offers a fuzz logic search. To get desired search result with Chinese content, the following steps have to be followed (among others): Set language for columns (and you can’t mix different language settings for a table): … Continue reading

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