<?xml version="1.0" encoding="UTF-8"?> <rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" ><channel><title>Rıza Sırman &#187; ASP.NET</title> <atom:link href="http://www.rizasirman.com/web-tasarimi/asp-net/feed/" rel="self" type="application/rss+xml" /><link>http://www.rizasirman.com</link> <description>Dijital Pazarlama ve İletişim Uzmanı</description> <lastBuildDate>Thu, 10 May 2012 08:00:11 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.2</generator> <item><title>Hata &#8211; A project with an output type of class Library cannot be started directly</title><link>http://www.rizasirman.com/web_tasarim/asp-net/hata-a-project-with-an-output-type-of-class-library-cannot-be-started-directly/</link> <comments>http://www.rizasirman.com/web_tasarim/asp-net/hata-a-project-with-an-output-type-of-class-library-cannot-be-started-directly/#comments</comments> <pubDate>Tue, 20 Dec 2011 09:01:36 +0000</pubDate> <dc:creator>Rıza Sırman</dc:creator> <category><![CDATA[ASP.NET]]></category> <category><![CDATA[error]]></category> <category><![CDATA[hata]]></category> <category><![CDATA[visual studio]]></category><guid isPermaLink="false">http://www.rizasirman.com/?p=632</guid> <description><![CDATA[Visual Studio&#8217;da bu hatayı alıyorsanız birden çok proje içeren solution dosyanız hangi proje ile star alacağını bilmiyor demektir. Eklediğiniz projelerden çalışmasını istediğiniz projeye &#8220;Set as StartUp Project&#8221; dedikten sonra, projenizi sorunsuz şekilde çalıştırabilirsiniz.]]></description> <content:encoded><![CDATA[<p><a href="http://www.rizasirman.com/wp-content/uploads/2010/10/error.png"><img src="http://www.rizasirman.com/wp-content/uploads/2010/10/error.png" alt="Hata" title="Hata" width="64" height="64" class="alignright size-full wp-image-469" /></a></p><p>Visual Studio&#8217;da bu hatayı alıyorsanız birden çok proje içeren solution dosyanız hangi proje ile star alacağını bilmiyor demektir. Eklediğiniz projelerden çalışmasını istediğiniz projeye &#8220;Set as StartUp Project&#8221; dedikten sonra, projenizi sorunsuz şekilde çalıştırabilirsiniz.</p> ]]></content:encoded> <wfw:commentRss>http://www.rizasirman.com/web_tasarim/asp-net/hata-a-project-with-an-output-type-of-class-library-cannot-be-started-directly/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Arama Sonuçlarında Highlight yani sarı çizili anahtar kelimeler yaratmak</title><link>http://www.rizasirman.com/web_tasarim/asp-net/arama-sonuclarinda-highlight-yani-sari-cizili-anahtar-kelimeler-yaratmak/</link> <comments>http://www.rizasirman.com/web_tasarim/asp-net/arama-sonuclarinda-highlight-yani-sari-cizili-anahtar-kelimeler-yaratmak/#comments</comments> <pubDate>Fri, 15 Apr 2011 08:29:18 +0000</pubDate> <dc:creator>Rıza Sırman</dc:creator> <category><![CDATA[ASP.NET]]></category> <category><![CDATA[Data Kontrolleri]]></category> <category><![CDATA[anahtar kelime]]></category> <category><![CDATA[arama sonuçları]]></category> <category><![CDATA[highlight]]></category> <category><![CDATA[search]]></category><guid isPermaLink="false">http://www.rizasirman.com/?p=613</guid> <description><![CDATA[Yazdığınız içerik yönetim sisteminde arama sonuçlarında aranan kelimeyi üstü sarı çizili olarak yani highlight olarak göstermek mi istiyorsunuz? Yapmanız gereken, kullandığınız class dosyanızda aşağıdaki gibi kendinize bir class oluşturmak. Eğer arama sonuçları sayfanız arama formundan querystring göndererek çalışıyorsa, aşağıdaki keyword querystring alanını değiştirip kullanabilirsiniz. Ardından kullandığınız data controlünde (listeview, formview vs): şekline bu class&#8217;ı kullanarak&#8230;]]></description> <content:encoded><![CDATA[<p>Yazdığınız içerik yönetim sisteminde arama sonuçlarında aranan kelimeyi üstü sarı çizili olarak yani highlight olarak göstermek mi istiyorsunuz? Yapmanız gereken, kullandığınız class dosyanızda aşağıdaki gibi kendinize bir class oluşturmak. Eğer arama sonuçları sayfanız arama formundan querystring göndererek çalışıyorsa, aşağıdaki keyword querystring alanını değiştirip kullanabilirsiniz. Ardından kullandığınız data controlünde (listeview, formview vs):</p><pre class="brush: plain; title: ; notranslate">
&lt;asp:Label ID=&quot;BodyLabel&quot; runat=&quot;server&quot; Text='&lt;%#MyClass.HighlightText(Eval(&quot;Body&quot;).ToString())%&gt;' /&gt;
</pre><p>şekline bu class&#8217;ı kullanarak databind işleminizi yapabilirsiniz.</p><pre class="brush: plain; title: ; notranslate">
public static string HighlightText(string MainText)
    {
        if (!string.IsNullOrEmpty(HttpContext.Current.Request.QueryString[&quot;keyword&quot;]))
        {
            string keyword = HttpContext.Current.Request.QueryString[&quot;keyword&quot;].ToString().Trim();
            return Regex.Replace(MainText,
                Regex.Escape(keyword), string.Format(&quot;&lt;span style='background-color:yellow'&gt;$0&lt;/span&gt;&quot;),
                RegexOptions.IgnoreCase);
        }
        else
        {
            return MainText;
        }
    }
