Here is what I’m testing with, I have the AJAX toolkit test module from AdefWebserver, then I just copied the example from the AJAX toolkit project for the ValidatorCallout. the AJAX from AdefWebservers part works fine, and when I leave the fields blank and hit submit it does the post back and displays “Thanks , we'll give you a call at .” and if I fill in the fields it will show the values entered in the fields. However it doesn’t check the phone number field to see if it’s actually a phone number. Here are my code files.
First the ASCX
<%@ Control Language="VB" Inherits="BRAssociates.Modules.AJAXTest.View" CodeFile="BRAssociates.AJAXTest.View.ascx.vb" AutoEventWireup="true" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>
<style>
.PanelExtender
{
position: relative;
}
</style>
<br />
<table>
<tr>
<td nowrap="noWrap" valign="top">
<strong>
<asp:Panel ID="pnlUsers" runat="server" Height="50px" Width="125px" CssClass="PanelExtender">
<Strong>Enter User:</Strong>
<asp:TextBox ID="MessageTextBox" runat="server" Width="200" AutoCompleteType="Disabled" />
<asp:Button ID="btnUser" runat="server" Text="Select User" />
<asp:UpdatePanel ID="UpdatePanel2" runat="server">
<ContentTemplate>
<asp:RadioButtonList ID="RadioButtonList1" runat="server" AutoPostBack="true" OnSelectedIndexChanged="RadioButtonList1_SelectedIndexChanged"
Style="border: 1px outset white; width: 200px" BackColor="white">
<asp:ListItem Text="Shaun Walker" />
<asp:ListItem Text="Joe Brinkman" />
<asp:ListItem Text="Nik Kalyani" />
<asp:ListItem Text="Scott Willhite" />
<asp:ListItem Text="Cancel" Value="" />
</asp:RadioButtonList>
</ContentTemplate>
</asp:UpdatePanel>
<ajaxToolkit:PopupControlExtender ID="PopupControlExtender2" runat="server" TargetControlID="MessageTextBox"
PopupControlID="UpdatePanel2" CommitProperty="value" Position="Bottom" CommitScript="e.value;" />
</asp:Panel>
<br />
</strong>
</td>
</tr>
<tr>
<td nowrap="noWrap" valign="top">
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<strong>Selected:</strong>
<asp:Label ID="lblSelectedUser" runat="server"></asp:Label>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="btnUser" EventName="Click" />
</Triggers>
</asp:UpdatePanel>
</td>
</tr>
</table>
<br />
<br />
<div class="demoarea">
<div class="demoheading">ValidatorCallout Demonstration</div>
<table>
<tr>
<td>Name:</td>
<td><asp:TextBox runat="server" ID="NameTextBox"
BorderStyle="solid" BorderWidth="1px" BorderColor="#a9a9a9" /></td>
</tr>
<tr>
<td>Phone Number:</td>
<td><asp:TextBox runat="server" ID="PhoneNumberTextBox"
BorderStyle="solid" BorderWidth="1px" BorderColor="#a9a9a9" /></td>
</tr>
</table>
<br />
<asp:RequiredFieldValidator runat="server" ID="NReq"
ControlToValidate="NameTextBox"
Display="None"
ErrorMessage="<b>Required Field Missing</b><br />A name is required." />
<ajaxToolkit:ValidatorCalloutExtender runat="Server" ID="NReqE"
TargetControlID="NReq"
HighlightCssClass="validatorCalloutHighlight" />
<asp:RequiredFieldValidator runat="server" ID="PNReq"
ControlToValidate="PhoneNumberTextBox"
Display="None"
ErrorMessage="<b>Required Field Missing</b><br />A phone number is required.<div style='margin-top:5px;padding:5px;border:1px solid #e9e9e9;background-color:white;'><b>Other Options:</b><br /><a href=' ll give you a call at {1}.", NameTextBox.Text, PhoneNumberTextBox.Text)
End Sub
End Class
End Namespace
Any thoughts or suggestions would be appreciated.
Thanks, Nathan Rover