VB.NET
Access Master Page properties from the content page
Many times you need to access a control in your master page from the content page (like setting a page title or adding specific META tags). Most tutorials will show you that you can just use the Page.Master FindControl() method to do something like this:
// get the control by searching the master page collection.Label lblControlToFind = (Label)Page.Master.FindControl("lblPageTitle");GridView ObjectDataSource LINQ Paging and Sorting
If you've attempted to create your own Data Access Layer for LINQ and want to use the built-in data binding for .NET controls like a GridView, you know the nightmare of trying to get these controls to work together with LINQ new IQueryable interface. After much pain and suffering, I was able to cobble together little tidbits from various posts to create a solid object that can be used as a "codeless" ObjectDataSource for any GridView AND support sorting, paging, and filtering just like if you were to databind to a LINQ to SQL object (like EVERY tutorial shows you how to do).
Setting a Windows Form Opacity
Here's how to set a form's opacity so you can "fade-out" a form like you see with so many windows applications, notification and popup boxes, outlook email notifications, etc. It's pretty simple:
- Add a private member to the class:
private int m_iFadeCount;
- Add a timer object to the form and call it "timerFade"
- Set the Interval property to 25 (that is milliseconds between when the timer will fire). NOTE: You can use any value but in my testing 25, seemed to be the most like other windows fade effects.
Popular Articles
Last viewed:
- Fix for Firefox click() event issue
- Data Access Layer using SqlDataReader and C# - Code Explanation
- SQL Script to Create and Update a Database
- C# Download File with Progress Bar
- Tutorial for Configuring Silverlight 4, Entity Framework and WCF RIA Services in Separate Component Assemblies (DLL’s)
- Connecting to SQL Server, Oracle, and MySQL with Database or Windows Authentication

Recent comments
13 hours 59 min ago
1 day 13 hours ago
3 days 14 hours ago
4 days 4 hours ago
4 days 15 hours ago
4 days 20 hours ago
5 days 43 min ago
1 week 21 hours ago
1 week 1 day ago
1 week 4 days ago