Pages

Wednesday, June 8, 2011

How do I turn on off a checkbox with JQuery or Javascript?

For specific checkbox:
check:
$("form #mycheckbox").attr('checked', true);
uncheck:
$("form #mycheckbox").attr('checked', false);

How to solve “The ObjectContext instance has been disposed and can no longer be used for operations that require a connection”

Convert your LINQ query result into array or iList:



                return query.ToList();
Or

                return query.ToArray();


           

How to detect iframe src / URL change event by javascript?

By onload event in iframe:

<iframe src="http://www.google.com/" onLoad="alert('Test');"></iframe>
<iframe src="/test.html" onLoad="alert(this.contentWindow.location);"></iframe>