Click here to Skip to main content
11,578,006 members (65,281 online)
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 19:23pm
Edited 5-Mar-13 19: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 Richard MacCutchan 165
1 Peter Leow 150
2 OriginalGriff 120
3 Afzaal Ahmad Zeeshan 100
4 Frankie-C 85
0 OriginalGriff 880
1 Sergey Alexandrovich Kryukov 685
2 Abhinav S 573
3 F-ES Sitecore 420
4 Suvendu Shekhar Giri 393


Advertise | Privacy | Mobile
Web03 | 2.8.150603.1 | Last Updated 6 Mar 2013
Copyright © CodeProject, 1999-2015
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