</pre><p>Bu kodların sonunda lojistik kelimesi ile yapacağınız arama sonuçları aşağıdaki gibi gözükecektir:<br /><div id="attachment_614" class="wp-caption aligncenter" style="width: 560px"><a href="http://www.rizasirman.com/wp-content/uploads/2011/04/highlight-arama-ekran-goruntusu.gif"><img src="http://www.rizasirman.com/wp-content/uploads/2011/04/highlight-arama-ekran-goruntusu.gif" alt="Arama Sonuçları Ekran Görüntüsü - Highligted Text" title="Arama Sonuçları Ekran Görüntüsü - Highligted Text" width="550" height="197" class="size-full wp-image-614" /></a><p class="wp-caption-text">Arama Sonuçları Ekran Görüntüsü - Highligted Text</p></div></p> ]]></content:encoded> <wfw:commentRss>http://www.rizasirman.com/web_tasarim/asp-net/arama-sonuclarinda-highlight-yani-sari-cizili-anahtar-kelimeler-yaratmak/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> <item><title>Localhost&#8217;u Hızlandırmak</title><link>http://www.rizasirman.com/web_tasarim/asp-net/localhostu-hizlandirmak/</link> <comments>http://www.rizasirman.com/web_tasarim/asp-net/localhostu-hizlandirmak/#comments</comments> <pubDate>Wed, 06 Apr 2011 08:40:25 +0000</pubDate> <dc:creator>Rıza Sırman</dc:creator> <category><![CDATA[ASP.NET]]></category> <category><![CDATA[asp.net development server]]></category> <category><![CDATA[firefox]]></category> <category><![CDATA[localhost]]></category> <category><![CDATA[performans]]></category> <category><![CDATA[visual studio 2008]]></category> <category><![CDATA[windows vista]]></category><guid isPermaLink="false">http://www.rizasirman.com/?p=608</guid> <description><![CDATA[Visual Studio 2008&#8242;i Windows Vista ile kullanıyorsanız, bir müddet sonra ASP.net Development Server&#8217;ınızın yani localhost&#8217;unuzun çok yavaşladığını göreceksiniz. Özellikle Firefox ile çalışıyorsanız bazen durum katlanılmaz bir hale gelebilir. Basitçe localhost&#8217;u hızlandırmak için: Host dosyanızdaki (%WINDIR%\System32\drivers\etc\hosts) localhost adresinin hash işaretlerini kaldırın. Firefox&#8217;ta localhostu hızlandırmak için ise: Firefox&#8217;a about:config yazıp enter&#8217;a basın network.dns.disableIPv6 satırını bulun Üstüne çift&#8230;]]></description> <content:encoded><![CDATA[<p><div id="attachment_609" class="wp-caption alignright" style="width: 138px"><a href="http://www.rizasirman.com/wp-content/uploads/2011/04/performans.png"><img src="http://www.rizasirman.com/wp-content/uploads/2011/04/performans.png" alt="Performans" title="Performans" width="128" height="128" class="size-full wp-image-609" /></a><p class="wp-caption-text">Localhost'u hızlandırmak</p></div><br /> Visual Studio 2008&#8242;i Windows Vista ile kullanıyorsanız, bir müddet sonra ASP.net Development Server&#8217;ınızın yani localhost&#8217;unuzun çok yavaşladığını göreceksiniz. Özellikle Firefox ile çalışıyorsanız bazen durum katlanılmaz bir hale gelebilir.</p><p>Basitçe localhost&#8217;u hızlandırmak için:</p><p>Host dosyanızdaki (%WINDIR%\System32\drivers\etc\hosts) localhost adresinin hash işaretlerini kaldırın.</p><p>Firefox&#8217;ta localhostu hızlandırmak için ise:</p><ol><li>Firefox&#8217;a about:config yazıp enter&#8217;a basın</li><li>network.dns.disableIPv6 satırını bulun</li><li>Üstüne çift tıklayarak değer true yapın</li><li>Firefox&#8217;u kapatıp (mümkünse görev yöneticisinden firefox.exe işlemini sonlandırın), yeniden başlatın</li></ol><p>İngilizce orjinal makaleyi okumak için <a href="http://www.wagnerdanda.me/2009/12/asp-net-development-server-slow-on-windows-vista7-with-firefox-or-chrome/" rel="external" rel="nofollow">tıklayın.</a></p> ]]></content:encoded> <wfw:commentRss>http://www.rizasirman.com/web_tasarim/asp-net/localhostu-hizlandirmak/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>İçerikten HTML kodu temizleme &#8211; Strip HTML</title><link>http://www.rizasirman.com/web_tasarim/asp-net/icerikten-html-kodu-temizleme-strip-html/</link> <comments>http://www.rizasirman.com/web_tasarim/asp-net/icerikten-html-kodu-temizleme-strip-html/#comments</comments> <pubDate>Fri, 03 Dec 2010 12:39:26 +0000</pubDate> <dc:creator>Rıza Sırman</dc:creator> <category><![CDATA[ASP.NET]]></category> <category><![CDATA[c#]]></category> <category><![CDATA[Optimizasyon]]></category> <category><![CDATA[SEO]]></category> <category><![CDATA[arama motoru]]></category> <category><![CDATA[description]]></category> <category><![CDATA[html]]></category> <category><![CDATA[optimizasyon]]></category> <category><![CDATA[seo]]></category> <category><![CDATA[strip]]></category> <category><![CDATA[temizleme]]></category><guid isPermaLink="false">http://www.rizasirman.com/?p=528</guid> <description><![CDATA[Web sitenizden Ajax Control Toolkit HTML editör gibi bir editörden girilen html, css ve javascript içeren içeriklerden, belirli uzunluğa kadar kullanılan bölümleri temizleyip, SEO description olarak kullanmak, programatik yaratılan arama motoru optimizasyonlarında sıkça kullanılan bir yöntemdir. Ancak description bölümünde herhangi bir kodun karışması sitenizin görüntüsünü ve çalışmasını olumsuz yönde etkileyecektir. Aşağıdaki kodu kullanarak html içeriklerinizi&#8230;]]></description> <content:encoded><![CDATA[<p><img src="http://www.rizasirman.com/wp-content/uploads/2010/11/html-150x150.png" alt="html code" title="html" width="150" height="150" style="float:left;margin:0 10px 10px 0" />Web sitenizden Ajax Control Toolkit HTML editör gibi bir editörden girilen html, css ve javascript içeren içeriklerden, belirli uzunluğa kadar kullanılan bölümleri temizleyip, SEO description olarak kullanmak, programatik yaratılan arama motoru optimizasyonlarında sıkça kullanılan bir yöntemdir.</p><p>Ancak description bölümünde herhangi bir kodun karışması sitenizin görüntüsünü ve çalışmasını olumsuz yönde etkileyecektir. Aşağıdaki kodu kullanarak html içeriklerinizi güvenilir çıplak bir metin içeriği haline getirebilirsiniz.</p><pre class="brush: cpp; title: ; notranslate">
private static string StripHTML(string source)
    {
        string result;
        result = source.Replace(&quot;\r&quot;, &quot; &quot;);
        result = result.Replace(&quot;\n&quot;, &quot; &quot;);
        result = result.Replace(&quot;\t&quot;, string.Empty);
        result = System.Text.RegularExpressions.Regex.Replace(result,@&quot;( )+&quot;, &quot; &quot;);
        result = System.Text.RegularExpressions.Regex.Replace(result,@&quot;&lt;( )*head([^&gt;])*&gt;&quot;, &quot;&lt;head&gt;&quot;,System.Text.RegularExpressions.RegexOptions.IgnoreCase);
        result = System.Text.RegularExpressions.Regex.Replace(result,@&quot;(&lt;( )*(/)( )*head( )*&gt;)&quot;, &quot;&lt;/head&gt;&quot;,System.Text.RegularExpressions.RegexOptions.IgnoreCase);
        result = System.Text.RegularExpressions.Regex.Replace(result,&quot;(&lt;head&gt;).*(&lt;/head&gt;)&quot;, string.Empty,System.Text.RegularExpressions.RegexOptions.IgnoreCase);
        result = System.Text.RegularExpressions.Regex.Replace(result,@&quot;&lt;( )*script([^&gt;])*&gt;&quot;, &quot;&lt;script&gt;&quot;,System.Text.RegularExpressions.RegexOptions.IgnoreCase);
        result = System.Text.RegularExpressions.Regex.Replace(result,@&quot;(&lt;( )*(/)( )*script( )*&gt;)&quot;, &quot;&lt;/script&gt;&quot;,System.Text.RegularExpressions.RegexOptions.IgnoreCase);
        result = System.Text.RegularExpressions.Regex.Replace(result,@&quot;(&lt;script&gt;).*(&lt;/script&gt;)&quot;, string.Empty,System.Text.RegularExpressions.RegexOptions.IgnoreCase);
        result = System.Text.RegularExpressions.Regex.Replace(result,@&quot;&lt;( )*style([^&gt;])*&gt;&quot;, &quot;&lt;style&gt;&quot;,System.Text.RegularExpressions.RegexOptions.IgnoreCase);
        result = System.Text.RegularExpressions.Regex.Replace(result,@&quot;(&lt;( )*(/)( )*style( )*&gt;)&quot;, &quot;&lt;/style&gt;&quot;,System.Text.RegularExpressions.RegexOptions.IgnoreCase);
        result = System.Text.RegularExpressions.Regex.Replace(result,&quot;(&lt;style&gt;).*(&lt;/style&gt;)&quot;, string.Empty,System.Text.RegularExpressions.RegexOptions.IgnoreCase);
        result = System.Text.RegularExpressions.Regex.Replace(result,@&quot;&lt;( )*td([^&gt;])*&gt;&quot;, &quot;\t&quot;,System.Text.RegularExpressions.RegexOptions.IgnoreCase);
        result = System.Text.RegularExpressions.Regex.Replace(result,@&quot;&lt;( )*br( )*&gt;&quot;, &quot;\r&quot;,System.Text.RegularExpressions.RegexOptions.IgnoreCase);
        result = System.Text.RegularExpressions.Regex.Replace(result,@&quot;&lt;( )*li( )*&gt;&quot;, &quot;\r&quot;,System.Text.RegularExpressions.RegexOptions.IgnoreCase);
        result = System.Text.RegularExpressions.Regex.Replace(result,@&quot;&lt;( )*div([^&gt;])*&gt;&quot;, &quot;\r\r&quot;,System.Text.RegularExpressions.RegexOptions.IgnoreCase);
        result = System.Text.RegularExpressions.Regex.Replace(result,@&quot;&lt;( )*tr([^&gt;])*&gt;&quot;, &quot;\r\r&quot;,System.Text.RegularExpressions.RegexOptions.IgnoreCase);
        result = System.Text.RegularExpressions.Regex.Replace(result,@&quot;&lt;( )*p([^&gt;])*&gt;&quot;, &quot;\r\r&quot;,System.Text.RegularExpressions.RegexOptions.IgnoreCase);
        result = System.Text.RegularExpressions.Regex.Replace(result,@&quot;&lt;[^&gt;]*&gt;&quot;, string.Empty,System.Text.RegularExpressions.RegexOptions.IgnoreCase);
        result = System.Text.RegularExpressions.Regex.Replace(result,@&quot; &quot;, &quot; &quot;,System.Text.RegularExpressions.RegexOptions.IgnoreCase);
        result = System.Text.RegularExpressions.Regex.Replace(result,@&quot;&amp;bull;&quot;, &quot; * &quot;,System.Text.RegularExpressions.RegexOptions.IgnoreCase);
        result = System.Text.RegularExpressions.Regex.Replace(result,@&quot;&amp;lsaquo;&quot;, &quot;&lt;&quot;,System.Text.RegularExpressions.RegexOptions.IgnoreCase);
        result = System.Text.RegularExpressions.Regex.Replace(result,@&quot;&amp;rsaquo;&quot;, &quot;&gt;&quot;,System.Text.RegularExpressions.RegexOptions.IgnoreCase);
        result = System.Text.RegularExpressions.Regex.Replace(result,@&quot;&amp;trade;&quot;, &quot;(tm)&quot;,System.Text.RegularExpressions.RegexOptions.IgnoreCase);
        result = System.Text.RegularExpressions.Regex.Replace(result,@&quot;&amp;frasl;&quot;, &quot;/&quot;,System.Text.RegularExpressions.RegexOptions.IgnoreCase);
        result = System.Text.RegularExpressions.Regex.Replace(result,@&quot;&amp;lt;&quot;, &quot;&lt;&quot;,System.Text.RegularExpressions.RegexOptions.IgnoreCase);
        result = System.Text.RegularExpressions.Regex.Replace(result,@&quot;&amp;gt;&quot;, &quot;&gt;&quot;,System.Text.RegularExpressions.RegexOptions.IgnoreCase);
        result = System.Text.RegularExpressions.Regex.Replace(result,@&quot;&amp;copy;&quot;, &quot;(c)&quot;,System.Text.RegularExpressions.RegexOptions.IgnoreCase);
        result = System.Text.RegularExpressions.Regex.Replace(result,@&quot;&amp;reg;&quot;, &quot;(r)&quot;,System.Text.RegularExpressions.RegexOptions.IgnoreCase);
        result = System.Text.RegularExpressions.Regex.Replace(result,@&quot;&amp;(.{2,6});&quot;, string.Empty,System.Text.RegularExpressions.RegexOptions.IgnoreCase);
        result = result.Replace(&quot;\n&quot;, &quot;\r&quot;);
        result = System.Text.RegularExpressions.Regex.Replace(result,&quot;(\r)( )+(\r)&quot;, &quot;\r\r&quot;,System.Text.RegularExpressions.RegexOptions.IgnoreCase);
        result = System.Text.RegularExpressions.Regex.Replace(result,&quot;(\t)( )+(\t)&quot;, &quot;\t\t&quot;,System.Text.RegularExpressions.RegexOptions.IgnoreCase);
        result = System.Text.RegularExpressions.Regex.Replace(result,&quot;(\t)( )+(\r)&quot;, &quot;\t\r&quot;,System.Text.RegularExpressions.RegexOptions.IgnoreCase);
        result = System.Text.RegularExpressions.Regex.Replace(result,&quot;(\r)( )+(\t)&quot;, &quot;\r\t&quot;,System.Text.RegularExpressions.RegexOptions.IgnoreCase);
        result = System.Text.RegularExpressions.Regex.Replace(result,&quot;(\r)(\t)+(\r)&quot;, &quot;\r\r&quot;,System.Text.RegularExpressions.RegexOptions.IgnoreCase);
        result = System.Text.RegularExpressions.Regex.Replace(result,&quot;(\r)(\t)+&quot;, &quot;\r\t&quot;,System.Text.RegularExpressions.RegexOptions.IgnoreCase);
        string breaks = &quot;\r\r\r&quot;;
        string tabs = &quot;\t\t\t\t\t&quot;;
        for (int index = 0; index &lt; result.Length; index++)
        {
            result = result.Replace(breaks, &quot;\r\r&quot;);
            result = result.Replace(tabs, &quot;\t\t\t\t&quot;);
            breaks = breaks + &quot;\r&quot;;
            tabs = tabs + &quot;\t&quot;;
        }
        return result;
    }
