April 2004 - Posts
Gavin is giving away a free copy of his nTierGen product to weblogs.asp.net bloggers, either he is being really nice or figured that it would be good marketing and really raise his rank on google if we all blogged to thank him!
Well; thanks Gavin!
HOWTO: Cause a page to escape any frames it may be embedded within
/// <summary>
/// If the page is loaded inside a frame,
/// calling this method will cause the page to leave the frame and load by itself.
/// </summary>
/// <remarks>Has not been tested on browsers other than IE5+</remarks>
public void EscapeFrame()
{
RegisterStartupScript("escapeFrame",
"<script language='javascript'>if(window.top!=self)window.top.location.replace(self.location);</script>");
}
HOWTO: Use server side code to set focus onto a control on the client side...
/// <summary>
/// Sets focus to a control on the client side when the page is loaded
/// </summary>
/// <param name="control">The control instance you wish to set the focus on to</param>
protected virtual void SetFocus(System.Web.UI.Control control)
{
this.SetFocus(control.ClientID);
}
/// <summary>
/// Sets focus to a control on the client side when the page is loaded
/// </summary>
/// <param name="clientID">The ClientID property for the control you wish to set the focus on to</param>
protected virtual void SetFocus(string clientID)
{
RegisterStartupScript(
System.Guid.NewGuid().ToString(),
string.Format("<script language='javascript'>document.getElementById('{0}').focus();</script>", clientID));
}
HOWTO: Push a javascript alert using server side code
protected virtual void MessageBox(string message)
{
RegisterStartupScript(
System.Guid.NewGuid().ToString(),
string.Format("<script language='javascript'>alert('{0}');</script>", message));
}
With all this talk about MVPs lately, I wanted to add my comedic 2 cents
The Microsoft SVP (somewhat valuable professional) Program is a worldwide award and recognition program that strives to identify amazing individuals around the globe who share a passion for technology and the spirit of hard work. Microsoft SVPs are recognized for both their demonstrated practical expertise and willingness to work hard to increase the licensing of Microsoft technologies.
Who are Microsoft SVPs?
Microsoft SVPs are a diverse group of individuals who are:
- Recognized: They are acknowledged by their customers and also by Microsoft for their active participation in economic advancement for Microsoft stock holders through the constant development of great products based on Microsoft technologies
- Credible: They have demonstrated practical expertise providing the highest quality information and content.
- Accessible: They are available to any company who can afford them.
Why was this program created?
After much internal discussion regarding the Microsoft MVP program, management realized that these people while being excellent in certain areas where spending far too much time writing blog entries, responding to forum questions and creating little community web sites. Since we at Microsoft are a public traded company and shareholder value is what truly matters, we came to realize that while MVPs are quite an asset, they are obviously not doing any real work (read: making any money)! Hence we created the SVP program to idolize all those people who are in many ways the best developers in the lot, they would just rather make money than spend time hearing themselves speak. Granted, these tireless professionals sometimes appear in forums and write blog entries, they sometimes give speeches but for the most part they are the quiet force that cause our sales to grow year over year at double digit percentages. It is these brilliant capitalists that afford us all the trappings of the 'good life' and to them we say thanks...you are truly somewhat valuable professionals!
If you can't compete on the basis of good products, you can always sue!
Seems Sun is the new beneficiary of the MSFT cash hoarde; call it corporate welfare!
Now the question is, will someone come along and insist on a 'welfare to work' program where Sun is forced to actually compete on the merits of their products instead of the merits of their lawyers.
More Posts