• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 306
  • Last Modified:

ASP.Net Validation not working when calling page via ajax

I have a page "MyPage.aspx" that calls "MyForm.aspx" with prototype

new Ajax.Updater('display', '/myform.aspx'  etc....

However, when the page renders there are no validation scripts on the page.

ie, i don't see scripts like below when i call the page via ajax. If just call myForm.aspx i see the below scripts




<script type="text/javascript">
    //<![CDATA[
    var FlagForm1_RequiredFieldValidator1 = document.all ? document.all["FlagForm1_RequiredFieldValidator1"] : document.getElementById("FlagForm1_RequiredFieldValidator1");
    FlagForm1_RequiredFieldValidator1.controltovalidate = "FlagForm1_TextBoxName";
    FlagForm1_RequiredFieldValidator1.errormessage = "RequiredFieldValidator";
    FlagForm1_RequiredFieldValidator1.evaluationfunction = "RequiredFieldValidatorEvaluateIsValid";
    FlagForm1_RequiredFieldValidator1.initialvalue = "";
    var FlagForm1_RequiredFieldValidator2 = document.all ? document.all["FlagForm1_RequiredFieldValidator2"] : document.getElementById("FlagForm1_RequiredFieldValidator2");
    FlagForm1_RequiredFieldValidator2.controltovalidate = "FlagForm1_TextBoxEmail";
    FlagForm1_RequiredFieldValidator2.errormessage = "RequiredFieldValidator";
    FlagForm1_RequiredFieldValidator2.evaluationfunction = "RequiredFieldValidatorEvaluateIsValid";
    FlagForm1_RequiredFieldValidator2.initialvalue = "";
    var FlagForm1_RequiredFieldValidator3 = document.all ? document.all["FlagForm1_RequiredFieldValidator3"] : document.getElementById("FlagForm1_RequiredFieldValidator3");
    FlagForm1_RequiredFieldValidator3.controltovalidate = "FlagForm1_TextBoxComment";
    FlagForm1_RequiredFieldValidator3.errormessage = "RequiredFieldValidator";
    FlagForm1_RequiredFieldValidator3.evaluationfunction = "RequiredFieldValidatorEvaluateIsValid";
    FlagForm1_RequiredFieldValidator3.initialvalue = "";
    //]]>
    </script>

Open in new window

0
frosty1
Asked:
frosty1
1 Solution
 
P_RamprathapCommented:
Try putting the validation  under updatepanel and try
 
Thanks
Ram
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now