lightbox ile onay penceresi açmak

1. notice/details.aspx'e bir hyperlink ekle.
2. navigateurl'ine notice dizinindeki delete.aspx'i
delete.aspx?nid=[noticeid]&rurl=[redirecturl]
biçiminde ver.

javascript tips tricks

1. fonksiyonu kullanılan js kütüphanesine, bu fonksiyondan önce referans verilmelidir:
kütüphane:
script src="js/jquery-1.3.2.js" type="text/javascript"

fonksiyon:
script type="text/javascript"
$(document).ready(function() {
...
});
/script

2. script type="text/javascript" src=' ResolveUrl("~/Scripts/jquery-1.2.6.min.js") '

add html link to dropdownlist

script type="text/javascript" language="javascript"
function JumpToIt(list, url) {
var newPage = url + list.options[list.selectedIndex].value
if (newPage != "None") {
// location.href = newPage
window.open(newPage)
}
}
/script


public bool AddHtmlLink { get; set; }
public string HtmlLinkUrl { get; set; }


if (AddHtmlLink)
       DropDownList1.Attributes.Add("onChange", "JumpToIt(this, '" + HtmlLinkUrl + "')");

http://www.mcfedries.com/JavaScript/linklist2.asp

Making sure Lightbox still works in Ajax UpdatePanel


I recently updated the homepage portfolio section with an Ajax filtering dropdown, allowing readers to filter my portfolio with different technologies and themes. However, that caused my old lightbox effect to lose ground somehow. After days of debugging, I found a way to deal with it, that is I had to manually reinstantiate the lightbox object on page load (clientside), because whenever Ajax fires up a postback, it wipes of the Lightbox entity that was created.

<script type="text/javascript">
    function pageLoad() {
        $('#gallery a.image-thumb').lightBox({ fixedNavigation: true });
    }
script>

yani:

script type="text/javascript"
$(document).ready(function() {
$("a[rel='example1']").colorbox();
});
/script

ek olarak;

script type="text/javascript"
function pageLoad() {
$("a[rel='example1']").colorbox();
}
/script

yazmak gerekecek.

http://www.alectang.com/Blog/Archive/2009/09/17/Making-sure-Lightbox-still-works-in-Ajax-UpdatePanel-53.aspx

http://stackoverflow.com/questions/520645/jquery-datepicker-ms-ajax-updatepanel-doesnt-work-after-post-back

http://www.mail-archive.com/jquery-en@googlegroups.com/msg37808.html

ASP.NET Ajax Control toolkit – Common Problems


Problem 1 : This page is missing a HtmlHead control which is required for the CSS stylesheet link that is being added. Please add
Solution :  make your HEAD tag  to
problem 2 : The Controls collection cannot be modified because the control contains code blocks (i.e. ).
Solution:  Looks like you are using <% tags in your HEAD section code like Javascript code etc…. To fix it wrap your head section with

  and

colorbox jquery çakışması

adım 1:

script type="text/javascript"
$j = jQuery.noConflict();
script

adım 2:

$j("a[rel='example1']").colorbox();

http://www.cemkefeli.com/post/2009/10/12/ColorBox-kullananlar-icin-jQuery-cakismasinin-cozumu.aspx

not: şu anki projede çalışmadı! (script.js dosyası kullanan jquery tab bulunuyor projede ve colorbox'ın ve autocomplete'in çalışmasını önlüyor)

invalid postback or callback argument

Invalid postback or callback argument. Event validation is enabled using in configuration or in a page. For security purposes, this feature verifies that arguments to postback or callback events originate from the server control that originally rendered them. If the data is valid and expected, use the ClientScriptManager.RegisterForEventValidation method in order to register the postback or callback data for validation.

çözüm:

pages enableeventvalidation="true"



ilginç durumlar:
1. bu hata bir sunucuda oluşmazken, bir diğerinde oluştu.
2. hata chrome'da görülmezken, ie7'de görülüyordu.

masterpage'e css ve js bağlama

js ve css dizinleri kök dizinde.


1. durum:

Default.aspx ile MasterPage.master kök dizinde.
MasterPage'deki css ve js dosyaları şu şekilde bağlanmalı:


href="css/colorbox.css"
src="js/jquery.colorbox-min.js"


html çıktı: (Default.aspx)
href="css/colorbox.css"
src="js/jquery.colorbox-min.js"


2. durum:
Default.aspx kök dizinde, MasterPage.master kök dizindeki Shared dizininde. Yani bir alt dizinde.

href="../css/colorbox.css"
src="js/jquery.colorbox-min.js"


html çıktı: (Default.aspx)
href="css/colorbox.css"
src="js/jquery.colorbox-min.js"

Dikkat edilirse, js'nin path'i değişmedi.

derived object'e databinding'de erişmek

gridview'e user list'i bağlarken, user'dan türemiş company nesnesinin (user'da olmayan) name özelliğine nasıl erişilir?
benim bu user nesnesini company'ye dönüştürmem gerek. fakat eval("xxx")'ten başka bir yol bilmiyorum özelliklere veya nesnelere erişim için.

kayıt silmede foreign key engeli nasıl aşılır

foreign key nedeniyle silinemeyen kayıtlar için şu bir çözüm olabilir mi:

1. durum:
örneğin product için en fazla 1 category belirtilebilecek bile olsa, bunu product_category tablosunda tutarak, istendiğinde category'yi silebiliriz ve product çekilirken category çekilmez, bu da herhangi bir sorun oluşturmaz.

cascade bir çözüm olabilir mi?

bir category sileceğim diye bu category'deki bütün product'ları silmenin anlamı var mı?

2. durum:
prod_usagearea tablosu için örnek:
prodid ve usageareaid foreignkey

The DELETE statement conflicted with the REFERENCE constraint "FK_Prod_UsageArea_UsageArea1". The conflict occurred in database "Himerpa", table "dbo.Prod_UsageArea", column 'UsageAreaID'.
The statement has been terminated.

çözüm: delete rule : cascade

sql - update table with join

-- 2 related tables

update t1
set t1.Field = t2.Field
from Table1 t1
join Table2 t2 on t1.id = t2.id

-- 3 related tables


update t1 p
set t1.f1 =
(
select distinct t3.f3
from t3
inner join t2 on t2.f2 = t3.f3
where t2.f2 = t1.f1
order by t3.f3
)

search this blog (most likely not here)