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

How to use the Telerik Helpers inside your own HTML Helpers

0 Answers 92 Views
Documentation and tutorials
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
James
Top achievements
Rank 1
James asked on 07 Feb 2011, 12:53 PM
Hi Guys,

Love the telerik MVC2 controls, totally in love.

I have a question. How can i call the telerik helper to build the HTML string  that represents an instance of  a date picker (could be any control though) inside my own helper.
i have a function that will, based on preferences of a user.

so currently the function looks like so

Public Shared Function RenderSecureDatePicker( _
           ByVal referenceToHelper As HtmlHelper, _
           ByVal Name As String, _
           ByVal dateToRender As Date _
) As String
 
 With Telerik.Web.Mvc.UI.HtmlHelperExtension.Telerik(referenceToHelper)
                      datePickerInstance = .DatePicker()
                      datePickerInstance.Name = Name
                      datePickerInstance.Value = dateToRender
                      Return datePickerInstance.ToHtmlString()
            End With
End Function


Any idea's? am i going down the right path>
Tags
Documentation and tutorials
Asked by
James
Top achievements
Rank 1
Share this question
or