Wednesday, November 04, 2009

Block Particular Site

If you are working on a project which is a Internet application and if you don't want to give public access to your site. Then you can use the Static IP functionality. But, for this particular premises must have the internet connection with 'Static IP'. To, resolve this you can check particular request which is coming from which IP address and compare it with a XML file or with database having list of IP addresses.

if (Convert.ToString(Request.UserHostAddress) == "192.168.1.25")
//Redirect user to your application
else
//If not redirect to some other invalid location

That's It !

I've used this in my current Bank Application.

Tuesday, November 03, 2009

json Serialization




Sometime when working with ScriptSevice and ScriptMethod in ASP.net webservice following error may occur.
Error during serialization or deserialization using the JSON JavaScriptSerializer. The length of the string exceeds the value set on the maxJsonLength property.
Reason for this is JavaScript Serialization setting . This allow maximum 2097152 character by default. It method return string larger then this then it throw above error.
Solution is just need to mention the below tags in web.config file
Thats it........!

Web 2.0

What is the Web 2.0 exactly ?