0

I am trying to set blockUI message to display controller action view. I have tried everything but it doesn't display anything.
I have tried something like this:

$.blockUI({
             message: $('MyController/MyAction'), // I also need to pass some parameters here
        css: {
        top: ($(window).height() - 600) / 2 + 'px',
        left: ($(window).width() - 600) / 2 + 'px',
        width: '600px'
        }
        });

What I am trying to make is image display like on facebook for my image gallery. And I have a view that contains Image/Comments/Back/Next but I failed to display it in modal form. enter image description here

1 Answer 1

1

This is not the correct way to call an ajax method :=)

$('MyController/MyAction')

jQuery is magic, but not that magic !

Instead use:

$.ajax({url:'/controller/action',success: function(d){ $.blockUI(..., message: d,  ...) }})
Sign up to request clarification or add additional context in comments.

3 Comments

Great it works. I pass url and data parameter. $.ajax({ url: 'Gallery/Show', type:"POST", data: "image056.jpg", success... Can you just tell me how can I get this data later?
What do you mean by get this data later ? Get it from a field ? Use a jquery selector: $("myInputText").val()
oh add data as a map. { ..., data: { name=value, name2=$("#itemId").val() }, ... }

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.