I found the solution by myself after longtime....
options should be declared public...
my code is here
var options = {
width: 500,
height: 470,
controls: "bold italic underline strikethrough subscript superscript | font size " +
"style | color highlight removeformat | bullets numbering | outdent " +
"indent | alignleft center alignright justify | undo redo | " +
"rule link image unlink | cut copy paste pastetext | print source"
};
<pre><div id="template"><% Html.RenderPartial("PVTemplate");%> </div>
//partial view
<div id="tarea">
<%if (Model != null)
{ %>
<%if (Model.objtemplatedetails != null)
{ %>
<%-- <%=Html.TextAreaFor(model => model.teditor, new {id = "teditor"})%>--%>
<textarea id="teditor" style="width:500px" name="inputtext" rows="0" cols="0"><%=Html.Encode(Model.objtemplatedetails.First().txttemplatecontent)%></textarea>
<%} %>
<%if (Model.objtemplate != null)
{ %>
<textarea id="teditor" style="width:500px" name="inputtext" rows="0" cols="0"><%=Html.Encode(Model.objtemplate.templatecontent)%></textarea>
<%-- <%: Html.TextAreaFor(model=>model.objtemplate.templatecontent, new {Id = "teditor" }); %>--%>
<%} %>
<%} %>
</div>
//Add template fancy box
$("#add_template").live('click', function () {
$('#txtemplatename').val('');
$('#ddlsubject').val('');
var editableText = '<textarea id="teditor" style="width:500px" name="teditor" rows="0" cols="0"></textarea>';
$('#template').html(editableText);
var editor = $("#teditor").cleditor(options)[0];
});
//In Edit template
var editableText = '<textarea id="teditor" style="width:500px" name="teditor" rows="0" cols="0">' + data.objtemplate.templatecontent + '</textarea>';
$('#template').html(editableText);
var editor = $("#teditor").cleditor(options)[0];