Tuesday, June 22, 2010

Remember clientaccesspolicy

Remember to have clientaccesspolicy.xml

to enable your WCF to be consumed by silverlight

http://videos.visitmix.com/MIX09/T42F
http://community.dynamics.com/blogs/cesardalatorre/comments/9579.aspx

Wednesday, June 9, 2010

Calling SP using NHibernate with IDBCommand

If there is transaction open.
you need to supply the transaction by enlist it in NHibernate

iSession.Transaction.Enlist(sqlComm);

inject javascript in bookmark

Get stuff from GBone..

it's pretty amazing that we can inject javascript to debug on browser

put this bookmark..
javascript:
var b=document.body;
if(b)
{
void(z=document.createElement('script'));
void(z.src='http://www.company.com/somescript.js');
void(b.appendChild(z));
}

this will run that script on your browser

Jquery.Data

Learning new stuff today..from Rob...

It's better to use Jquery.Data instead of custom attribute in element.
because it will break some browser for custom attribute which not standard.

Thanks Rob..

Here is the example

jQuery.data(div, "test", { first: 16, last: "pizza!" });
$("span:first").text(jQuery.data(div, "test").first);
$("span:last").text(jQuery.data(div, "test").last);

Thursday, June 3, 2010

System.Web.Extension conflicting with the GAC

Be careful when you upgrade the site into 3.5
if you get this error about ambigous with GAC version.
then you need to take this out from your bin folder.

because It may be your version in bin folder is different. 1.1
but in GAC version is 3.5.

Wednesday, June 2, 2010

Without Postback with disable your browser Javascript

Postback is very heavy code to load (viewstate,etc).
such as you want to get rid of this from your form .


So the solution is you can use AJAX.. to handle all this postback to make your page still dynamic or more responsive that before.

But how about if the client browser disable their javascript..
Your page will be static.

so you need to consider this as well.

So the big picture of this solution is to put ajax as common.
but on the event onclick or href.. you can't just call that function to call an ajax.

for example
href="javascript:CallPostbackFunction();"

you need to change this to
href="/page/ajax/somePage.aspx" class="AjaxCall"

then.. in you can check .. if the browser is enabled the javascript..
then you can call your ajax function.

If the javascript is disabled from your browser then you still can load to the proper page. instead of just do nothing.

//check if browser enabled their javascript
jQuery(document).ready(function() {
//perform init and replace to an proper javascript
var ajaxCalls = $('#ajaxCall');
ajaxCalls.unbind('click', this.addClick);
ajaxCalls.bind('click', this.addClick);
});


Here a good reference for Object Oriented Programming in Javascript
http://devedge-temp.mozilla.org/viewsource/2001/oop-javascript/