ajaxcontroltoolkit ipuçları

slideshow'da imaj görüntülenemezse, title ve description da görüntülenemez.


sql dönen kayıt sayısını sınırlamak

Declare @RowCount int


IF @RowCount > 0
Set ROWCOUNT @RowCount

ORA-12560:TNS:PROTOKOL bağdaştırıcısı hatası

veritabanı yaratma sırasında bu hatayla karşılaştım. bazı forumlarda çözüm için bölgesel ayarları united states olarak değiştirmek öneriliyordu. değiştirdiğim halde olumlu sonuç alamayınca, yaratmak istediğim veritabınının adını kontrol ettim. adın içinde i harfi geçiyordu. bunu kaldırdığımda veritabanı yaratıldı. tabii ki bu geçici bir çözüm. ama oracle'a henüz giriş yapıyorum. bu nedenle bu sorunla oyalanmak istemedim.


javascript linki verme

<script type="text/javascript" src="xxx.js" />

doğru : chrome
hatalı : ff, ie7

<script type="text/javascript" src="xxx.js"></script>

doğru : chrome, ff, ie7


The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>)

The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>)

You have put script inside meta... you don't need to do so.
just put the javascript inside your aspx page only. but shift it inside body tag. Remove it from 
code behind. You need to put all the meta related information inside page_load. Don't forget to put .visible=true at the end of it.


from tayyube to youtube

c:\WINDOWS\system32\drivers\etc

dizinindeki hosts dosyasını notepad ile açıp, en sona
208.117.236.70 youtube.com
208.117.236.70 www.youtube.com
ekle.

asp.net menu & chrome

The asp.net menu does a check to see if the browser the client uses can support JavaScript or not. But the check is not a very good one!

You can force the menu to work by overwrite the Page_PreInit method on the page and telling the page that the client target is a modern “uplevel” browser:-

protected void Page_PreInit(object sender, EventArgs e)
{
if (Page.Request.ServerVariables["http_user_agent"].ToLower().Contains("safari"))
{
Page.ClientTarget = "uplevel";
}
}

Please note that you have to do this in the page class file, and not in the master page class file. Obviously this means you have to do it for every page – which is not ideal.

To get round this limitation simply make a class which inherits from System.Web.UI.Page, and change all your pages to inherit from this class instead (a find and replace is ideal here!).

movable div

<div id="imgbox"></div>
<script type="text/javascript">
    function Large(obj) {
        var imgbox = document.getElementById("imgbox");
        imgbox.style.visibility = 'visible';
        var img = document.createElement("img");
        img.src = obj.src;
        img.style.width = obj.width * 2;
        img.style.height = obj.height * 2;
        imgbox.innerHTML = '';
        imgbox.appendChild(img);
    }

    function Out(obj) {
        document.getElementById("imgbox").style.visibility = 'hidden';
    }

    function Move(obj, e) {
        var mouseY = e.clientY;
        alert(e.x)
        var mouseX = e.clientX;
        var scrollTop = document.documentElement.scrollTop;
        var scrollLeft = document.documentElement.scrollLeft;
        var y = scrollTop + mouseY + 20;
        var x = scrollLeft + mouseX + 20;
        document.getElementById("imgbox").style.left = x + "px";
        document.getElementById("imgbox").style.top = y + "px";
    }
</script>


textbox & button işbirliği (defaultbutton)

aktif (focused) textbox'ta iken enter'a basatığımda belirli bir buton (genellikle hemen yanındaki buton) çalışsın isttiyorum. o halde yapmam gereken şu kadar basit: textbox ve button'ı bir panel içine alıp, bu button'ı panel'in defaultbutton'ı olarak ayarlamak.

asp:Panel ID="Panel1" runat="server" DefaultButton="btnSearch"
            asp:TextBox ID="txtSearch" runat="server" />
            asp:ImageButton ID="btnSearch" runat="server" ImageUrl="~/Img/search.gif" OnClick="btnSearch_Click" />
/asp:Panel>

asp.net publish failed, but no errors displayed


eğer publish sırasında "publish failed" uyarısı alındığı halde, hiç "error" görünmüyorsa, hatayı görmek için output window kullanılabilir.

window'daki hata şöyleydi :
Unable to add 'Pages/ConfirmEmail.aspx' to the Web site.  The file 'Pages\ConfirmEmail.aspx' already exists in this Web site.Unable to add 'Pages/CreateUser.aspx' to the Web site.  The file 'Pages\CreateUser.aspx' already exists in this Web site.Unable to add 'Pages/Error.aspx' to the Web site.  The file 'Pages\Error.aspx' already exists in this Web site.Unable to add 'Pages/Login.aspx' to the Web site.  The file 'Pages\Login.aspx' already exists in this Web site.Unable to add 'Pages/PassReminder.aspx' to the Web site.  The file 'Pages\PassReminder.aspx' already exists in this Web site.Unable to add 'Pages/Search2.aspx' to the Web site.  The file 'Pages\Search2.aspx' already exists in this Web site.Unable to add 'Pages/ViewNotice.aspx' to the Web site.  The file 'Pages\ViewNotice.aspx' already exists in this Web site.Error: The operation could not be completed 
========== Build: 4 succeeded or up-to-date, 0 failed, 1 skipped ==========
========== Publish: 0 succeeded, 1 failed, 0 skipped ==========
fakat belirtildiği gibi bir hata yoktu.  belirtilen dizinde (pages/)  bazı dosya adları bozulmuştu. bu dosyaları silemediğim için de, farklı bir dizine publish işlemini yaptım.
bu hatanın daha sık rastlanan nedeni ise, aynı ada sahip sınıflar kullanmaktır. bu da şu linkte açıklanmış:

search this blog (most likely not here)