Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Please Wait Screen - ASP.Net Validators

Please Wait Screen - ASP.Net Validators

Scheduled Pinned Locked Moved ASP.NET
csharpjavascriptasp-netsysadminhelp
6 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    graemea100
    wrote on last edited by
    #1

    Hi All I have an application that allows users to load contracts. All the fields on the new application screen have asp.net validators against them including come range validators etc. What I want to do is... if the page is valid (client side using javascript) is to show a please wait screen similar to that created by Mike Ellison on code project (Thanks Mike) on the onclick event. If the page is not valid then don't show the wait screen. I have managed to get this to work by the following code (javascript) being called on the save button onmouseup event. function showwaitscreen(bln) { var i; var b; Page_ClientValidate(); for (i = 0; i < Page_Validators.length; i++) { document.getElementById(Page_Validators[i].controltovalidate).focus(); if (!Page_Validators[i].isvalid) { //alert(Page_Validators[i].id + " " + i); b = true; break; }else{ b = false; //alert(Page_Validators[i].id + " " + i); } } if (bln == true && b == false) { document.all.pleasewaitScreen.style.pixelTop = (document.body.scrollTop + 100) document.all.pleasewaitScreen.style.visibility="visible"; }else{ document.all.pleasewaitScreen.style.visibility="hidden"; } } It works a treat EXCEPT.... the onclick event server side no longer fires!!! Weird. Can anyone help? im going slightly MAD!!! Cheers Graeme :wtf:

    K G 2 Replies Last reply
    0
    • G graemea100

      Hi All I have an application that allows users to load contracts. All the fields on the new application screen have asp.net validators against them including come range validators etc. What I want to do is... if the page is valid (client side using javascript) is to show a please wait screen similar to that created by Mike Ellison on code project (Thanks Mike) on the onclick event. If the page is not valid then don't show the wait screen. I have managed to get this to work by the following code (javascript) being called on the save button onmouseup event. function showwaitscreen(bln) { var i; var b; Page_ClientValidate(); for (i = 0; i < Page_Validators.length; i++) { document.getElementById(Page_Validators[i].controltovalidate).focus(); if (!Page_Validators[i].isvalid) { //alert(Page_Validators[i].id + " " + i); b = true; break; }else{ b = false; //alert(Page_Validators[i].id + " " + i); } } if (bln == true && b == false) { document.all.pleasewaitScreen.style.pixelTop = (document.body.scrollTop + 100) document.all.pleasewaitScreen.style.visibility="visible"; }else{ document.all.pleasewaitScreen.style.visibility="hidden"; } } It works a treat EXCEPT.... the onclick event server side no longer fires!!! Weird. Can anyone help? im going slightly MAD!!! Cheers Graeme :wtf:

      K Offline
      K Offline
      kanebarton
      wrote on last edited by
      #2

      Would moving the onMouseUp event from the save button to a form onSubmit event help? <form id="Form1" method="post" runat="server" onsubmit="return Page_ClientValidate(); showwaitscreen(true);"> Kane

      G 3 Replies Last reply
      0
      • G graemea100

        Hi All I have an application that allows users to load contracts. All the fields on the new application screen have asp.net validators against them including come range validators etc. What I want to do is... if the page is valid (client side using javascript) is to show a please wait screen similar to that created by Mike Ellison on code project (Thanks Mike) on the onclick event. If the page is not valid then don't show the wait screen. I have managed to get this to work by the following code (javascript) being called on the save button onmouseup event. function showwaitscreen(bln) { var i; var b; Page_ClientValidate(); for (i = 0; i < Page_Validators.length; i++) { document.getElementById(Page_Validators[i].controltovalidate).focus(); if (!Page_Validators[i].isvalid) { //alert(Page_Validators[i].id + " " + i); b = true; break; }else{ b = false; //alert(Page_Validators[i].id + " " + i); } } if (bln == true && b == false) { document.all.pleasewaitScreen.style.pixelTop = (document.body.scrollTop + 100) document.all.pleasewaitScreen.style.visibility="visible"; }else{ document.all.pleasewaitScreen.style.visibility="hidden"; } } It works a treat EXCEPT.... the onclick event server side no longer fires!!! Weird. Can anyone help? im going slightly MAD!!! Cheers Graeme :wtf:

        G Offline
        G Offline
        graemea100
        wrote on last edited by
        #3

        I have figured it out. Simple error on my part. It appears that if I put the showwaitscreen function onto the onblur event of the asp.net button, it works brilliantly. If anyone else wants to know anything about this function please let me know. I only tested it on IE 5.5 and above. Graeme

        1 Reply Last reply
        0
        • K kanebarton

          Would moving the onMouseUp event from the save button to a form onSubmit event help? <form id="Form1" method="post" runat="server" onsubmit="return Page_ClientValidate(); showwaitscreen(true);"> Kane

          G Offline
          G Offline
          graemea100
          wrote on last edited by
          #4

          Thanks Kane. I will try this. I realised that the event I used didn't actually work properly after all. It appears that the alert that I placed on the form overrode the onblur event and the wait message still came up. Cheers Graeme

          1 Reply Last reply
          0
          • K kanebarton

            Would moving the onMouseUp event from the save button to a form onSubmit event help? <form id="Form1" method="post" runat="server" onsubmit="return Page_ClientValidate(); showwaitscreen(true);"> Kane

            G Offline
            G Offline
            graemea100
            wrote on last edited by
            #5

            Hmmmm nope the onsubmit didnt work either. I am using a asp.net control not the html control. Would this make a difference? I will have another play around and see what I can come up with. If you have anyother suggestions please let me know. Cheers Graeme

            1 Reply Last reply
            0
            • K kanebarton

              Would moving the onMouseUp event from the save button to a form onSubmit event help? <form id="Form1" method="post" runat="server" onsubmit="return Page_ClientValidate(); showwaitscreen(true);"> Kane

              G Offline
              G Offline
              graemea100
              wrote on last edited by
              #6

              I changed track slightly. I created a separate page with a link button and a please wait div tag. Then in the page load event of the new page I added the onclick event to the link button. The link button's only code is the redirect to the other page. If is not as quick as javascript, but it is still reasonable. Basically redirecting twice. Once from the code behind on the save button -> to the please wait page, and registering the click event using the registerstartupscript onto the link button and then redirecting to the full page. Not very pretty but it works. Thanks Graeme

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups