This control is used for registration form to generate random numbers(when you cannot see the verification codes clearly, you can just click the image to refresh it, and it's easily used). Pleae change the suffix name from "exe" to "zip" after downloading it, and unzip to use that. 【Key Properties】 1)Number:Set random number's maximun number, no more than 10 or less than 1. 2)ValidationGroupName:Set a union name for validation group, used when clicking "Register" button to submit 【For WebForm】 1)After unzipping this, please drag and drop the dll into the ToolBox and drag and drop it onto the page. 2)Set all the validation controls' validationGroupName to the same name(In default, the control's ValidationGroup name is “ValidationCode”)。 3)Do configuration in the web.config in bold: <configuration> 4)This is the whole aspx page's code: <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="CSharp.Default" %> <%@ Register Assembly="VaidationCode" Namespace="VaidationCode" TagPrefix="cc1" %> function btnClear_onclick() { // ]]> 5)Cs-codes(code-behind): protected void Button1_Click(object sender, EventArgs e) 【For MVC】 1)Refer the dll file into the "Reference……" gray folder. 2)Do what you can see in the web.config as "For WebForm". 3)In View the generated codes would be shown, click it to change it dynamically. <img src="DongWeiValidate.req?reqNo=5" id="imgId" title="Cannot see? Click to refresh..." onclick="document.getElementById(imgId).src='DongWeiValidate.req?reqNo=5&rnd='+Math.random()" style="cursor:pointer"/> 4)In some Controller you can use "context.Session["correctcode"]" to compare with the rendered inputted code. |