Microsoft Technology, .Net, BizTalk, Sharepoint & etc.

Liedong(Ken) Zheng, Senior SharePoint Developer at SIMPLOT

Archive for July 2nd, 2008

How do I post source code

Posted by ken zheng on July 2, 2008

sourcecode language=’css’]…[/sourcecode

Do not copy and paste this code – write it out (it’s not that long! You can replace the language with “css” with the language that you’re writing in. Currently we support syntax highlighting for the following language codes:

cpp
csharp
css
delphi
html
java
jscript
php
python
ruby
sql
vb
xml

Posted in Uncategorized | Leave a Comment »

See if page is valid from JavaScript

Posted by ken zheng on July 2, 2008

I did a little digging through the javascript code that ASP.Net uses to do its client-side (javascript) validation to figure out how ASP.Net knows if the page or group is valid or not before submitting the form. Here is the hack you can use to do it yourself.

// a empty string means page.
var validationGroupName = "";

if (typeof(Page_ClientValidate) == 'function')
{
var validationResult = Page_ClientValidate(validationGroupName);

if (validationResult == true)
{
// do your cool javascript stuff here. This will only happen if the page or group is valid
}
}

Posted in Uncategorized | Tagged: | 1 Comment »