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>

aspx2razor, a tool to convert WebForm to Razor

aspx2razor.exe c:\MyProject\MyViews\*.cshtml MyOutputDirectory -r


http://blogs.telerik.com/blogs/posts/11-01-19/webforms_to_razor_view_converter_tool.aspx

http://weblogs.asp.net/pglavich/archive/2011/06/06/converting-from-webforms-view-engine-to-razor-some-tips.aspx