


Simple regular expression I found and have used succesfully to validate emails submitted to my website.Imports System.Text.RegularExpressions Function EmailAddressCheck(ByVal emailAddress As String) As Boolean Dim pattern As String = "^[a-zA-Z][\w\.-]*[a-zA-Z0-9]@[a-zA-Z0-9][\w\.-]*[a-...
Sorting a datatable for REALS! Just like they said in the South Park show where Kenny goes to heaven with his playstation system. "This is for reals."Okay, folks here it is...I'm a fan of Response.Write, and the other day, I needed to response.write the contents of a datatable. Don't a...
"Operation is not allowed in this Context."I got this on some of my code.It turned out to be I was trying to reference the field name as a recordset property.e.g. rs.firstname rather than rs.fields("firstname")I could advise to run through your code and check the methods, properties and objects....
With Asp.Net 2.0, the GridView control is amazingly powerful for displaying and editing tabular data on a web page. However, its main weakness is the lack of an mechanism to allow the user to add new recodrs directly on the GridView. Luckily, with a little modification, we can have that function...
Create a web project. Add a web.config file. change the following line:<authentication mode="Windows"/>to<authentication mode="Forms"> <forms name="PieperWEB" loginUrl="Login.aspx" protection="All" timeout="60" /> </authentication>also change the line:<authorizati...
Ok here's a quick demo of basic forms authentication.The only real code I have coded is in the login page, and the config file.In the web.config file I have: <authentication mode="Forms"> <forms name=".DEMOAPP" loginUrl="Login.aspx" /> </authentication> &l...
The following code was born out of boredom on the DART this morning somewhere between Sydney Parade and Blackrock on my way to work. Its an enhanced version of my original file caching code that uses Cache Dependencies. Basically, if the file you've cached changes ASP.NET will remove the fi...
It may not be the best but it worked like a champ for me. This is a page I've written to select data from an SQL server database and write out an excel file server side with streams and then initiate a download for the user.First off create the template file in excel. Format it exactly ho...
Please read http://www.vbforums.com/showthread.php?s=&threadid=230611 before posting to the CodeBank.Thanks....
Run this code from any code behind event to invoke a alert/msgbox without having to use Page.RegisterStartupScript() or using an objects .Attributes property to tie an js alert to it.This is independant from any object and just like having a VB6/VB.NET Messagebox.Protected Sub SomeSub(ByVal send...
Unzip the code from the zip file, and create a VD in IIS called CustomAuthenticationDemo2003, which points at the dir you just unzipped.This example uses cookies again, but this time we manually set them up. This gives you a little more contol as you can add time out limits. All pages inherit my...
Personally, I am not very fond of the default paging control that the DataGrid has. Instead, I'd like something like this:http://www.vbforums.com/attachment.php?attachmentid=38556&stc=1So that the user can enter the page number and go directly. Of course, not everyone would want the same...
You need to add a reference into your app for System.DirectoryServicesThen use: Private Sub CreateVirtualDir(ByVal WebSite As String, ByVal AppName As String, ByVal Path As String) Dim IISSchema As New System.DirectoryServices.DirectoryEntry("IIS://" & WebSite & "/Schema/AppIsolated")...
Unfortunately, computer virus contamination has become an unpleasant and often destructive fact of life. Often people pass along a virus without even realizing they are doing so. In an attempt to keep the CodeBank forum sections a safe and protected place within which to post and exchange u...
With the help of some threads in this forum, I was able to put this together.This is a function that you pass it the username and the AD group. If it finds a match, it returns true, else false. That way you can control what users can see on the webpage based on their AD rights.To use the code be...