0

I have a web page which consist of field and validator that is wrapped in Updatepanel. the validators messages display by the validation summary that is poped up by the jquery dialog on save button as usual.

Here Is Sample Code

<html>
  <head>
     <title></title>
  </head>
  <body>
     <asp:UpdatePanel...>
        .
        .
      my stuff here
     </asp:updatePanel>
  </body>
</html>

there is also some validators that are validated at server side through update panel and send back some javascript if validation fail to display validation summary using jquery dialog.

when i click save button if any server side validator fails the failure message display through jquery dialog in validation summary and updatepanel append a div for jquery dialog to the body tag.

now the problem occure when i again click on the save button if any server side validator fails then udpate panel again append another div with the body tag and this time the jquery dialog display two time, and if i click again on save button this time jquery dialog display three times and it increases every time i click to save button.

here is the server side line that register the script.

ScriptManager.RegisterStartUpScript(this.Page, Page.GetType(), 'javscriptkey', 'my javascript to display jquerydialog', true);

how can i display the validation message that is display by jquery dialog only once on save button click

4

0 回答 0