0

I am working on a Sharepoint application Page to Uplaod a File to a document libary. The Upload can take a bit of time so I want to display the waiting for it Dialog. I check if all requiered fields are filled in my Upload Button Click Method and then i want show the Dialog. I just need a way to call a javascript fucntion within my Code behind. I tried a :

<input type="hidden" id="hidden" runat="server" value="" onchange="ManageWaitingDialog()" />

and

 if (fieldsfilled) 
        {
            hidden.Value = "SHOW";
 }

The event does not fire when I change the value of my input. Any Help is Welcome thanks.

6
  • Why not show a dialog on the button click event itself?
    – Akhoy
    Aug 4, 2015 at 11:02
  • sorry but i dont understand I want to show a Dialog when a button is clicked
    – Zion
    Aug 4, 2015 at 11:06
  • You want to show a dialog when button is clicked. Then write the function in the button click event. Why are you writing it under hidden field change event?
    – Akhoy
    Aug 4, 2015 at 11:07
  • the SP.UI.ModalDialog.showWaitScreenWithNoClose(SP.Res.dialogLoading15); function is a javascript function the Button Click event is Server Side C# Code
    – Zion
    Aug 4, 2015 at 11:25
  • Server side button also has an OnClientClick event which will let you run JavaScript.
    – Akhoy
    Aug 4, 2015 at 11:48

1 Answer 1

0

Instead of using an event of the hidden field, after setting your hidden field's value in code, in document.ready check the hidden field's value and call the function. Since server code runs before client code, this will work.

1
  • Ok I will try it out tomorrow
    – Zion
    Aug 4, 2015 at 18:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.