Captcha
The Captcha server controla server control uses API language to interact with the CMS and Framework UI to display the output. A server control can be dragged and dropped onto a Web form and then modified. lets an Ektron developer place a Captcha control on any web form. The Captcha control is launched when a site visitor clicks the form's submit button. To submit the form, the site visitor must enter characters that match the displayed characters.
The following example shows a <body>
tag with a Captcha control. In addition to placing the Captcha server control, you must create the form and submit button.
<body>
<form id="form1" runat="server">
First Name: <asp:TextBox ID="fname" runat="server"></asp:TextBox>
<div>
<cms:Captcha ID="captcha1" runat="server" />
</div>
<asp:Button Text="Go" ID="button1" runat="server" OnClick="button1_Click" />
</form>
</body>
Inserting the Captcha server control onto a page
Prerequisite
You must have installed the server controls. See Installing server controls into Visual Studio Toolbox.
- In Visual Studio, choose View > Toolbox.
- Click the Ektron server control tab to display the server controls.
- Drag the Captcha server control and drop it into the desired location on the page.
NOTE: You also can place the cursor on the page where you want the server control, then double click the server control that you want.
<CMS:Captcha ID="Captcha1" runat="server" />
- Click on
Captcha
in the code to display and modify the control’s properties using the Properties window of Visual Studio. The page is updated as you modify the property values.
Styling the Captcha Control
To style the Captcha control, enter a pair of <style>
tags into the page's header, as shown below.
<head runat="server"> <title></title> <style type="text/css" > #captcha1 table td { background-color:black;} </style> </head>
Captcha properties
The following are Ektron-specific server controla server control uses API language to interact with the CMS and Framework UI to display the output. A server control can be dragged and dropped onto a Web form and then modified. properties. For information about native .NET properties such as font, height, width and border style, use Visual Studio® help.
- DoInitFill (Boolean)
By default, Fill occurs during the Page_Init event. Set to false if you want to postpone the fill-action until later. In this case, Fill is automatically called during the Page Render event. You might do this if you need to set or change a property on the control in code-behind and have it render with your changes shown.
- Hide (Boolean)
Hides or displays the output of the control in design time and run time.
- True. Hide the control output.
- False. Display the control output.
- Language (Integer)
Set a language for viewing content; shows results in design-time (in Visual Studio) and at run-time (in a browser).
- SuppressWrapperTags (Boolean)
Suppresses the output of the span/div tags around the control.
- True. Suppress wrap tags.
- False (default). Allow wrap tags.
- WrapTag (String)
Lets a developer specify a server control’s tag.
- Span (default). Designate an inline portion of an HTML document as a span element.
- Div. Apply attributes to a block of code.
- Custom. Lets you use a custom tag.