</pre>]]></content:encoded> <wfw:commentRss>http://www.rizasirman.com/web_tasarim/asp-net/icerikten-html-kodu-temizleme-strip-html/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>URL Rewrite ve SEO İşlemleri İçin Güvenilir Metin</title><link>http://www.rizasirman.com/web_tasarim/asp-net/optimizasyon/url-rewrite-ve-seo-islemleri-icin-guvenilir-metin/</link> <comments>http://www.rizasirman.com/web_tasarim/asp-net/optimizasyon/url-rewrite-ve-seo-islemleri-icin-guvenilir-metin/#comments</comments> <pubDate>Fri, 03 Dec 2010 12:06:34 +0000</pubDate> <dc:creator>Rıza Sırman</dc:creator> <category><![CDATA[c#]]></category> <category><![CDATA[Optimizasyon]]></category> <category><![CDATA[SEO]]></category> <category><![CDATA[arama motoru optimizasyonu]]></category> <category><![CDATA[güvenilir metin]]></category> <category><![CDATA[safe-text]]></category> <category><![CDATA[seo]]></category><guid isPermaLink="false">http://www.rizasirman.com/?p=519</guid> <description><![CDATA[URL re-write, dosya yükleme ve yeniden isimlendirme işlemleri için kullandığınız kodlarda bu sayfadaki gibi bir string fonksiyonu kullanabilir, hem daha sağlıklı URL'ler elde edebilir hem de sisteminizi arama motoru dostu hale getirebilirsiniz.]]></description> <content:encoded><![CDATA[<p><img src="http://www.rizasirman.com/wp-content/uploads/2010/12/seo.png" alt="SEO" title="SEO" width="64" height="64" style="float:left;margin:10px 10px 0 0" />URL re-write, dosya yükleme ve yeniden isimlendirme işlemleri için kullandığınız kodlarda aşağıdaki gibi bir string fonksiyonu kullanabilir, hem daha sağlıklı URL&#8217;ler elde edebilir hem de sisteminizi arama motoru dostu hale getirebilirsiniz. Bir çok web sitemin uygulamasında kullandığım bu methodu aşağıda bulabilirsiniz.</p><p>Kod kısaca gelen string cümlesindeki sakıncalı karakterleri ortadan kaldırıp; türkçe karakterleri, eşleneği latin karakterleri ile değiştiriyor. Ardından bütün cümleyi küçük harflere çeviriyor.</p><pre class="brush: cpp; title: ; notranslate">
public static string SafeText(string IncomingText)
        {
            System.Globalization.CultureInfo Dil = new System.Globalization.CultureInfo(&quot;tr-TR&quot;);

            IncomingText = IncomingText.Replace(&quot;ş&quot;, &quot;s&quot;);
            IncomingText = IncomingText.Replace(&quot;Ş&quot;, &quot;s&quot;);
            IncomingText = IncomingText.Replace(&quot;İ&quot;, &quot;i&quot;);
            IncomingText = IncomingText.Replace(&quot;I&quot;, &quot;i&quot;);
            IncomingText = IncomingText.Replace(&quot;ı&quot;, &quot;i&quot;);
            IncomingText = IncomingText.Replace(&quot;ö&quot;, &quot;o&quot;);
            IncomingText = IncomingText.Replace(&quot;Ö&quot;, &quot;o&quot;);
            IncomingText = IncomingText.Replace(&quot;ü&quot;, &quot;u&quot;);
            IncomingText = IncomingText.Replace(&quot;Ü&quot;, &quot;u&quot;);
            IncomingText = IncomingText.Replace(&quot;Ç&quot;, &quot;c&quot;);
            IncomingText = IncomingText.Replace(&quot;ç&quot;, &quot;c&quot;);
            IncomingText = IncomingText.Replace(&quot;ğ&quot;, &quot;g&quot;);
            IncomingText = IncomingText.Replace(&quot;Ğ&quot;, &quot;g&quot;);
            IncomingText = IncomingText.Replace(&quot; &quot;, &quot;-&quot;);
            IncomingText = IncomingText.Replace(&quot;---&quot;, &quot;-&quot;);
            IncomingText = IncomingText.Replace(&quot;?&quot;, &quot;&quot;);
            IncomingText = IncomingText.Replace(&quot;/&quot;, &quot;&quot;);
            IncomingText = IncomingText.Replace(&quot;.&quot;, &quot;&quot;);
            IncomingText = IncomingText.Replace(&quot;'&quot;, &quot;&quot;);
            IncomingText = IncomingText.Replace(&quot;#&quot;, &quot;&quot;);
            IncomingText = IncomingText.Replace(&quot;%&quot;, &quot;&quot;);
            IncomingText = IncomingText.Replace(&quot;&amp;&quot;, &quot;&quot;);
            IncomingText = IncomingText.Replace(&quot;*&quot;, &quot;&quot;);
            IncomingText = IncomingText.Replace(&quot;!&quot;, &quot;&quot;);
            IncomingText = IncomingText.Replace(&quot;@&quot;, &quot;&quot;);
            IncomingText = IncomingText.Replace(&quot;+&quot;, &quot;&quot;);

            IncomingText = IncomingText.ToLower();
            IncomingText = IncomingText.Trim();
            return IncomingText;
        }
</pre>]]></content:encoded> <wfw:commentRss>http://www.rizasirman.com/web_tasarim/asp-net/optimizasyon/url-rewrite-ve-seo-islemleri-icin-guvenilir-metin/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> <item><title>Identitiy Kullanılan Tablodan Insert Sorgusunun Çıktısını Almak</title><link>http://www.rizasirman.com/web_tasarim/asp-net/identitiy-kullanilan-tablodan-insert-sorgusunun-ciktisini-almak/</link> <comments>http://www.rizasirman.com/web_tasarim/asp-net/identitiy-kullanilan-tablodan-insert-sorgusunun-ciktisini-almak/#comments</comments> <pubDate>Fri, 03 Dec 2010 11:39:35 +0000</pubDate> <dc:creator>Rıza Sırman</dc:creator> <category><![CDATA[ASP.NET]]></category> <category><![CDATA[MS-SQL]]></category> <category><![CDATA[connectionstring]]></category> <category><![CDATA[identity]]></category> <category><![CDATA[insert]]></category> <category><![CDATA[ms-sql]]></category> <category><![CDATA[output]]></category> <category><![CDATA[parameter]]></category> <category><![CDATA[parametre]]></category> <category><![CDATA[query]]></category> <category><![CDATA[sorgu]]></category><guid isPermaLink="false">http://www.rizasirman.com/?p=508</guid> <description><![CDATA[Primary Key olarak kullandığınız kolonu eğer tablonuzda identity olarak tanımladıysanız, bir satır eklediğinizde primay key yani birincil anahtarın aldığı değeri normal bir insert sorgusu ile elde edemezsiniz. Halbuki bu değer size diğer işlemlerde gerekli olabilir. Bunun için aşağıdaki gibi bir kod kullanabilirsiniz. Burda kullandığım &#8220;outp&#8221; sql parametresi yapılan insert işleminden gelen identity kimlik değerini, yani&#8230;]]></description> <content:encoded><![CDATA[<p><a href="http://www.rizasirman.com/wp-content/uploads/2010/12/ms-sql-server-2008.png"><img src="http://www.rizasirman.com/wp-content/uploads/2010/12/ms-sql-server-2008-300x187.png" alt="MS Sql Server 2008" title="MS Sql Server 2008" width="300" height="187" class="alignright size-medium wp-image-514" /></a>Primary Key olarak kullandığınız kolonu eğer tablonuzda identity olarak tanımladıysanız, bir satır eklediğinizde primay key yani birincil anahtarın aldığı değeri normal bir insert sorgusu ile elde edemezsiniz. Halbuki bu değer size diğer işlemlerde gerekli olabilir. Bunun için aşağıdaki gibi bir kod kullanabilirsiniz. Burda kullandığım &#8220;outp&#8221; sql parametresi yapılan insert işleminden gelen identity kimlik değerini, yani primary key için otomatik üretilen değeri bize kodumuzda döndürüyor.</p><p>Ayrıca, MyConnectionString ismindeki connection string&#8217;imiz yani veritabanı bağlantı cümlemiz, web.config dosyanızdan okunmaktadır. Siz de bu parametreleri ve değişkenleri düzenleyerek aşağıdaki gibi kendi kodunuzu oluşturabilirsiniz.</p><pre class="brush: cpp; title: ; notranslate">
                string ConnectionString = ConfigurationManager.ConnectionStrings[&quot;MyConnectionString&quot;].ToString();
                SqlConnection conn = new SqlConnection(ConnectionString);
                conn.Open();
                SqlCommand cmd = new SqlCommand(&quot;Insert Into Tablo1 (Kolon1,Kolon2) Values (@Kolon1,@Kolon2); SELECT @ID = SCOPE_IDENTITY()&quot;, conn);
                cmd.Parameters.AddWithValue(&quot;@Kolon1&quot;, Parametre1);
                cmd.Parameters.AddWithValue(&quot;@Kolon2&quot;, Parametre2);
                SqlParameter outp = new SqlParameter(&quot;@ID&quot;, SqlDbType.Int);
                outp.Direction = ParameterDirection.Output;
                cmd.Parameters.Add(outp);
                cmd.ExecuteNonQuery();
                conn.Close();
                conn.Dispose();
                return int.Parse(outp.Value.ToString());
