Create A Custom Validator In VB?
Feb 15, 2012I just have this program that validates if the selected file is an excel file, and I want this to have a separate function for validation so I can use that function to other program
View 13 RepliesI just have this program that validates if the selected file is an excel file, and I want this to have a separate function for validation so I can use that function to other program
View 13 RepliesI have created a custom validator for maximum characters for a multiline textbox in ASP.Net.Below is the code that I am using.
[Code]...
I want to make sure using the custom expression validator that no ' or " can be used i tryed using [^"'] but whenever i put normal letters it doesnt work either.
View 1 RepliesI have a custom validator:
<asp:CustomValidator ID="QuestionValidator" runat="server" ErrorMessage="Please select an option" ClientValidationFunction="QuestionValidator_ServerValidate" OnServerValidate="QuestionValidator_ServerValidate" ValidateEmptyText="true"></asp:CustomValidator>
I have a list of questions provided by a datalist, which I need to ensure a user selects an answer to each question. I then have my validation functions:
Protected Sub QuestionValidator_ServerValidate(ByVal source As Object, ByVal args As ServerValidateEventArgs)
Dim SelectedItem As Boolean = False
For Each c As Control In Page.Master.FindControl("form1").Controls
If TypeOf c Is RadioButton Then
[code]....
When I run the page, there is no validation and no error message. Please can you point out where I am going wrong, I'm suspicious it is at Page.Master.FindControl("form1").Controls.I have previously done such validation by looping through controls via form1.controls but this is unavailable as the page uses a form passed down via the master page.
I am trying to call cetralized class function ONservervalidate for a custom validator, So I don't have to write it on each and every page.
View 1 RepliesI am trying to validate a textbox based on a dropdownlist, e.g. if ddl value is 'Day', textbox value cannot exceed 31. It seems that no matter what I enter triggers my custom validator error, what am I doing wrong,
<asp:TextBox ID="uitxtCamLastVisitDur" runat="server" CssClass="tooltip"
Width="65px" Enabled="False" ToolTip="Indicates a required spending on the member's last visit."></asp:TextBox>
[Code].....
First of all I'm trying to create a validator that checks to see that if both players have entered a nickname. If they don't then it should automatically close the form but instead the application hangs. If the first player uses three tries then it "should" automatically close. Here it is:
Sub getNickNames(ByVal Players() As String)
erCount)
'Force Select Username. If More Than 3 Attempts Are Made The Game Will Exit To The Main Menu
[code]....
This is what I would like to achieve:To create a custom messagebox, with varying number of buttons with custom .Text descriptions, and other features. I intended to have a property array that would be redim-ed and have values (.Text values) set by the calling class:
[code]...
how to specify a custom icon for display in the toolbox window when you create your own custom control? Something other than the dreaded "gearbox" icon.
View 2 Repliesknow how to create a custom file association ( a custom extension ) in VB .Net and how to open it on the application
View 1 RepliesWith VB.net, I'm coding a simple application to get more used to the new .Net format.
I'd like to save all the information to a 'new' database file. how to create a database on the fly, once that is done i'll be able to connect to it no problem, but actually creating the file is proving difficult to work/find out.
Also, with vb.net and the newly created custom file, how can it be made to automatically open that information with the program?
Is there a method in installation to associate the file type with the new program? How can i check when the program loads if a database file has been 'double-clicked' (rather than just running from the .exe of the program) and proceed to load the data?
EDIT1 - Extra InfoThe windows application has many different fields and content etc, then i need to save that to a file that could later be loaded by 'double clicking'. I assumed the easiest way would be to create a mini-database for each unique file
I am not a new coder, but i am not a know-it-all. I have been watching some of those NVidia fluid videos, and got jealous. I thought "Why can't i do it?" I'm not good enough for OpenGL or some other 3d engine, but i thought i would try it in 2d.
View 4 RepliesI want to create a custom class that has inside an array of another custom class (see my code below) but when the programm runs is crashes. Why? What is the right expression???? Plz help I'm a newbie in VB.net.....
Public Class ctrarray
Public nameclass As String
Public ctrlindex(glvar_spaces) As ctrlindexclass
End Class
[code]....
I need two seperate lists, which every item is Integer, String, Bitmap - and one which every item is Integer, String String. However I don't know how to do this, or even where to look - I've googled for custom objects and custom object lists. What I'm trying to do is this.Custom Object1 is Integer, String, Bitmap Custom Object2 is Integer, String, String
In one thread I'll be adding items to List1(Of Object1), and processing them, and adding the results to List2(Of Object2), however I need to be able from other threads to look at the list and say only give me the items where Integer = (my thread ID), is this possible? Any help, or even links to information that would be relevant to this request would be helpful?
I am writing a program that needs the user to input three numbers (i.e. sides of a triangle) and based upon those numbers tell the user if the numbers they enter represent a right triangle or not. how to go about this mathematically and care to offer any suggestions on the syntax of the calculations.
View 19 Repliessuppose I have a boolean function in my ValidationClass that checks user input for txtState (a textbox that contains the 2 letter abbreviation of a state), what should I put inside the if statement to activate Validation Summary displaying that user input for the state textbox is bad?
if isState(txtState.txt) = false then
' not sure what goes here...
end if
I have a textbox which takes as input the email address. Do you have regular expression validator in vb.net so that I can check if '@' is present or not in the string
View 2 RepliesI want to use a validator to compare 2 text box in such a way that ,
If V is in Text box 1, means User must type any of the numbers prefix V in Textbox 2 (V00001 to V00050).Other than V ,if they type any other Letters means error message must be shown.
Just like that if C is in TextBox 1 means user must type C00001 in TextBox2.(or any number from C00001 TO C00050) iF S is in textbox 1 means,User must Type S00001(S00001 TO S00050)
I want to have a Windows application. It should take data input via RS-232 or via USB from a barcode scanner that reads 3 of 9 barcodes. The data received must be validated against a CSV file on the local harddisk and the result sent back to the scanner. I need this application including source. Does anyone know such a tool?
View 2 RepliesI have started developing in vb.net 2008. I want to make a common module to validate all text boxes of my every win form. Common Validation I'm looking for are Length ( Size ) of text box value must not greater then that of field size, It must be of numeric, or alpha only, It must not be empty, if single quotation mark, covered with double quote mark etc.
View 5 Repliesi would like to use a validator to validate that the dropdownlist is enabled and the dropdownlist value is "None".if this two conditions being meet,the validator will display error message.May I know what validator should I use?
View 2 RepliesHow to use single requiredfield validator for two or three textboxes in asp.net ?
View 1 RepliesI have a validation Summary I am using for the RequiredFieldValidators to use to show the error messages while an image shows up next to the controls being validated.I have set the required field validator to Display="Dynamic". When I select something in the dropdown it removes the image next to the control right away like I want but the errormessage text stays on the ValidatorSummary.What can I do to make the ValidatorSummary to update dynamically like the RequiredFieldValidator when it removes the image next to the dropdown?
View 1 RepliesI'm currently coding a ASP.NET web application using VB.NET. I'd like to know how to limit the input of the regular expression validator to numbers only (with specific number of digits e.g 7-20 digits).
View 3 RepliesI have three required field validator ,in that 2nd validator should not fire even if I don't enter any any value in the textbox. I tried with Javascript. But couldnt do it.
<%@ Page Language="VB" AutoEventWireup="true" CodeFile="Default.aspx.vb" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "[URL]">
<html xmlns="[URL]">
<head runat="server">
<title>Untitled Page</title>
<script language ="javascript" type ="text/javascript" >
function step2()
[Code] .....
Is it possible to put Number validation in required field validator in asp.net text box?
View 7 RepliesI am using vb.net. I am having below code in vb.net
[Code]...
Now I want an set validation for mandatoryto the textbox TokenStartingNumberTextBox only If the user had entered the value in DateOfReceivingTextBox.
This should be a simple problem to fix, as it uses the same way I fixed my last problem with FooControl (below).
Basically, I want to add a derived validator I made to this composite control. It works fine but on postback it just disappears in the markup, making me think it's lost its ViewState.
I am probably doing something wrong with instantiating it, but I've tried setting only the ControlToValidate, moving things around, and nothing works.
I've provided some surrounding code to see what's working and then what's not.
Private FooControl As IFooControl
Private Validator As MyValidator
Protected Overrides Sub CreateChildControls()
[Code].....
So I know this will end up being a hard task, but I want to figure out how to do it. My language won't be outrageously sophisticated. Here is an example of what it'll do[code]...
View 9 RepliesI am creating a WCF in vb.net inside VS 2010. I have a handful of properties that are currently bytes (0 - 255) and represent different test scores. Is it possible for me to create my own type based on this that will only allow values between 0 and 110?[code]...
View 2 Replies