About
Profile picture Gokhan Demir,
a computer geek in Istanbul.

E-mail me Send mail


Photo Of The Day


  • Island at Twilight, South Africa, 2003

Calendar

<<  August 2008  >>
MoTuWeThFrSaSu
28293031123
45678910
11121314151617
18192021222324
25262728293031
1234567

View posts in large calendar

Pages


    Recent posts


    Recent comments


    Archive


    Authors


    Tags


    Categories


    Blogroll


    Disclaimer

    The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

    © Copyright 2008

    Sign in

    Running Multiple Versions Of Internet Explorer

    by Gokhan Demir 2/12/2008 8:52:00 AM

    I have been using ie7 for a long time. But for most cases, i need to check out my applications in ie6 for cross browser circumstances. I used to make ie6 tests on an another machine which's browser is not upgraded to ie7. Yesterday i found this entry which ends this pain. After install it, you will be able to use all ie versions on the same machine. WinXP users will get the gift, but for some reason this software is not working properly on Vista.

    Read the original entry

    Download It ! 

     

     

     

    MySql Blog Provider For BlogEngine.NET

    by Gokhan Demir 12/10/2007 10:52:00 AM

    I'm using MySql server for the BlogEngine.NET back-end. Current version of the BlogEngine.NET supports XML and MS SQL as data storages. But my hosting plan has a limited option for MS SQL databases so i don't want to use it. And XML data provider option saves every post to individual files. Also i have some performance concerns about XML data storages. So i decide to use MySql. It's not very populer in ASP.Net community. But if you give it a chance, you will see how powerful and portable it is. I'm using MySql Connector/Net version 1.0, cause latest version of the connector has some trust level problems on Godaddy. Here are the steps that you need to follow for MySql data provider integration. (I'm assuming you're using BlogEngine.NET 1.2.x.x)

    - Create a database and change connection string on the sql.config file.
       Download MySql Script (2.43 kb)

    <connectionStrings>
    <add name="BlogEngine" 
    connectionString="Server=localhost; 
    Port=3306; 
    Database=databasename;
    Uid=username;
    Pwd='password';"
    providerName="MySql.Data.MySqlClient" /> 
    </connectionStrings>
    



    - Add MySql Connector dll to BlogEngine.Core References
       Download MySql Connector (54.92 kb)





    - Add MYSQLBlogProvider.cs file to Providers folder which on the BlogEngine.Core project. Download MYSQLBlogProvider (4.16 kb)


     



    - Add MySql provider to BlogEngine's provider tag on the web.congfig file.



     That's all..You can press F5 and test it ;)

     

     

    Organizing Using Statements

    by Gokhan Demir 12/7/2007 10:59:00 AM

    Class files may become bloated and difficult to read because of unnecessary and unorganized using directives.Visual Studio 2008 comes with a solition for this. Just right click anywhere on the class file, and you will see the "Organize Usings" on context menu. Hope it helps ;)




    Detecting Asp.net Ajax Request In Custom HttpModule

    by Gokhan Demir 10/29/2007 6:50:00 PM

    The UpdatePanel is one of the coolest feature of Microsoft's ASP.NET AJAX. For some reason if you want to detect an ajax request on the page code-behind it's so easy. Take a look at the code snipped below :

    if(ScriptManager.GetCurrent(this).IsInAsyncPostBack)
    {
    	//this is an ajax postback
    }
    

    On the other hand if you use a custom httpmodule with asp.net ajax web application, you will probably get this error  :

    Sys.WebForms.PageRequestManagerParserErrorExeption: The message received from the server could not be parsed.  Common causes for this error are when the response is modified by calls to Response.Write(), response filters, HttpModules, or server trace is enabled.  Details: ...

    In this situation, we can not use ScriptManager's IsInAsyncPostBack property cause we're working at the httpmodule level. We need something else to catch ajax request.So I began to look for a special property which represents the ajax request. Look at the page's request headers :


    Cache-Control : no-cache
    Connection : Keep-Alive
    Content-Length : 720
    Content-Type : application/x-www-form-urlencoded
    Accept : */*
    Accept-Encoding : gzip, deflate
    Accept-Language : tr
    Cookie : ASP.NET_SessionId=gytqakjnhobwd0utbwd5fo55
    Host : localhost:3548
    Referer : http://localhost:3548/WebForm1.aspx
    User-Agent : Mozilla/4.0 (compatible; MSIE 7.0
    x-microsoftajax : Delta=true
    UA-CPU : x86

    Whoala ! Asp.Net Ajax adds an extra header tag for it's request. Just look for the 'x-microsoftajax' tag on HttpModule's BeginRequest event. If it is existing then it's an ajax request. 

    if (Request.Headers["x-microsoftajax"] != null)
    {
    	//ajax request
    }
    
    Powered by BlogEngine.NET
    Designed by FYFI, Adapted by Gokhan Demir