</pre>]]></content:encoded> <wfw:commentRss>http://www.rizasirman.com/web_tasarim/asp-net/identitiy-kullanilan-tablodan-insert-sorgusunun-ciktisini-almak/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Deflate metoduyla http kompres ekleme</title><link>http://www.rizasirman.com/web_tasarim/asp-net/deflate-metoduyla-http-kompres-ekleme/</link> <comments>http://www.rizasirman.com/web_tasarim/asp-net/deflate-metoduyla-http-kompres-ekleme/#comments</comments> <pubDate>Mon, 08 Nov 2010 14:51:00 +0000</pubDate> <dc:creator>Rıza Sırman</dc:creator> <category><![CDATA[ASP.NET]]></category> <category><![CDATA[Optimizasyon]]></category> <category><![CDATA[SEO]]></category> <category><![CDATA[compress]]></category> <category><![CDATA[deflate]]></category> <category><![CDATA[gzip]]></category> <category><![CDATA[http compress]]></category> <category><![CDATA[kompres]]></category> <category><![CDATA[optimizasyon]]></category> <category><![CDATA[optimize]]></category> <category><![CDATA[performans]]></category><guid isPermaLink="false">http://www.rizasirman.com/?p=448</guid> <description><![CDATA[En meşhur http kompres yani sıkıştırma metodu bildiğiniz gibi gzip. Ancak deflate methodu daha çok sıkıştırma yapabiliyor ve daha performanslı çalışabiliyor. Konu hakkında aşağıdaki makaleyi okuyabilirsiniz. http://www.stardeveloper.com/articles/display.html?article=2008111201&#038;page=1 Sitenize deflate kompres eklemek için global.asax dosyanıza (sitenizde yoksa ekleyin) aşağıdaki kodları ekleyin. Böylece ziyaretçinin browser&#8217;ı deflate methodunu kabul ediyorsa deflate, etmiyorsa gzip, onu da kabul etmiyorsa kompres&#8230;]]></description> <content:encoded><![CDATA[<p>En meşhur http kompres yani sıkıştırma metodu bildiğiniz gibi gzip. Ancak deflate methodu daha çok sıkıştırma yapabiliyor ve daha performanslı çalışabiliyor. Konu hakkında aşağıdaki makaleyi okuyabilirsiniz.</p><p><a href="http://www.stardeveloper.com/articles/display.html?article=2008111201&#038;page=1" rel="external">http://www.stardeveloper.com/articles/display.html?article=2008111201&#038;page=1</a></p><p>Sitenize deflate kompres eklemek için global.asax dosyanıza (sitenizde yoksa ekleyin) aşağıdaki kodları ekleyin. Böylece ziyaretçinin browser&#8217;ı deflate methodunu kabul ediyorsa deflate, etmiyorsa gzip, onu da kabul etmiyorsa kompres etmeden sunucunuzdan gönderim yapılacaktır.</p><pre class="brush: cpp; title: ; notranslate">
&lt;%@ Application Language=&quot;C#&quot; %&gt;
&lt;%@ Import Namespace=&quot;System.IO&quot; %&gt;
&lt;%@ Import Namespace=&quot;System.IO.Compression&quot; %&gt;

