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
)

jquery - asp.net autocomplete

http://www.eggheadcafe.com/tutorials/aspnet/18b6a1fa-a7cf-4507-84f2-15056fe65bb7/autocompletion-with-jque.aspx

ek:


  1. <script type="text/javascript">  
  2.    $(document).ready(function() {  
  3.        $("input#<%=txtKelime.ClientID %>").autocomplete('Ara.aspx').result(function(event, item) {  
  4.            $("#<%=txtGizliAlan.ClientID %>").val(item.toString().split(",")[1]);  
  5.        });  
  6. });      
  7. script>  
  8.   
  9. <form runat="server" id="form1">  
  10.     <asp:textbox id="txtKelime" runat="server">  
  11.     <asp:textbox id="txtGizliAlan" runat="server" style="display:none">  
  12. asp:textbox>asp:textbox>form> 


linq to sql - [error] row not found or changed

I solved this error by redragging over a table from the server explorer to the designer and re-building. So indeed, the designer was out-of-synch with the actual SQL Table.

http://social.msdn.microsoft.com/forums/en-US/linqprojectgeneral/thread/c672c8ee-bf2a-41b4-bb8b-aa76cc5d9b95/

How to copy data off your Zune

Figured this out earlier today:

I highly recommend backing up these registry values before modifying anything. If you don’t know how to do that, I don’t recommend that you even attempt this right now =)

Make sure your Zune is not plugged in and your Zune software isn’t running
open up regedit by going to the start menu and selecting “run”. Type regedt32 and hit “OK”
Browse to HKEY_LOCAL_MACHINE\System\ControlSet001\Enum\USB\
Search for “PortableDeviceNameSpace”. This should be contained in the Vid_####&Pid_####\########_-_########_-_########_-_########\Device Parameters within the above …\USB\ The ##’s listed here will be numbers and letters specific to your Zune
Change the following values:
EnableLegacySupport to 1
PortableDeviceNameSpaceExcludeFromShell to 0
ShowInShell to 1
Plug in your Zune, and make sure the Zune Software starts up.
Hopefully at this point you can open up “My Computer” and browse your device, though it does NOT show up as a drive letter.
Right now I can access it both as a harddrive and sync through the Zune Software.

[Edit: This was first posted here and ZuneBoards.com after I figured it out. For more information, check out ZuneBoards.com!]

http://phaleux.com/?p=8

search this blog (most likely not here)