I have problem in my login page. i have used Ajax RequiredfieldValidator and Validator Callout to validate username and password. while submitting my page without entering username and password it alerting the user to enter username, but after entering username and submit it without entering password the alert message for password is not thrown. please help me to solve this.
Thanks in Advance
Aringan
Hiaringanag,
Did you put your login form inside an UpdatePanel? If yes , please do the steps below
ASP.NET AJAX provides new APIs for registering script with the ScriptManager. Using these APIs allows controls to work well with partial rendering. Without them, controls placed inside an UpdatePanel won't work as expected. In previous CTP releases of ASP.NET AJAX, we had a set of validator controls that derived from the v2.0 controls and used the new APIs. This made them work well with ASP.NET AJAX. WindowsUpdate will soon include a version of System.Web that can take advantage of the new APIs. So the new controls which would have been redundant have been removed. However, the update isn't available yet and ASP.NET AJAX has been released. So, in the short-term, the source code for a set of custom validator controls that work with partial rendering is available as an attachment to this post or on my bloghttp://blogs.msdn.com/mattgi/attachment/1516974.ashx
The .zip file includes a solution and .csproj file as well as the compiled DLL. Just put the DLL in the /bin directory of your application and include the following <tagMapping section in the pages section of the web.config.
<tagMapping>
<add tagType="System.Web.UI.WebControls.CompareValidator" mappedTagType="Sample.Web.UI.Compatibility.CompareValidator, Validators, Version=1.0.0.0"/>
<add tagType="System.Web.UI.WebControls.CustomValidator" mappedTagType="Sample.Web.UI.Compatibility.CustomValidator, Validators, Version=1.0.0.0"/>
<add tagType="System.Web.UI.WebControls.RangeValidator" mappedTagType="Sample.Web.UI.Compatibility.RangeValidator, Validators, Version=1.0.0.0"/>
<add tagType="System.Web.UI.WebControls.RegularExpressionValidator" mappedTagType="Sample.Web.UI.Compatibility.RegularExpressionValidator, Validators, Version=1.0.0.0"/>
<add tagType="System.Web.UI.WebControls.RequiredFieldValidator" mappedTagType="Sample.Web.UI.Compatibility.RequiredFieldValidator, Validators, Version=1.0.0.0"/>
<add tagType="System.Web.UI.WebControls.ValidationSummary" mappedTagType="Sample.Web.UI.Compatibility.ValidationSummary, Validators, Version=1.0.0.0"/>
</tagMapping>
http://blogs.msdn.com/mattgi/archive/2007/01/23/asp-net-ajax-validators.aspx
No comments:
Post a Comment