M3 Mobile Ayarlar

30 Eki 2013 In:

 

Yok Böyle Bir Hata

27 Eki 2013 In: hoş

Bugün 27.10.2013 saatler 04:00 da bir saat geriye alınıyor.

Projedeki /css/bootstrap/bootstrap-responsive.min.css üzerinde bir değişiklik yaptım ve derleyince aşagıdaki hatayı almaya başladım :

Specified argument was out of the range of valid values.
Parameter name: utcDate

 


Ne yaptıysam olmadı, taa ki saatlerin 1 saat geri alındıgını fark edinceye kada :)

 

Hemen Date/Time -> Change Time Zone -> Automatically adjust clock.. kaldırdım sorun çözüldü. Ama nasıl bir durumdur bu, zamanda geriye yolculuk yaptıgımız için VS saçmalar?

C# ile TC Kimlik No Kontrolü ve Bulma

16 Eki 2013 In:
  public bool TCKimlikNoMu(string mtn)
    {
        try
        {
            int index = 0;
            int toplam = 0;
            foreach (char n in mtn)
            {
                if (index < 10)
                {
                    toplam += Convert.ToInt32(char.ToString(n));
                }
                index++;
            }
            if (toplam % 10 == Convert.ToInt32(mtn[10].ToString()))
            {
                return true;
            }
            else
            {
                return false;
            }
        }
        catch
        {
            return false;
        }
    }
 
---------------------------------------------------------------------------
 
    public string TCKimlikNoBulMetninIcinde(string mtn)
    {
        string bl = "";
        if (mtn.Length > 12)
        {
            if (TCKimlikNoMu(mtn.Substring(0, 11)))
            {
                return mtn.Substring(0, 11);
            }
        }

        for (int i = 0; i < mtn.Length; i++)
        {
            if (char.IsDigit(mtn[i]))
            {
                bl += mtn[i];
            }
            else
                bl = "";

            if (bl.Length == 11 && !char.IsDigit((mtn.Length - 1 == i ? ' ' : mtn[i + 1])))
                if (TCKimlikNoMu(bl))
                {
                    return bl;
                }
        }
        return "";
    }
 <script type="text/javascript">
        function DisableButtons() {
            $('#loading').show();
        }

        function oki() {
            $('#loading').hide();
        }
        window.onbeforeunload = DisableButtons;
        window.onload = oki;
    </script>

    <style>
        .ShadowNone {
            text-shadow: none;
            font-size: 14px;
            font-weight: 600;
            text-align: right;
        }

        #loading {
            width: 100%;
            height: 100%;
            top: 0;
            left: 0;
            position: fixed;
            display: block;
            opacity: 0.7;
            background-color: #fff;
            z-index: 999;
            text-align: center;
        }

        #loading-image {
            position: absolute;
            z-index: 1000;
            left: 45%;
            top: 45%;
        }
    </style>


///-----------------------------------------------///

 <div id="loading" style="display: none;">
        <img id="loading-image" src="images/loading.gif" alt="Yükleniyor..." />
 </div>

AJAX ile async işlemler

3 Eki 2013 In: .net, ipucu

ASP.NET de async işlem yapabilmek için JQueryden faydalanmanız gerekiyor.
Bunu 2 yöntem ile yapmak mümkün

1. ScriptManager
2. JQuery methodları ile

2. methoda daha dogal geldiginden işlemlerimizi onunla gerçekleştiricez.

a) İlk olarak .cs tarafında methodumuzu yazalım :

[System.Web.Services.WebMethod]
        public static string Kaydet(string a,string b)
        {
            string result = "OK : " + a + " - ";
            return result;
        } 


b) Şimdi JQuery kütüphaneleri eklediginizi düşünerek hemen HTML kontrolün çağıracagı JS methoda oluşturalım :

     function Kaydetsene(a,b) {
    $.ajax({
        type: "POST",
        url: "sevkiyatci.aspx/Kaydet",
        data: "{a:'aaaa',b:'bb'}",
        contentType: "application/json;",
        dataType: "json",
        success: function(response) { alert("OK : "+ response.d);},
        failure: function(response) { alert("HATA : "+ response.d);}
    });
}

 

c) Son alarakda methodu control üzerindeki bi event ile çagırıyoruz

 OnClick='<%# Eval("Fat_No","Kaydetsene(\"{0}\",\"2\");") %>'  

 OnClick='<%# "Kaydetsene(\"" + Eval("Fat_No") + "\",\"2\");" %>' 

 

 

//-----digerleri------

var k = $('[id$=lbl_kim]').attr('title');
var params = "{'Kimden':'"+k+"'}";

$('#okun').text('0');

setTimeout("GetMSJsayisi();", 10000);

 

// digerleri iki - eger farklı ise

  <system.webServer>

    <validation validateIntegratedModeConfiguration="false"/>

    <modules>

      <remove name="ScriptModule"/>

      <add name="ScriptModule" preCondition="managedHandler" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>

    </modules>

    <handlers>

      <remove name="WebServiceHandlerFactory-Integrated"/>

      <remove name="ScriptHandlerFactory"/>

      <remove name="ScriptHandlerFactoryAppServices"/>

      <remove name="ScriptResource"/>

      <add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>

      <add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>

      <add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>

    </handlers>

  </system.webServer> 

 

 

//----------------- dropdownlist

JavaScript ile:

var e = document.getElementById("elementId");
var value = e.options[e.selectedIndex].value;
var text = e.options[e.selectedIndex].text;

jQuery ile:

$("#elementId :selected").text(); // The text content of the selected option
$("#elementId").val(); // The value of the selected option

 

 

IIS de bir ASP.NET hatası

1 Eki 2013 In: .net, ipucu

 

 Hata bu:

The current identity (NT AUTHORITY\NETWORK SERVICE) does not have write access to 'c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files'.

 

Çözüm : 

Sunucuda çalışan Asp.Net versiyonuna ait klasörde  Ör : C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727

 aspnet_regiis -ga "NT Authority\Network Service"

veya

 aspnet_regiis -ga IUSR_<machinename>

 

Bitti gitti... 

Ben Kimim ?

Celiker BahceciMerhabalar, ben Çeliker BAHÇECİ. 2004 den beri özel sektörde bilgisayar mühendisligi ve egitmenlik yapıyorum. Yine aynı yılın Ekim ayından beri sitemde .Net ile programlama ve hayat görüşüm ile ilgili makalelerimi yayınlıyorum. Blogum dışında Yazgelistir.com, mobilnedir.com gibi ineta kapsamındaki bir çok siteye Microsoft teknolojileri ile ilgili yazılar yazmaktayım.
Bu site ile sizinde hayatınızı anlamlandırmanızda bir parça katkımın olması dilegiyle...