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

html encode

8 Answers 341 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Daniel
Top achievements
Rank 1
Daniel asked on 25 Feb 2013, 08:58 AM
Hello,
when editing inline in grid,or any other mode batch if i enter something that looks like a html code,it gives me a error regardin dangerous input request.So my question is how can i encode this inputs,to be able to save values  something like <T>,<kk> and avoid dangerous inputs ?

Regards,
Daniel

8 Answers, 1 is accepted

Sort by
0
Vladimir Iliev
Telerik team
answered on 26 Feb 2013, 03:08 PM
Hi Daniel,

 
I would suggest to disable the input validation on the controller action using the ValidateInput attribute and handle the HTML encoding manually. Please check the example below:

[ValidateInput(false)]
[AcceptVerbs(HttpVerbs.Post)]
public ActionResult Update([DataSourceRequest] DataSourceRequest request, Order order)
{
Kind regards,
Vladimir Iliev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Daniel
Top achievements
Rank 1
answered on 27 Feb 2013, 10:05 AM
i noticed that the gridColumn has some Encode method,and by default is true.this applies to inputs in the grid?
can i see some documentation regarding this?
also the column i saw that has a lot of templates methods like .Template, .EditorTemplateName,.EditorViewData,.ClientTemplate,.HeaderTemplate,FooterTemplate,GroupHeaderTemplate,GroupFooterTemplate and so on.is there some documentation and some examples to see how can i work with this methods?

regards,
Daniel
0
Vladimir Iliev
Telerik team
answered on 27 Feb 2013, 11:37 AM
Hi Daniel,

 
More information about these methods can be found in the Grid documentation, GridBoundColumnBuilder article.

Kind Regards,
Vladimir Iliev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Daniel
Top achievements
Rank 1
answered on 27 Feb 2013, 01:53 PM
i Found it,but no examples are shown for this methods,to see how to create such a template,when using razor and how many methods are to create a template.

0
Vladimir Iliev
Telerik team
answered on 01 Mar 2013, 06:35 AM
Hi Daniel,

 
These methods are using KendoUI template syntax - for more information how to use them you check this article.

Kind Regards,
Vladimir Iliev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Daniel
Top achievements
Rank 1
answered on 01 Mar 2013, 08:13 AM
ok,but with razor syntax there is no documentation? how can i use mvc wrappers with this templates?in some online examples i saw that you use templates using methods for grid like  .ClientTemplateId, .Template,or .ClientTemplate with razor code,it would be nice to have this documented,because i keep seeing javascript documentation,but i am using mvc wrappers,so it should be a mvc documentation.
The whole purpose to use kendo ui for me was because of Kendo ui Complete for MVC,which means for me,that it's has everything adapted to mvc ,so wrappers in razor engine,and documentation for that.

Regards
0
Accepted
Vladimir Iliev
Telerik team
answered on 05 Mar 2013, 07:35 AM
Hi Daniel,


Please check the below examples of using the Template, ClientTemplate and ClientTemplateId methods which contains Razor code:

Kind Regards,
Vladimir Iliev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Daniel
Top achievements
Rank 1
answered on 05 Mar 2013, 07:54 AM
ok,thank you.i hope some day there will be a more organized and comprehensive documentation just like for Rad Ajax controls.

Best Regards,
Daniel
Tags
Grid
Asked by
Daniel
Top achievements
Rank 1
Answers by
Vladimir Iliev
Telerik team
Daniel
Top achievements
Rank 1
Share this question
or