In .NET world it’s very common to write methods with same name but different parameters. This is called overloading. And if you use this technique wisely you can prevent some code repetation. But in the web services world of .net its not allowed by default. If you try you get an exception says : “Bla, […]
Problem with classes under App_Code folder in VS 2008
We are developing a new ASP.NET web application in Visual studio 2008. Last week we’ve decided to use HttpHandlers instead of some web pages. And as we used to do in Visual Studio 2005 web sites created an App_code folder after that we created new classes under that folder. Then we noticed that there is […]
Access to Session State from Http Handler
Sometimes you need to use Http handlers to respond to requests rather than classical asp.net pages. At that times if you want to use session objects you will see that HttpContext.Current.Session is null. If you want to read session state from you http handler your http handler must implement System.Web.SessionState.IReadOnlySessionState interface. If you want to […]
Anti XSS Library Decode Method
If you are using Anti XSS Library, you’ve noticed that it doesn’t have any decoding methods. It is because library aims preventing XSS attacks. If you want to decode your content you can use Server.HtmlDecode method. Do not re-write the code that already written. 🙂 Cross Site Scription
Culture ‘tr’ is a neutral culture. It cannot be used in formatting and parsing and therefore cannot be set as the thread’s current culture.
You get this error, when you use neutral culture name to set culture of the application. 1 System.Globalization.CultureInfo ci = new System.Globalization.CultureInfo("tr"); 2 System.Threading.Thread.CurrentThread.CurrentCulture = ci; 3 System.Threading.Thread.CurrentThread.CurrentUICulture = ci; To prevent this error you can use explicit culture name like "tr-TR" or use the code below: 1 System.Globalization.CultureInfo ci = System.Globalization.CultureInfo.CreateSpecificCulture("tr"); Happy coding.
LINQ Notepad: LINQPad
You can query your database with modern query language LINQ. I think SQL Server Management Studio need this functionalty built-in. Tool is free for now. Yo can download from this link: http://www.linqpad.net/
Cross Site Scription (XSS)
Infact Web applications are HTML forms and lives at the client side. This HTML forms make visits to their parents who lives at the server side. While they are visiting their parents they bring a lot of data input from client side. While they are leaving for home takes a lot of output data. If […]
Grab color from your desktop with ColorPic
If you are web designer or developing web applications you can use this application to grab colors from screen. It’s easy to use and %100 free application. It’s very easy to use it. Move your mouse pointer over the color that you want to grab. Then use Ctrl+G shortcut. This action stores the color to […]
Register your user controls and custom controls in Web.Config
In ASP.NET web application you can develop user controls and custom server controls to increase your productivity and decrease code repetition. To use these user controls at your web pages you can register like this: <%@ Register Src="Controls/somecontrol.ascx" TagName="SomeControl" TagPrefix="myPrefix" %> And use like this: <html> <body> <form id="form1" runat="server"> <myPrefix:header ID="SomeControl1" runat="server" /> </form> </body> </html> The registration step can […]
Changing your hosts file in Windows
In Windows, Hosts file is a read only hidden system file. So that you cannot edit that file. Also running notepad as an administrator doesn’t solve this problem.There are a lot of articles about this topic but none of them giving this solution. You can solve this by typing some DOS commands at command line: […]