&lt;script runat=&quot;server&quot;&gt;
void Application_PreRequestHandlerExecute(object sender, EventArgs e)
{
	HttpApplication app = sender as HttpApplication;
	string acceptEncoding = app.Request.Headers[&quot;Accept-Encoding&quot;];
	Stream prevUncompressedStream = app.Response.Filter;

	if (!(app.Context.CurrentHandler is Page ||
		app.Context.CurrentHandler.GetType().Name == &quot;SyncSessionlessHandler&quot;) ||
		app.Request[&quot;HTTP_X_MICROSOFTAJAX&quot;] != null)
		return;

	if (acceptEncoding == null || acceptEncoding.Length == 0)
		return;

	acceptEncoding = acceptEncoding.ToLower();

	if (acceptEncoding.Contains(&quot;deflate&quot;) || acceptEncoding == &quot;*&quot;)
	{
		// deflate
		app.Response.Filter = new DeflateStream(prevUncompressedStream,
			CompressionMode.Compress);
		app.Response.AppendHeader(&quot;Content-Encoding&quot;, &quot;deflate&quot;);
	} else if (acceptEncoding.Contains(&quot;gzip&quot;))
	{
		// gzip
		app.Response.Filter = new GZipStream(prevUncompressedStream,
			CompressionMode.Compress);
		app.Response.AppendHeader(&quot;Content-Encoding&quot;, &quot;gzip&quot;);
	}
}
&lt;/script&gt;
</pre>]]></content:encoded> <wfw:commentRss>http://www.rizasirman.com/web_tasarim/asp-net/deflate-metoduyla-http-kompres-ekleme/feed/</wfw:commentRss> <slash:comments>2</slash:comments> </item> <item><title>Üretilen HTML kodunuzu minimize etme, boşlukları temizleme</title><link>http://www.rizasirman.com/web_tasarim/asp-net/uretilen-html-kodunuzu-minimize-etme-bosluklari-temizleme/</link> <comments>http://www.rizasirman.com/web_tasarim/asp-net/uretilen-html-kodunuzu-minimize-etme-bosluklari-temizleme/#comments</comments> <pubDate>Mon, 08 Nov 2010 14:01:54 +0000</pubDate> <dc:creator>Rıza Sırman</dc:creator> <category><![CDATA[ASP.NET]]></category> <category><![CDATA[Optimizasyon]]></category> <category><![CDATA[SEO]]></category> <category><![CDATA[boşluk temizleme]]></category> <category><![CDATA[html minimize]]></category> <category><![CDATA[optimizasyon]]></category><guid isPermaLink="false">http://www.rizasirman.com/?p=440</guid> <description><![CDATA[Bu optimizasyonu yapmak istediğiniz sayfaya ve/veya master page&#8217;inize aşağıdaki kodları ekleyin: Tabii ki namespace&#8217;inizi eklemeyi unutmayın: using System.Text.RegularExpressions;]]></description> <content:encoded><![CDATA[<p>Bu optimizasyonu yapmak istediğiniz sayfaya ve/veya master page&#8217;inize aşağıdaki kodları ekleyin:</p><pre class="brush: cpp; title: ; notranslate">
protected override void Render(HtmlTextWriter writer)
    {
        using (HtmlTextWriter htmlwriter = new HtmlTextWriter(new System.IO.StringWriter()))
        {
            base.Render(htmlwriter);
            string html = htmlwriter.InnerWriter.ToString();
            html = RemoveWhitespaceFromHtml(html);
            writer.Write(html);
        }
    }
    public static string RemoveWhitespaceFromHtml(string html)
    {
        html = RegexBetweenTags.Replace(html, &quot;&gt;&quot;);
        html = RegexLineBreaks.Replace(html, &quot;&lt;&quot;);
        return html.Trim();
    }
    private static readonly Regex RegexBetweenTags = new Regex(@&quot;&gt;(?! )\s+&quot;, RegexOptions.Compiled);
    private static readonly Regex RegexLineBreaks = new Regex(@&quot;([\n\s])+?(?&lt;= {2,})&lt;&quot;, RegexOptions.Compiled);
