This is a migrated thread and some comments may be shown as answers.
Dynamic partial view - can'click on control
0 Answers 26 Views
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Denis
Top achievements
Rank 1
Denis asked on 16 May 2011, 03:03 PM
Hello,

i would like dynamically load partial view that embeds Telerik components.

The components are displayed but i'cant click on interactive button, may be i've a javascript problem.

see the attached project. ASP .NET MVC3 - Razor

Thanks for your help.

Denis
==== Main page =====
  
@using TelerikDemo.Models
@model EditableData
  
<h2>Demo with numeric </h2>
  
  
<p>
<a href="javascript:OnLoadDynamicPanel();">Load dynamic view</a>
</p>
  
<div id="divDynamicPanel" style="border: 2px solid navy";" ></div>
  
<script type="text/javascript">
    function OnLoadDynamicPanel() {
        $.ajax({
            url: 'Index2',
            type: 'GET',
            success: function (data) { document.getElementById('divDynamicPanel').innerHTML = data; }
        });
    }
</script>
  
===== sub view, i want to display on divDynamicPanel =====
  
@using TelerikDemo.Models
@model EditableData
  
<h2>Dynamic view loaded by ajax request</h2>
  
@Html.EditorFor(m => m.Date) <span>click on button doesn't work</span
  
@(Html.Telerik().ScriptRegistrar().DefaultGroup(group => group.Combined(true).Compress(true)))
  
=========== Model ============
  
    public class EditableData
    {
        [UIHint("Date")]
        public DateTime Date {get; set;}
  
        public EditableData(DateTime dt) { Date  = dt;}
    }
  
====== Controller ===========
  
        public ActionResult Index()
        {
            return View();
        }
  
        public ActionResult Index2()
        {
            return PartialView(new EditableData(DateTime.Now));
        }
Tags
General Discussions
Asked by
Denis
Top achievements
Rank 1
Share this question
or