I create textbox for user to choose the date and set the requiredfieldvalidator.
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server"
ControlToValidate="StartDate" ErrorMessage="RequiredFieldValidator"
ValidationGroup="Search" SetFocusOnError="True" Display="Dynamic"
ToolTip="*Fill START Date!">*Fill START Date!</asp:RequiredFieldValidator>
<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server"
ControlToValidate="EndDate" ErrorMessage="RequiredFieldValidator"
ValidationGroup="Search" Display="Dynamic" ToolTip="*Fill END Date!">*Fill END Date!</asp:RequiredFieldValidator>
<asp:Label ID="DateFilter" runat="server"
Text="Filter by Date from :" style="font-family: 'Arial Narrow'"
AssociatedControlID="StartDate"></asp:Label>
<asp:TextBox ID="StartDate" runat="server" ></asp:TextBox>
<a href="javascript:;" onclick="window.open('CalendarPopup.aspx?textbox=StartDate','cal','width=220,height=205,left=270,top=180')"><img id="Img1"
src="calendar-icon.gif" border="0" runat="server" alt="calendar"
style="height: 23px" align="bottom"></a>
<asp:Label ID="Label4" runat="server" Text="to" Font-Names="Arial Narrow"
AssociatedControlID="EndDate"></asp:Label>
<asp:TextBox ID="EndDate" runat="server"></asp:TextBox>
<a href="javascript:;" onclick="window.open('CalendarPopup.aspx?textbox=EndDate','cal','width=220,height=205,left=270,top=180')"><img id="Img2"
src="calendar-icon.gif" border="0" runat="server" alt="calendar"
style="height: 23px" dir="ltr"></a>
<asp:Button
ID="Search" runat="server" BackColor="Black" Font-Names="Arial Narrow"
ForeColor="White" Text="SEARCH" Width="73px" onclick="Search_Click" />
Then, I need to compare the first date must be less than second date using Compare Validator.
<asp:CompareValidator ID="CompareValidator1" runat="server"
ControlToCompare="EndDate" ControlToValidate="StartDate"
ErrorMessage="CompareValidator" Operator="GreaterThanEqual" Type="Date"
ValidationGroup="Search" Display="Dynamic" SetFocusOnError="True">*First date must be less than or equal to Second
date!</asp:CompareValidator>
Both validator are not working. Anyone kindly please help. Thanks..:)
Siti
Update, I didn't see it before, but you need to have the button be a part of the same validation group as your validators. Try this:
<asp:Button ValidationGroup="Search"
ID="Search" runat="server" BackColor="Black" Font-Names="Arial Narrow"
ForeColor="White" Text="SEARCH" Width="73px" onclick="Search_Click" />
Oh, and I'm pretty sure you need the other logic operator I mentioned before because the ControlToValidate is the primary value that gets evaluated against ControlToCompare so ControlToValidate is LessThan ControlToCompare = StartDate is LessThan EndDate:
<asp:CompareValidator ID="CompareValidator1" runat="server"
ControlToCompare="EndDate" ControlToValidate="StartDate"
ErrorMessage="CompareValidator" Operator="LessThan" Type="Date"
ValidationGroup="Search" Display="Dynamic" SetFocusOnError="True">*First date must be less than or equal to Second date!</asp:CompareValidator>
Since you are having problems, I have checked the code in its entirety and this works exactly as it shoul. Copy and paste this:
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server"
ControlToValidate="StartDate" ErrorMessage="RequiredFieldValidator"
ValidationGroup="Search" SetFocusOnError="True" Display="Dynamic"
ToolTip="*Fill START Date!">*Fill START Date!</asp:RequiredFieldValidator>
<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server"
ControlToValidate="EndDate" ErrorMessage="*Fill END Date!"
ValidationGroup="Search" Display="Dynamic" ToolTip="*Fill END Date!" />
<asp:Label ID="DateFilter" runat="server"
Text="Filter by Date from :" style="font-family: 'Arial Narrow'"
AssociatedControlID="StartDate"></asp:Label>
<asp:TextBox ID="StartDate" runat="server" ></asp:TextBox>
<a href="javascript:;" onclick="window.open('CalendarPopup.aspx?textbox=StartDate','cal','width=220,height=205,left=270,top=180')"><img id="Img1"
src="calendar-icon.gif" border="0" runat="server" alt="calendar"
style="height: 23px" align="bottom"></a>
<asp:Label ID="Label4" runat="server" Text="to" Font-Names="Arial Narrow"
AssociatedControlID="EndDate"></asp:Label>
<asp:TextBox ID="EndDate" runat="server"></asp:TextBox>
<img id="Img2" src="calendar-icon.gif" border="0" runat="server" alt="calendar" style="height: 23px" dir="ltr">
<asp:Button ValidationGroup="Search"
ID="Search" runat="server" BackColor="Black" Font-Names="Arial Narrow"
ForeColor="White" Text="SEARCH" Width="73px" onclick="Search_Click" />
<asp:CompareValidator ID="CompareValidator1" runat="server"
ControlToCompare="EndDate" ControlToValidate="StartDate"
ErrorMessage="CompareValidator" Operator="LessThan" Type="Date"
ValidationGroup="Search" Display="Dynamic" SetFocusOnError="True">*First date must be less than or equal to Second date!</asp:CompareValidator>
~
Related
I have put validation on controls like TextBox on a Form in ASP.NET. When validation fails it is still redirecting to next page. How do I resolve this?
<div class="inp-cont forget-success-hide">
<label for="inputFirstName">Name <span class="text-error"
style="Color:Red">*</span></label>
<asp:TextBox runat="server" class="signininput" ID="txtname" placeholder="Enter Your
Name"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" ForeColor="Red"
ValidationGroup="rg" ErrorMessage="Please enter Your Name"
ControlToValidate="txtname"></asp:RequiredFieldValidator>
<br/>
<asp:RegularExpressionValidator ID="RegularExpressionValidator3"
runat="server" ControlToValidate="txtname" ErrorMessage="Only
alphabets are allowed" ForeColor="Red"
ValidationExpression="[a-zA-Z]+" > </asp:RegularExpressionValidator>
</div>
<div class="inp-cont forget-success-hide">
<label for="inputFirstName">Email <span class="text-error"
style="Color:Red">*</span></label>
<asp:TextBox runat="server" class="signininput" ID="txtemail" placeholder="Enter Your Email
Id"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ForeColor="Red"
ValidationGroup="rg" ErrorMessage="Please enter email id"
ControlToValidate="txtemail"></asp:RequiredFieldValidator>
<br />
<asp:RegularExpressionValidator ID="rv" runat="server"
ControlToValidate="txtemail" ForeColor="Red" ValidationGroup="rg"
ErrorMessage="Enter vaild email id"
ValidationExpression="\w+([-+.]\w+)*#\w+([-.]\w+)*\.\w+([-.]\w+)*"></asp:RegularExpressionValidator>
<asp:Label ID="lblemail" ForeColor="Red" runat="server" Visible="false"></asp:Label>
</div>
<div class="inp-cont forget-success-hide">
<label for="inputLastName">Gender <span class="text-error"
style="Color:Red">*</span></label>
<asp:DropDownList ID="ddlGender" runat="server" class="signininput" Width="100%">
<asp:ListItem Text="Select Gender" Value="0"></asp:ListItem>
<asp:ListItem Text="Male" Value="1"></asp:ListItem>
<asp:ListItem Text="Female" Value="2"></asp:ListItem>
</asp:DropDownList>
<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ForeColor="Red"
ValidationGroup="rg" ErrorMessage="Please select gender"
InitialValue="0"
ControlToValidate="ddlGender"></asp:RequiredFieldValidator>
</div>
<div class="inp-cont forget-success-hide">
<label for="inputEMail">Password <span class="text-error"
style="Color:Red">*</span></label>
<asp:TextBox runat="server" class="signininput" ID="txtpwd" MaxLength="20" TextMode="Password"
placeholder="Enter Your Password"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ForeColor="Red"
ValidationGroup="rg" ErrorMessage="Please enter password"
ControlToValidate="txtpwd"></asp:RequiredFieldValidator>
</div>
<div class="inp-cont forget-success-hide">
<label for="inputEMail">Confirm Password <span class="text-error"
style="Color:Red">*</span></label>
<asp:TextBox runat="server" class="signininput" ID="txtcpwd" MaxLength="20" TextMode="Password"
placeholder="Enter Confirm Password"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ForeColor="Red"
ValidationGroup="rg" ErrorMessage="Please enter confirm password"
ControlToValidate="txtcpwd"></asp:RequiredFieldValidator>
<br />
<asp:CompareValidator ID="cmp" runat="server" ForeColor="Red" ValidationGroup="rg"
ErrorMessage="Password does not match" ControlToCompare="txtpwd"
ControlToValidate="txtcpwd" Type="String"
Operator="Equal"></asp:CompareValidator>
<asp:Label ID="lblpwd" ForeColor="Red" runat="server" Visible="false"></asp:Label>
</div>
<div class="inp-cont forget-success-hide">
<label for="inputMob">Mobile No <span class="text-error" style="Color:Red">*</span></label>
<asp:TextBox runat="server" MaxLength="10" class="signininput"
onkeypress="inputNumberOnly(event)" ID="txtmobno" placeholder="Enter
Your Mobile"></asp:TextBox>
<%--<asp:RegularExpressionValidator ID="RegularExpressionValidator1"
runat="server" ControlToValidate="txtmobno"
ValidationGroup="rg" ForeColor="Red" ErrorMessage="Enter a valid
phone number"
ValidationExpression="^[7-9][0-9](\s){0,1}(\-){0,1}(\s){0,1}[0-9]{1}[0-9]{7}$"></asp:RegularExpressionValidator><br
/>--%>
<asp:RegularExpressionValidator ID="RegularExpressionValidator1"
runat="server" ControlToValidate="txtmobno"
ValidationGroup="rg" ForeColor="Red" ErrorMessage="Enter a valid
mobile number"
ValidationExpression="^[789]\d{9}$"></asp:RegularExpressionValidator>
<br
/>
<asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" ForeColor="Red"
ValidationGroup="rg" ErrorMessage="Please enter mobile number"
ControlToValidate="txtmobno"></asp:RequiredFieldValidator>
</div>
properly use validation group and in button control add validation group and check that validation group name should be same in button control and other controls also where we have used asp.net validation control
I've got in a page three filters. Two textboxes for dates (from and to) and a dropdownlist for a specific value.
Well I have several validations for the dates filters and they all work as expected. the problem is that even if the validations are not met I can still change the selected item in the dropdownlist, which has its AutoPostBack property set to true.
Here's the code I use to validate my page.As you can see , I'm already using a validation group.
<table align="center">
<tr>
<td>
FROM
</td>
<td>
<asp:TextBox ID="txtFromDate" runat="server" Width="80px" Style="text-align: center"></asp:TextBox>
<Toolkit:CalendarExtender ID="ceFechaInicial" runat="server" Format="dd/MM/yyyy"
PopupButtonID="ImgFechaInicial" TargetControlID="txtFromDate" />
<Toolkit:MaskedEditExtender ID="meeFecha" runat="server" AcceptNegative="Left" DisplayMoney="Left"
ErrorTooltipEnabled="false" Mask="99/99/9999" MaskType="Date" MessageValidatorTip="false"
UserDateFormat="DayMonthYear" OnFocusCssClass="MaskedEditFocus" OnInvalidCssClass="MaskedEditError"
TargetControlID="txtFromDate" ClearMaskOnLostFocus="true" />
<Toolkit:MaskedEditValidator ID="mevFecha" runat="server" ControlExtender="meeFecha"
ControlToValidate="txtFromDate" Display="None" EmptyValueBlurredText="" EmptyValueMessage=""
ErrorMessage="Fecha no es válida" InvalidValueBlurredMessage="*" InvalidValueMessage="La fecha no es válida"
SetFocusOnError="true" TooltipMessage="" ValidationGroup="findGroup" IsValidEmpty="true" />
<Toolkit:ValidatorCalloutExtender ID="ValidatorCalloutExtender5" runat="Server" CssClass="customCalloutStyle"
HighlightCssClass="validatorCalloutHighlight" TargetControlID="mevFecha" WarningIconImageUrl="~/images/msjeAdvertencia.png" />
<asp:CompareValidator ID="CompareValidator3" runat="server" ControlToCompare="txtFromDate"
ControlToValidate="txtToDate" Display="None" ErrorMessage="Fecha final no debe ser menor que la inicial"
Operator="GreaterThanEqual" SetFocusOnError="false" Type="Date" ValidationGroup="findGroup"></asp:CompareValidator>
<Toolkit:ValidatorCalloutExtender ID="ValidatorCalloutExtender2" runat="Server" CssClass="customCalloutStyle"
HighlightCssClass="validatorCalloutHighlight" TargetControlID="CompareValidator3"
WarningIconImageUrl="~/images/msjeAdvertencia.png" />
</td>
<td>
TO
</td>
<td>
<asp:TextBox ID="txtToDate" runat="server" Width="80px" Style="text-align: center"></asp:TextBox>
<Toolkit:CalendarExtender ID="ceFechaFinal" runat="server" Format="dd/MM/yyyy" PopupButtonID="ImgFechaFinal"
TargetControlID="txtToDate" />
<Toolkit:MaskedEditExtender ID="txtToDate_MaskedEditExtender" runat="server"
AcceptNegative="Left" DisplayMoney="Left" ErrorTooltipEnabled="false" Mask="99/99/9999"
MaskType="Date" MessageValidatorTip="false" UserDateFormat="DayMonthYear" OnFocusCssClass="MaskedEditFocus"
OnInvalidCssClass="MaskedEditError" TargetControlID="txtToDate" ClearMaskOnLostFocus="true" />
<Toolkit:MaskedEditValidator ID="mevFecha0" runat="server" ControlExtender="meeFecha"
ControlToValidate="txtToDate" Display="None" EmptyValueBlurredText="" EmptyValueMessage=""
ErrorMessage="Fecha no es válida" InvalidValueBlurredMessage="" InvalidValueMessage="La fecha no es válida"
SetFocusOnError="true" TooltipMessage="" ValidationGroup="findGroup" IsValidEmpty="true" />
<Toolkit:ValidatorCalloutExtender ID="ValidatorCalloutExtender4" runat="Server" CssClass="customCalloutStyle"
HighlightCssClass="validatorCalloutHighlight" TargetControlID="mevFecha0" WarningIconImageUrl="~/images/msjeAdvertencia.png" />
<asp:CompareValidator ID="CompareValidator4" runat="server" ControlToCompare="txtToDate"
ControlToValidate="txtFromDate" Display="None" ErrorMessage="Fecha final debe ser mayor que la inicial"
Operator="LessThanEqual" SetFocusOnError="false" Type="Date" ValidationGroup="findGroup"></asp:CompareValidator>
<Toolkit:ValidatorCalloutExtender ID="ValidatorCalloutExtender3" runat="Server" CssClass="customCalloutStyle"
HighlightCssClass="validatorCalloutHighlight" TargetControlID="CompareValidator4"
WarningIconImageUrl="~/images/msjeAdvertencia.png" />
<asp:CustomValidator ID="StartDateValidator" runat="server" ClientValidationFunction="InitValidators"
Display="Dynamic" ErrorMessage="" OnServerValidate="StartDateValidator_Validate"
ValidationGroup="findGroup"></asp:CustomValidator>
</td>
<td>
</td>
<td>
<asp:DropDownList ID="ddlModels" runat="server" AppendDataBoundItems="True"
AutoPostBack="True" OnSelectedIndexChanged="ddlModels_SelectedIndexChanged">
<asp:ListItem Value="0">Select</asp:ListItem>
</asp:DropDownList>
<asp:CompareValidator ID="CompareValidator1" runat="server" ControlToValidate="ddlModels"
Display="None" ErrorMessage="Select a model" Operator="NotEqual" ValidationGroup="findGroup"
ValueToCompare="0"></asp:CompareValidator>
<Toolkit:ValidatorCalloutExtender ID="ValidatorCalloutExtender9" runat="Server" CssClass="customCalloutStyle"
HighlightCssClass="validatorCalloutHighlight" TargetControlID="CompareValidator1"
WarningIconImageUrl="~/images/msjeAdvertencia.png" />
</td>
<td>
</td>
<td>
<asp:Button ID="btnFind" runat="server" CssClass="button small blue" OnClick="btnFind_Click"
Text="Buscar" ValidationGroup="findGroup" Width="64px" />
</td>
</tr>
</table>
Is there any way to only fire the postback caused by the dropdownlist AutoPostBack when all the validations in the page are met?
Add CausesValidation = "True"
<asp:DropDownList ID="ddlModels" runat="server" AppendDataBoundItems="True" AutoPostBack="True" OnSelectedIndexChanged="ddlModels_SelectedIndexChanged"
ValidationGroup="findGroup" CausesValidation="true">
<asp:ListItem Value="0">Select</asp:ListItem>
</asp:DropDownList>
You can add the DropDownList to the ValidationGroup.
<asp:DropDownList ID="ddlModels" runat="server" AppendDataBoundItems="True" AutoPostBack="True" OnSelectedIndexChanged="ddlModels_SelectedIndexChanged"
ValidationGroup="findGroup">
<asp:ListItem Value="0">Select</asp:ListItem>
</asp:DropDownList>
I have the following setup for a changepassword control:
<asp:ChangePassword ID="ChangePassword1" runat="server">
<ChangePasswordTemplate>
<h3>
Password Management</h3>
<asp:TextBox ID="CurrentPassword" runat="server" TextMode="Password" Style="display: none;"></asp:TextBox>
<div class="field">
<asp:Label ID="NewPasswordLabel" runat="server" AssociatedControlID="NewPassword">New Password:</asp:Label>
<asp:TextBox ID="NewPassword" runat="server" TextMode="Password"></asp:TextBox>
<asp:RequiredFieldValidator ID="NewPasswordRequired" runat="server" ControlToValidate="NewPassword" Display="Dynamic"
ErrorMessage="New Password" ToolTip="New Password is required."
ValidationGroup="ChangePassword1" EnableClientScript="false"></asp:RequiredFieldValidator>
</div>
<div class="field">
<asp:Label ID="ConfirmNewPasswordLabel" runat="server" AssociatedControlID="ConfirmNewPassword">Confirm New Password:</asp:Label>
<asp:TextBox ID="ConfirmNewPassword" runat="server" TextMode="Password"></asp:TextBox>
<asp:RequiredFieldValidator ID="ConfirmNewPasswordRequired" runat="server" ControlToValidate="ConfirmNewPassword"
ErrorMessage="Confirm New Password" ToolTip="Confirm New Password is required." Display="Dynamic"
ValidationGroup="ChangePassword1" EnableClientScript="false"></asp:RequiredFieldValidator>
</div>
<div class="field">
<asp:CompareValidator ID="NewPasswordCompare" runat="server" ControlToCompare="NewPassword"
ControlToValidate="ConfirmNewPassword" Display="Dynamic" ErrorMessage="The Confirm New Password must match the New Password entry."
ValidationGroup="ChangePassword1"></asp:CompareValidator>
</div>
<asp:ValidationSummary ID="ChangeUserPasswordValidationSummary" runat="server" CssClass="failureNotification"
ValidationGroup="ChangePassword1"/>
<div class="action">
<asp:Button ID="ChangePasswordPushButton" runat="server" CommandName="ChangePassword"
Text="Change Password" ValidationGroup="ChangePassword1" />
<asp:Button ID="CancelPushButton" runat="server" CausesValidation="False" CommandName="Cancel"
Text="Cancel" Width="120" />
</div>
</ChangePasswordTemplate>
</asp:ChangePassword>
When i click on the ChangePasswordPushButton the validation all works as expected other than the validationsummary shows 2 asterisks!
Anyone have any idea why
I found out what the problem was. Error message was being set in a Theme!
Grrr
Try adding the following code on all of your validators and the ValidationSummary:
EnableTheming="False"
I have following controls in my page, my CompareValidator works, but not the MaskedEditValidator. Am I missing anything?
<form id="form1" runat="server">
<asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
</asp:ToolkitScriptManager>
<div>
Date: <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<asp:CalendarExtender ID="TextBox1_CalendarExtender" runat="server"
Enabled="True" TargetControlID="TextBox1">
</asp:CalendarExtender>
<asp:MaskedEditExtender ID="TextBox1_MaskedEditExtender" runat="server"
CultureAMPMPlaceholder="" CultureCurrencySymbolPlaceholder=""
CultureDateFormat="" CultureDatePlaceholder="" CultureDecimalPlaceholder=""
CultureThousandsPlaceholder="" CultureTimePlaceholder="" Enabled="True"
TargetControlID="TextBox1" Mask="99/99/9999" MaskType="Date">
</asp:MaskedEditExtender>
<%--<asp:MaskedEditValidator ID="MaskedEditValidator1" runat="server"
ControlExtender="TextBox1_MaskedEditExtender" ControlToValidate="TextBox1"
ErrorMessage="The Date is not valid!" IsValidEmpty="False">
</asp:MaskedEditValidator>--%>
<asp:CompareValidator ID="CompareValidator1" runat="server"
ErrorMessage="Invalid Date!" ControlToValidate="TextBox1"
Operator="DataTypeCheck" Type="Date">
</asp:CompareValidator>
<br />
<br />
<asp:Button ID="Button1" runat="server" Text="PostBack"
onclick="Button1_Click" style="height: 26px; width: 85px" />
<br /><br />
Selected Date:<asp:Label ID="Label1" runat="server"></asp:Label>
</div>
</form>
Replace your MaskedEditValidator with the following:
<asp:MaskedEditValidator ID="MaskedEditValidator1" runat="server"
ControlExtender="TextBox1_MaskedEditExtender" ControlToValidate="TextBox1"
IsValidEmpty="False" EmptyValueMessage="Invalid Date"
InvalidValueMessage="The Date is not valid!">
</asp:MaskedEditValidator>
The key thing is that you needed InvalidValueMessage and/or EmptyValueMessage instead of ErrorText.
I'd like to prepopulate my textfield with the following variable:
<%=Membership.GetUser().Email%>
... so that users can submit their email address to my table without having to type it in.
Here is my code:
<form id="form1" runat="server">
<div>
<!-- This is the code for the form. There is a Text Box to collect the first name,
last name and email address. All fields are required and I am validating that the
email address is a valid format. -->
<asp:Table ID="Table1" runat="server">
<asp:TableRow>
<asp:TableCell>First Name: <asp:TextBox ID="txtFirstName"
runat="server" Width="60" /> <asp:RequiredFieldValidator ID="RequiredFieldValidator1"
ErrorMessage="Enter First Name" Text="*" ControlToValidate="txtFirstName"
runat="server" />
</asp:TableCell>
<asp:TableCell>Last Name: <asp:TextBox ID="txtLastName" runat="server" Width="60" />
<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server"
ControlToValidate="txtLastName" ErrorMessage="Enter Last Name" Text="*" />
</asp:TableCell>
</asp:TableRow>
<asp:TableRow>
<asp:TableCell>Email: <asp:TextBox ID="txtEmail" runat="server" Width="80" />
<asp:RequiredFieldValidator ID="emailRequired"
runat="server" ControlToValidate="txtEmail" ErrorMessage="Email Needs Information"
Text="*"/>
<asp:RegularExpressionValidator ID="emailexpression"
runat="server" ControlToValidate="txtEmail" ValidationExpression=".*#.*\..*"
ErrorMessage="Invalide Email Address" Text="*" />
</asp:TableCell>
</asp:TableRow>
<asp:TableRow>
<asp:TableCell>
<asp:ValidationSummary ID="ValidationSummary1" runat="server" ShowSummary="true"
ShowMessageBox="true" runat="server" />
</asp:TableCell>
</asp:TableRow>
<asp:TableRow>
<asp:TableCell><asp:Button ID="btnSubmit" runat="server" OnClick="addMember"
CausesValidation="true" Height="30" Width="100" Text="Add Me" />
</asp:TableCell>
</asp:TableRow>
<asp:TableRow>
<asp:TableCell>
<asp:Label ID="lblDuplicate" runat="server" Text=""></asp:Label>
</asp:TableCell>
</asp:TableRow>
</asp:Table>
</div>
</form>
How can I accomplish this?
Pop it in the page load event in the code-behind?
if (!Page.IsPostBack)
{
txtEmail.Text = Membership.GetUser().Email;
}