Posts tagged 'vb-net'
VB.NET GridView Sorting/Paging w/o a DataSourceControl DataSource
If you set AllowPaging="true" or AllowSorting="true" on a GridView control without using a DataSourceControl DataSource (i.e. SqlDataSource, ObjectDataSource), you will run into the following errors: When changing the page on the GridView control: The GridView 'GridViewID' fired event...
Continue reading "VB.NET GridView Sorting/Paging w/o a DataSourceControl DataSource"
Accessing Config File Mail Settings Programmatically
Some people may not know that .NET 2.0 provides APIs for accessing everything in a configuration file. The most common question I see relates to accessing the mail settings in the system.net node programmatically. C# using System.Configuration; using System.Web.Configuration; using System.Net.Configuration;...
Continue reading "Accessing Config File Mail Settings Programmatically"
Sending an email using System.Net.Mail
Below is a C# and VB.NET class that demonstrates using System.Net.Mail to send an email. Download C# System.Net.Mail Helper Download VB.NET System.Net.Mail Helper Calling the function from code MailHelper .SendMailMessage( "fromAddress@yourdomain.com" , "toAddress@yourdomain.com"...
Continue reading "Sending an email using System.Net.Mail"
VB.NET 2.0 XML Comments
.NET 2.0 introduces XML comments to VB.NET 2.0. An XML comment starts with ''' (3 single quotes). While this is new to VB.NET 2.0, XML comments have been a supported feature of C# since version 1.0. On a side note, C# XML comments start with ///. ''' <someXmlNode> ''' I'm a VB.NET XML comment ...
Continue reading "VB.NET 2.0 XML Comments"
HttpContext Helper
Need to access an HttpContext object in a class, but can't because the class doesn't inherit System.Web.UI.Page? Here is a simple helper class that will allow you to access some of the most common HttpContext objects. C# using System; using System.Web; using System.Web.Caching; using System.Web.SessionState;...
Continue reading "HttpContext Helper"
Common DropDownList Issue
A common DropDownList issue I've seen on many forums and lists is about a DropDownList populating items 2x or not being able to get the selected value on postback when binding to a data source. This is due to the DropDownList having data bound to it again on postback before the form is processed. To...
Continue reading "Common DropDownList Issue"
The Future Of Visual Basic
R
Using Statement Article
Using Statement Article
R
What's wrong with Eval()?
The .NET Framwork 2.0 introduces Eval() . Eval() is a shortcut for Container.DataItem() . Since Eval() uses Reflection, it causes overhead. From a optimization standpoint, it is better to use Container.DataItem() . VB.NET Container.DataItem() C# DataReader: ((System.Data.Common.DbDataRecord)Container...
Continue reading "What's wrong with Eval()?"




