Regex Optimization

Recently we encountered a huge performance issue in our HttpModule or Url Rewriter module. After a lot of tense and investigation, the issue is locked down at the way of using Regular Expression. In the HttpModule, we are using Regex to match certain... [More]

Tags:

Create Cross-Domain Cookie?

Recently I've been challenged to create cookies under other domain which I do not have access to. I was poking around the internet and trying to find a solution for this. The most popular solution is using javascript/html + iframe, which sounds like ... [More]

Tags:

.Net Tech | .Net Tech

Include javascript to a customized component as web resource

This post describes how to include javascript file and other files as webresource to a customized webcontrol. [More]

Tags:

.Net Tech

Work with RESTful service using LINQ to XML

Recently I've been working on a project that uses third party RESTful service a lot. The main response format of the service is XML, I found it is a big headache to parse the data using XmlDocument, so wondering if it can be easily done by using LINQ... [More]

Silverlight interactive with database

Silverlight interactive with database or server objects. [More]

Tags: ,

.Net Tech

美国的纸巾种类

在美国生活过一段时间后, 发现美国的纸巾种类分的比较细, 国内常见的筒状如图,  在这里是叫bath tissue, 顾名思义是用于如厕的啦, 所以每次有美国朋友到家里做客的时候, 我都比较小心, 不让这类纸巾出现在厅里, 更不会递这类纸巾给他们擦嘴啦. 说到擦嘴, 如果是吃饭的时候用的, 有专门的叫Napkin的方形纸巾,如图  展开来比较会大, 用餐的时候也可以摊在腿上, 避免食物弄脏衣服. 那如果是平时擦擦的, 就用国内常见的那种抽取式的纸巾 还有一种... [More]

Tags:

Life in US

RadComboBox AutoComplete Hightlight Keyword?

RadComboBox is a good control to use for auto-suggestion/type-head/auto-complete, the only thing is when using webservice to get the item, the client template is pre-defined and can not be customized. However, we do find hightlighting the keyword in ... [More]

Tags: , , , ,

.Net Tech

Batch Job in a webpage?

By looking at the title, some people will simply say "Uhhh..why you want to do batch jobs in a web page?". However, sometimes you may need to do that due to environment limitation or whatever reason. The question becomes how we handle the request tim... [More]

Tags: ,

.Net Tech

Get Client Geo Location in C#

There are two things to do in order to get the Geo location of a request client. 1,  Get the IP address of the request using below code... string strClientIP = Request.ServerVariables["REMOTE_ADDR"].Trim(); 2, Get the country code by calling ... [More]

Tags: ,

.Net Tech

Cache a page conditonally

Cache is one of the ways to improve site performance, one most used caching policy is page level cache. In .NET, we will use below directive in the page to cache the whole page(10 minutes as example). <%@ OutputCache VaryByParam="none" Duration=... [More]

Tags: , ,

.Net Tech