1
onSelectRow: function (id) {
    if (id) {
        'Url.Awe().PopupFormAction().Url(Url.Action("ErrorInfo", "PatientManagement", new { ' + id + ' })).Success("edit").Title("Error Info")';
    }
}

I'm using this code in JavaScript file to open awesome MVC pop-up,but it's not working,any help appreciated

/*"onSelectRow: function (id) { awe.pf(this.event, { u: '/PatientManagement/ErrorInfo?eId=' + id, p: '', r: 0, m: 0, w: 700, h: 330, f: 0, t: 'Error Info', i: 'cp', b: [], rs: 0, ot: 'OK', ct: 'Cancel', sf: '', rc: 1, pc: '' }) }"*/

right now i'm using this code for pop-up and it is giving me error like a is undefined in awesomeMVC.js script file,any idea what is this error is?

Omu
  • 69,856
  • 92
  • 277
  • 407
How To Learn
  • 301
  • 4
  • 15
  • Check your console to see if you have any javascript errors (click F12 in google chrome, go to console). – user1477388 Apr 28 '14 at 13:12
  • 1
    The line in the `if` clause isn't doing anything. It's just concatenating strings. It also looks like you're mixing javascript and razor code there, which you'll need to correct. – xdumaine Apr 28 '14 at 13:14
  • 1
    You forgot the serverside code: @ in Razor and <% in asp – devqon Apr 28 '14 at 13:14

1 Answers1

1

you can use the InitPopupForm helper to initialize the popupform and after call awe.open(name) in js to open the popup

example:

<%:Html.Awe().InitPopupForm()
                    .Name("mypopup")
                    .Url(Url.Action("create","meal"))
                    .Success("created")
                    .Title("create meal") %>
<script>
       //open the initialized popup
       awe.open('mypopup');

       //open and send additional parameters to the url
       awe.open('mypopup', { params:{ id: 35 } })
</script>

an example where the popup form is used with a grid for CRUD operations: http://demo.aspnetawesome.com/GridCrudDemo

Omu
  • 69,856
  • 92
  • 277
  • 407