</pre><p>Tabii ki namespace&#8217;inizi eklemeyi unutmayın:</p><p>using System.Text.RegularExpressions;</p> ]]></content:encoded> <wfw:commentRss>http://www.rizasirman.com/web_tasarim/asp-net/uretilen-html-kodunuzu-minimize-etme-bosluklari-temizleme/feed/</wfw:commentRss> <slash:comments>2</slash:comments> </item> <item><title>Statik içerik için cache ayarları</title><link>http://www.rizasirman.com/web_tasarim/asp-net/statik-icerik-icin-cache-ayarlari/</link> <comments>http://www.rizasirman.com/web_tasarim/asp-net/statik-icerik-icin-cache-ayarlari/#comments</comments> <pubDate>Mon, 08 Nov 2010 09:22:43 +0000</pubDate> <dc:creator>Rıza Sırman</dc:creator> <category><![CDATA[ASP.NET]]></category> <category><![CDATA[Optimizasyon]]></category> <category><![CDATA[SEO]]></category> <category><![CDATA[cache]]></category> <category><![CDATA[optimizasyon]]></category> <category><![CDATA[performans]]></category> <category><![CDATA[statik içerik]]></category><guid isPermaLink="false">http://www.rizasirman.com/?p=432</guid> <description><![CDATA[Firefox ve Firebug kullanarak sitenizin performansını yükseltmek istiyorsanız, Page Speed eklentisinde ilk göreceğiniz hatalardan biri şu olacaktır. Leverage browser caching başlığı altında]]></description> <content:encoded><![CDATA[<p>Firefox ve Firebug kullanarak sitenizin performansını yükseltmek istiyorsanız, Page Speed eklentisinde ilk göreceğiniz hatalardan biri şu olacaktır.</p><p>Leverage browser caching başlığı altında<br /> <The following cacheable resources have a short freshness lifetime. Specify an expiration at least one week in the future for the following resources</pre><p>Bu hatanın tam anlamı şudur. Sitenizde kullanılan css, javascript ve resim dosyalarınızın ziyaretçinin bilgisayarında ne kadar süre cachleneceğinizi belirtmeniz gerekiyor. Asp.net ve IIS 7 sayesinde bunu web.config dosyanızın system.webserver bloğunda aşağıdaki kodlarla basitçe gerçekleştirebilir ve sitenizin performanısını kullandığınız statik içeriğin miktarı doğrultusunda %1-%5 gibi oranlarda arttırabilirsiniz.</p><pre class="brush: xml; title: ; notranslate">
&lt;staticContent&gt;
    &lt;clientCache cacheControlMaxAge=&quot;10.00:00:00&quot; cacheControlMode=&quot;UseMaxAge&quot; /&gt;
