Kendo Modal Window ViewModel - kendo-ui

I have created a page Main.html in witch there is a ViewModel.
In this page there is a button that open a Window Modal and load in it a html page in ajax.
I want to use the viewmodel of the main.html in my window modal, but if I call the viewmodel it do error..
Does someone know how can I resolve?

Load a partial view in to your modal and make sure it has the proper using statement to allow it to use your model:
#using YourApp.YourModels.TheModel

Related

Show PartialView ViewBag.Title in Bootstrap Modal

I am trying to show some PartialViews in bootstrap v.5 Modal. It's done by Ajax:
$("#modalDetails").html(result);
$('#staticBackdrop').modal('show');
But, how can I have PartialViews ViewData to get some specific data to show in Modal or do another action.
thank you all

Invoke controller method from JSP

How can I invoke a method from a controller of another model?
I.e.: I have a popup jsp, where a search button opens another popup with a form (this is binded to another model). In this new popup I can search for an address, which will be returned to the popup before. Any ideas, how this can work?
Thanks.

Jquery mobile - radio button widget for dynamic html contents created via ajax

I am new to jQuery mobiles. The radio button widget is properly rendering if I hard code that in a HTML file but the widget is not loading for the same HTML contents which I dynamically created from JavaScript via Ajax.
when i try checkboxradio( "refresh" ), I am getting an error like
"cannot call methods on checkboxradio prior to initialization; attempted to call method 'refresh'"
Any suggestion on how should I refresh the dynamic contents to get the JQM widgets?
Enhance the markup of Checkbox and Radio buttons dynamically using both .checkboxradio() and .trigger('create').
$('input[type=radio]').checkboxradio().trigger('create');

ASP .NET MVC3 Razor Popup View

I am new to web development..
i have created views using Entity Framework in MVC3 Razor..
What i have done yet is,
i 1st created model(Clients) and DbContext(ClientDbContext) Classes.
then, i add controller with scaffolfind options
Template: Controller with read/Write actions and View, Using Entity Framework
Model Class: Clients
Data Context Class : ClientDbContext
Views : Razor(CSHTML)
It Creates the controller class and index, Detail, Delete, Delete Views...
After that i modified the index page for search and pagination...
All are working good...
in the index page i have create, edit, delete, detail links...
When i click the links browser loads to that page and working good...
But i need to popup those views when i click the links in the index page...
i don't know how to do this... i studied many articles but i am confused...
Please help me to solve this with an efficient manner...
Thanks in advance...
Creating a model pop-up within a page isn't something that can be done directly with ASP.NET MVC. You could do it yourself using javascript & css but I would strongly recommend using a JS UI framework to do this. jQuery UI has a pop-up modal box, except they call it a dialog.
The docs for jQuery UI's dialog can be found here. Have a look through the examples to see the fine details of how to set it up. But this is the basic flow of what you need to do:
Download the jQuery UI files needed and include them on your page (CSS/JS files)
Take the html from your create/update/delete views and put it on your index page, wrap them in a div with an appropriate id
When the page loads use jquery ui to target your div's you want to be a popup
Things such as the link you want to make a dialog popup is set by passing options to the dialog initialize method, again the exact options and examples can be found on the docs page.
Refer this : http://jqueryui.com/dialog/ to create a jQuery Dialog box.
<script>
$(function() {
$( "#dialog" ).dialog();
});
</script>
<div id="dialog">
#using(Html.BeginForm()){
#Html.EditorForModel()
<input type='submit' value ='Submit'/>
}
</div>

How to call a normal html page from mvc3

I want to call a html page on click of a button in mvc.
Is there any way to call a normal html page from mvc3?
Use an anchor tag in your view, as you usually would:
Click Me
Then your button should look like:
Click me

Resources