If you want to filter the filetype in a fileupload control:
< asp:FileUpload ID="AttachmentFile" runat="server" Width="240px"
style="background-color: #FFF0E1" />
< asp:RegularExpressionValidator id="FileUpLoadValidator" runat="server"
ErrorMessage="Th file type is not allowed."
ValidationExpression="^.+(.doc|.DOC|.pdf|.PDF)$"
ControlToValidate="AttachmentFile" style="font-size: x-small" >
This will only allow to upload doc and pdf file types.
You could use other methods to ...
more »
If you want to limit the number of characters in a text field use the code below:
< asp:TextBox runat="server" ID="Body" TextMode="MultiLine" MaxLength="5" Columns="55"
Rows="10" BackColor="#FFCC99" Width="346px"
style="background-color: #FFF0E1">
< asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server"
ControlToValidate="Body" Display="Dynamic"
ErrorMessage="25 char...
more »
How to use the 'RegularExpressionValidator' and 'RequiredFieldValidator' in ASP.NET:
I have used these to validate an email address. see the code below:
< asp:TextBox runat="server" ID="Email" Columns="30">
< asp:RequiredFieldValidator ID="EmailValidator" runat="server"
ControlToValidate="Email" display="Dynamic"
ErrorMessage="Email must be filled out" />
< asp:RegularExpressionValidator ID="EmailValidator2" runat="server"
ControlToValidate="ToEmail" Display="Dynamic"
...
more »
Its nothing exciting, but just wondering why Google doesn't validate the SPACE character.
If you search any keywords on Google it will either display the results or it will display the not found message
e.g, if you search '.', it will display "Your search - . - did not match any documents"
BUT, try this URL!
http://www.google.co.uk/search?hl=en&q=+&btnG=Search&meta=
If you get the message saying "Tip: Save time by hitting the return key instead of clicking on "search"" then press ENTER!...
more »
This is quite old but a cool trick!
Step 1: Open Notepad
Step 2: Write following line in the notepad.
sanj can not crack
Step 3: Save this file as test.txt
Step 4: Close the notepad.
Step 5: Open the file again.
:)...
more »
SELECT USER as [User],
SESSION_USER as [Session_User],
CURRENT_USER as [Current_User],
SYSTEM_USER as [System_User],
ORIGINAL_LOGIN() as [Original_Login()]
...
more »
Recently there have been many confusions about changes after the installation of XP service pack 3 or generally in new wide screen laptops, regarding ‘youtube’ windows not being enlarged to full screen.
Simply right click on the window of the video, and un-tick the check box that says, ‘allow hardware acceleration’. This should solve the problem....
more »
To connect the MySQL database with Visual Basic, MySQL ODBC drivers should be installed and configured on the system. The following steps show how was the installation process have been done.
Download MySQL for Windows (x86) setup file from their official web site. (http://dev.mysql.com/downloads/mysql/5.0.html)
Downloaded ODBC 3.5.1 MSI Installer (stable) for Windows (x86) from http://dev.mysql.com/downloads/connector/odbc/3.51.html
Once downloaded the files and before installing them t...
more »
Variables
I have enabled the Option Explicit statement, because to declare all the variables in my program. [I checked the Require Declaration option on the Editor Tab of the Option dialog box]
To declare a variable I used the following statements:
• Dim (e.g. Dim filenumber As Integer)
• Private
• Public
• Static
The following table lists the scope of a variable and its accessibility from various sections of a project....
more »
Programming techniques
The implementation phase of software development is also concerned with translating the design specification into source code.
This section describes the overall process of implementing the Webmaster Console (WmConsole). The technical configuration about the connection between the MySQL database and Visual Basic is described. And descriptions of the screen shots and source code of the WmConsole is also explained.
Coding style
It has been recognised that a good ...
more »