Tag into the ASP.NET Validation JavaScript

This was a neat trick I picked up earlier today.  I had a blocking div that I was throwing up in order to prevent multiple clicks of a button, but found that method lacking once a validation error occurred.  I began to look into how you can check page validity using your own JavaScript and stumbled across this StackOverflow question:  Can I run some custom script after ASP.NET client side page validation occurs.

The first solution is to trigger the validation yourself, which is a valid option, but it’s the second solution by Yuny Rozhovetskiy which I loved — tag into the execution itself with the following code:

1
2
3
4
5
6
7
8
9
10
11
12
13
var originalValidationFunction =Page_ClientValidate;
     if(originalValidationFunction && typeof(originalValidationFunction)=="function")
     {
          Page_ClientValidate=function(validationGroup)
          {
                 originalValidationFunction(validationGroup);
                 if(!Page_IsValid)
                 {
                       // your code here
                      alert("oops!");
                 }
          };
     }
Posted in Programming | Leave a comment

Game Development with SlimDX (Packt Publishing)

Not a half bad book, ~130 pp, gets you up to speed on SlimDX quickly and with very little fanfare.  If you can’t make it through this book, you should probably give up the idea of developing a game. :-)

(SlimDX is a .NET wrapper around the DirectX functionality and is meant to be used from a managed language.)

http://www.amazon.com/Game-Development-SlimDX-Michael-Fontanini/dp/1782167382/ref=sr_1_1?ie=UTF8&qid=1403796216&sr=8-1&keywords=slimdx

Posted in General | Leave a comment

.NET Native Compiler (C#)

Here’s an interesting article from Visual Studio magazine about the .NET native compiler:  http://visualstudiomagazine.com/articles/2014/04/03/more-power-and-faster-development-with-dot-net-native.aspx

I’m curious as to why they chose to compile C# specifically and not IL in general (two stage compilation) and how performance will actually equate once memory management is figured in.  I don’t think it will equal C++ in power 100%, but I do believe it will help to bridge the performance gap between C# and C++.

 

Posted in Programming | Leave a comment