This is a migrated thread and some comments may be shown as answers.

[Solved] Editor inside window using LoadContentFrom with validation

1 Answer 38 Views
Editor
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
ctaleck
Top achievements
Rank 1
ctaleck asked on 18 Oct 2011, 05:05 PM
I am trying to get a Telerik HTML Editor to work inside a Telerik Window using the LoadContentFrom method. I also want the Data Validation to work on the Editor. I am unable to do this. The uploaded project shows a working sample first (IndexOrig using the Content method) and then the non-working sample (Index using LoadContentFrom).

Run the project and see:
1. Click on the Submit button with no input and the validation works
2. Close the window
3. Click on the "Home" link to open a page using the LoadContentFrom method
4. It crashes.

Any ideas on why this would be a problem?

1 Answer, 1 is accepted

Sort by
0
Alex Gyoshev
Telerik team
answered on 21 Oct 2011, 08:42 AM
Hi Ctaleck,

  1. You are including the MicrosoftMvc*.js files twice (in each master page) and are getting an error. Removing one of the declarations resolves that.
  2. The CommentForm.aspx is rendering a form that posts to the CommentForm page, which is a partial (and when it gets rendered, it shows without the Site.Master around it -- thus, with no style)
  3. In order to enable the client-side validation after loading AJAX content, you have to call
    Sys.Mvc.FormContext._Application_Load();
    This can be done in the editor load event, like so:
                .ClientEvents(events => events
                    .OnLoad("Sys.Mvc.FormContext._Application_Load()")
                )
You can find the fixed sample solution attached (with an updated build that addresses an editor initialization problem).

Regards,
Alex Gyoshev
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the Telerik Extensions for ASP.MET MVC, subscribe to their blog feed now
Tags
Editor
Asked by
ctaleck
Top achievements
Rank 1
Answers by
Alex Gyoshev
Telerik team
Share this question
or