&lt;/staticContent&gt;
</pre><p>Bu kod ile statik içeriğin cache zamanını 10 gün olarak belirleyebilirsiniz.</p><pre class="brush: xml; title: ; notranslate">
&lt;staticContent&gt;
    &lt;clientCache httpExpires=&quot;Sun, 29 Mar 2020 00:00:00 GMT&quot; cacheControlMode=&quot;UseExpires&quot; /&gt;
&lt;/staticContent&gt;
</pre><p>Bu kod ile de sitenizin statik içeriğini 29 Mart 2020 tarihine cachelenebilir kılabilirsiniz.</p> ]]></content:encoded> <wfw:commentRss>http://www.rizasirman.com/web_tasarim/asp-net/statik-icerik-icin-cache-ayarlari/feed/</wfw:commentRss> <slash:comments>5</slash:comments> </item> <item><title>Sunucu Taraflı E-posta Adresi Validasyonu</title><link>http://www.rizasirman.com/web_tasarim/asp-net/sunucu-tarafli-e-posta-adresi-validasyonu/</link> <comments>http://www.rizasirman.com/web_tasarim/asp-net/sunucu-tarafli-e-posta-adresi-validasyonu/#comments</comments> <pubDate>Sun, 07 Nov 2010 16:37:55 +0000</pubDate> <dc:creator>Rıza Sırman</dc:creator> <category><![CDATA[ASP.NET]]></category> <category><![CDATA[Validasyon]]></category> <category><![CDATA[e-bülten]]></category> <category><![CDATA[e-mail]]></category> <category><![CDATA[e-posta]]></category> <category><![CDATA[mail]]></category> <category><![CDATA[mail-list]]></category> <category><![CDATA[newsletter]]></category> <category><![CDATA[regex]]></category> <category><![CDATA[server-side regular expression]]></category> <category><![CDATA[validasyon]]></category> <category><![CDATA[validation]]></category><guid isPermaLink="false">http://www.rizasirman.com/?p=428</guid> <description><![CDATA[Bir e-bülten üyeliği yaptığınızı düşünelim. Kullancının adını soyadını ve email adresini bırakarak güncel olarak müşterinizden haberdar olmak istediği bir sistem kuracaksınız. Elbetteki asp.net&#8217;in validator kontrollerini kullanacaksınız. Ancak en basit yoldan alacağınız saldırı şu olacaktır: kullanıcı Mozilla Firefox ile sitenize bağlanacak ve javasciptlerini etkisizleştirecektir. Böylece e-posta için kullandığınız textbox&#8217;a istediği kodu yazıp veritabanınıza gönderme imkanına sahip&#8230;]]></description> <content:encoded><![CDATA[<p><a href="http://www.rizasirman.com/wp-content/uploads/2010/11/validasyon.gif"><img src="http://www.rizasirman.com/wp-content/uploads/2010/11/validasyon-150x150.gif" alt="Validasyon" title="Validasyon" width="150" height="150" class="alignright size-thumbnail wp-image-467" /></a>Bir e-bülten üyeliği yaptığınızı düşünelim. Kullancının adını soyadını ve email adresini bırakarak güncel olarak müşterinizden haberdar olmak istediği bir sistem kuracaksınız. Elbetteki asp.net&#8217;in validator kontrollerini kullanacaksınız. Ancak en basit yoldan alacağınız saldırı şu olacaktır: kullanıcı Mozilla Firefox ile sitenize bağlanacak ve javasciptlerini etkisizleştirecektir. Böylece e-posta için kullandığınız textbox&#8217;a istediği kodu yazıp veritabanınıza gönderme imkanına sahip olacaktır. Bu yüzden bu alanlardan gelecek verileri server-side yani sunucu tarafında da kontrol etmeniz gerekmektedir.</p><p>Page.IsValid kontrolünü yine her ihtiyacımıza karşılık kullanıyoruz. E-mail regular expression validator&#8217;ın ürettiği regex&#8217;in aynısını bir de sunucu tarafında kontrol ettiriyoruz ancak bu validasyon türkçe karakter ile girilen e-mail adreslerinde olumsuz sonuç döndürüyor. Ben buna ek olarak TurkishOk isminde bir değişken kullanarak gerekli kontrolleri kullanıcıyorum. Aşağıda yazdığım kodu sunucu tarafındaki kodlarınıza eklediğinizde sağlıklı bir e-bülten listesine sahip olabilirsiniz.</p><pre class="brush: cpp; title: ; notranslate">
if (Page.IsValid)
        {
            Regex regEmail = new Regex(@&quot;\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*&quot;);
            Match matchEmail = regEmail.Match(NewsletterEmailTxt.Text);
            bool TurkishOk = (!(NewsletterEmailTxt.Text.Contains('İ') || NewsletterEmailTxt.Text.Contains('ı') || NewsletterEmailTxt.Text.Contains('Ü') || NewsletterEmailTxt.Text.Contains('ü') || NewsletterEmailTxt.Text.Contains('Ğ') || NewsletterEmailTxt.Text.Contains('ğ') || NewsletterEmailTxt.Text.Contains('Ş') || NewsletterEmailTxt.Text.Contains('ş') || NewsletterEmailTxt.Text.Contains('Ç') || NewsletterEmailTxt.Text.Contains('ç') || NewsletterEmailTxt.Text.Contains('Ö') || NewsletterEmailTxt.Text.Contains('ö')));
            if (matchEmail.Success &amp;&amp; TurkishOk)
            {
                bool done = MyHelpers.NewsletterSubscription(NewsletterNameTxt.Text, NewsletterEmailTxt.Text);

                if (!done)
                {
                    NewsErrorLbl.Visible = true;
                    NewsErrorLbl.Text = &quot;Kayıt işleminiz başarısız. Lütfen tekrar deneyin.&quot;;
                }
                else
                {
                    NewsErrorLbl.Visible = false;
                    Response.Redirect(&quot;~/e-bulten-tesekkurler.aspx&quot;);
                }
            }
            else
            {
                NewsErrorLbl.Visible = true;
                NewsErrorLbl.Text = &quot;Lütfen e-posta adresinizi kontrol edin.&quot;;
            }
        }
        else
        {
            NewsErrorLbl.Visible = true;
            NewsErrorLbl.Text = &quot;Lütfen formda gerekli alanları doğru bir şekilde doldurun.&quot;;
        }
</pre><p>Tabii ki namespace&#8217;lerinize aşağıdaki satırı eklemeyi unutmayın.</p><pre><code>
using System.Text.RegularExpressions;
</code></pre>]]></content:encoded> <wfw:commentRss>http://www.rizasirman.com/web_tasarim/asp-net/sunucu-tarafli-e-posta-adresi-validasyonu/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: basic

Served from: www.rizasirman.com @ 2012-05-19 10:34:26 -->
