Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: Javascript MVC3
Hello,
 
I have the following script which would show the popup when the viewbag property is true. its working fine. I would like to move to the view for ex: receipt/index when button Go to reciept is clicked. Give me your suggestions. How can i do it?
@if (ViewBag.ShowMessage==true)
{
    <script>
        $(function () {
            $("#dialog-confirm").dialog({
                resizable: false,
                scrollable: false,
                height: 180,
                modal: true,
                buttons: {
                    "Go to Reciept": function () {
                        $(this).dialog("close");
                    },
                    Cancel: function () {
                        $(this).dialog("No, Just save it");
                    }
                }
            });
        });
  </script>
  <div id="dialog-confirm" title="Alert?">
  <p><span class="ui-icon ui-icon-alert" style="float: left; margin: 0 7px 50px 0;"></span>Do you want to do a voucher now?</p>
</div>
}
Posted 5-Mar-13 20:23pm
Edited 5-Mar-13 20:44pm
v3
Comments
Sergey Alexandrovich Kryukov at 6-Mar-13 1:34am
   
Excuse me, did you complain recently that your questions were removed? Look, this is not a question. Can you make it a question?
—SA
Ahamed Azeem at 6-Mar-13 2:36am
   
Dear Sergey,
 
Is it look like a question now?
 
regards
Ahamed Azeem at 6-Mar-13 3:36am
   
solved this myself, I put it here if you dont know
 
<script type="text/javascript">

function MoveToPage2() {
var GoToPage = "/Reciept/Create";
window.location = GoToPage;
}
</script>
Ahamed Azeem at 6-Mar-13 1:40am
   
I improved my question
Ahamed Azeem at 6-Mar-13 2:16am
   
Dear Sergey,
 
Is it look like a question now?
 
regards
Sergey Alexandrovich Kryukov at 6-Mar-13 11:06am
   
Dear Ahamem,
 
Yes, it is now. Thank you very much. Please understand: we really need meeting formal criteria of the question, to sort out real non-questions which overwhelm the site these days. I did not remove yours, but it could happen accidentally.
 
Thank you,
—SA

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

<script type="text/javascript">
 
       function MoveToPage2() {
           var GoToPage = "/Reciept/Create";
           window.location = GoToPage;
       }
    </script>
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 195
1 ProgramFOX 130
2 Maciej Los 105
3 Sergey Alexandrovich Kryukov 85
4 Afzaal Ahmad Zeeshan 82
0 OriginalGriff 6,564
1 Sergey Alexandrovich Kryukov 6,048
2 DamithSL 5,228
3 Manas Bhardwaj 4,717
4 Maciej Los 4,150


Advertise | Privacy | Mobile
Web01 | 2.8.1411022.1 | Last Updated 6 Mar 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100