locked
Stay Modal Popup Extender for some time & redirect to another page RRS feed

  • Question

  • User-962105674 posted

    Hi,

    while clicking submit button, show the div on the center of the form. it should be stay for some minutes. After that i need to redirect to a particular page.

    To show the popup , which one is best? div or modal pop up.

    please advise.

    Thanks,

    Friday, June 27, 2014 2:26 AM

Answers

  • User-417640953 posted

    while clicking submit button, show the div on the center of the form. it should be stay for some minutes. After that i need to redirect to a particular page.

    To show the popup , which one is best? div or modal pop up.

    Hi MasterBlaster,

    Thank you post the issue to asp.net forum.

    If you just want to show a message after click the submit button, I think you should choose use a <div> to complete it.

    That because the ModalPopupExtender is the server side control and it will waste source. Please check below code.

     <script src="//code.jquery.com/jquery-1.10.2.js"></script>
        <script>
            
            $(function () {
    
                $("#Submit1").click(function (event) {
                    
                    $("#MessageDiv").show();
                    //do your check performace or do a ajax call............
                    //.......then you can use below code to submit the form
                    // $("#form1").submit();
                    event.preventDefault();
                });
    
            })
        </script>
    
     <form id="form1" runat="server">
        <div>
            <input id="Text1" type="text" />
            <input id="Text2" type="text" />
            <input id="Submit1" type="submit" value="submit"  />
        </div>
        <div id="MessageDiv" style="display:none">We are searching for you...</div>
     </form>

    Hope this helps, thanks.

    Best Regards!

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Sunday, June 29, 2014 10:10 PM
    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, June 30, 2014 12:11 AM

All replies

  • User724169276 posted

    Any popup you can use to redirect after few seconds you can make use of settimeout method.

    setTimeout(function() { 
        window.location.href = $("a")[0].href; 
     }, 2000);
    <a id="link" href="http://example.com">Click</a>



    Friday, June 27, 2014 2:45 AM
  • User-962105674 posted

    Hi Ashim,

    This is my aspx.cs code.

    lblMessage.Text = "We are searching for you..."
    mpupRedirection.Show();

    i need to show this message for some time. In between i am performing some checks.

    Then i need to redirect to another aspx page.

    In this scenario, how can i use your code. Can u please show me the full code.

    i think ur full code will satisfy my requirement.

    Thanks,

    Friday, June 27, 2014 2:56 AM
  • User724169276 posted
    Script.RegisterStartupScript(this.GetType(),"CallMyFunction","MyFunction()",true);
    MyFunction()
    {
     $find("mpupRedirection").show();
     setTimeout(function() {window.location = "http://www.asp.net";}, 10000); 
    }



    Friday, June 27, 2014 3:05 AM
  • User-962105674 posted

    Its not waiting for the popup.

    It redirected to the respective page.

    Please advise how to resolve this.

    Thanks,

    Friday, June 27, 2014 3:19 AM
  • User724169276 posted

    is the popup showing ??

    Friday, June 27, 2014 3:23 AM
  • User-962105674 posted

    no Ashim, its not showing

    Friday, June 27, 2014 3:25 AM
  • User724169276 posted

    set the behaviourid property of the modalpopup extender as mpupRedirection :

    BehaviorID="mpupRedirection"

    Friday, June 27, 2014 3:41 AM
  • User-962105674 posted

    Ashim, still am facing the same problem.

    Popup is not appearing. it moves the next page.

    Friday, June 27, 2014 3:51 AM
  • User-417640953 posted

    while clicking submit button, show the div on the center of the form. it should be stay for some minutes. After that i need to redirect to a particular page.

    To show the popup , which one is best? div or modal pop up.

    Hi MasterBlaster,

    Thank you post the issue to asp.net forum.

    If you just want to show a message after click the submit button, I think you should choose use a <div> to complete it.

    That because the ModalPopupExtender is the server side control and it will waste source. Please check below code.

     <script src="//code.jquery.com/jquery-1.10.2.js"></script>
        <script>
            
            $(function () {
    
                $("#Submit1").click(function (event) {
                    
                    $("#MessageDiv").show();
                    //do your check performace or do a ajax call............
                    //.......then you can use below code to submit the form
                    // $("#form1").submit();
                    event.preventDefault();
                });
    
            })
        </script>
    
     <form id="form1" runat="server">
        <div>
            <input id="Text1" type="text" />
            <input id="Text2" type="text" />
            <input id="Submit1" type="submit" value="submit"  />
        </div>
        <div id="MessageDiv" style="display:none">We are searching for you...</div>
     </form>

    Hope this helps, thanks.

    Best Regards!

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Sunday, June 29, 2014 10:10 PM
    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, June 30, 2014 12:11 AM