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

[Solved] ActionLink Problem with Client Template

3 Answers 288 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
adeel zahid
Top achievements
Rank 1
adeel zahid asked on 15 Jun 2010, 06:51 AM
Hi,

i m using Telerik grid to present memos received by user below is the code

<%Html.Telerik().Grid<UserManagement.Models.SentMemos>() 
        .Name("ReceivedMemos") 
        .Sortable(sorting => sorting 
            .OrderBy(sortOrder => sortOrder.Add(o => o.MemoDate).Descending()))         
        .DataBinding(dataBinding => dataBinding 
            //Ajax binding 
        .Ajax() 
        //The action method which will return JSON 
        .Select("_AjaxBindingReceivedMemos", "OA" ) 
 
            ). 
            Columns(colums => 
            { 
                colums.Bound(o => o.MemoID).ClientTemplate(Html.ActionLink("Reply", "ReplyMemo", "OA", new { MemoID = "<#=MemoID#>"}, null).ToString()).Title("Reply").Filterable(false).Sortable(false); 
                colums.Bound(o => o.MemoID).ClientTemplate(Html.ActionLink("Acknowledge", "PreviewMemo", "OA", new { id = "<#=MemoID#>"}, null).ToString()).Title("Acknowledge").Filterable(false).Sortable(false); 
                colums.Bound(o => o.Subject).ClientTemplate(Html.ActionLink("<%#=Subject#>", "PreviewMemo", "OA", new { id = "<#=MemoID#>" }, null).ToString()).Title("Subject"); 
                //colums.Bound(o => Html.ActionLink(o.Subject,"PreviewMemo","OA",new{id=o.MemoID},null).ToString()).Title("Subject"); 
                colums.Bound(o => o.FromEmployeeName); 
                colums.Bound(o => o.MemoDate); 
                }) 
        .Sortable() 
        .Filterable() 
         .RowAction((row) => 
         {              
                 row.HtmlAttributes.Add("style", "background:#321211;"); 
         }) 
        .Pageable(pager=>pager.PageSize(6)) 
        .PrefixUrlParameters(false) 
          //.ClientEvents(events => events.OnRowDataBound("onRowDataBound")) 
        .Render();          
  %> 


where i m binding third column (Subject) my intention is to make an ActionLink where subject is the display text and i want a dynamic ID coming from <#=MemoID#>. memo id is working fine and gives me a link with dynamic Memo IDs. the problem is with the subject i.e ("<#=Subject#>") is rendered as it is on the screen without mapping to the actual subject of the memo. i have also tried ("<%#=Subject%>") but to no gain. any help is highly appriciated

regards
Adeel

3 Answers, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 15 Jun 2010, 07:49 AM
Hello adeel zahid,

I couldn't reproduce this with the current official release (2010.1.518). Which version are you using? If you are using an older version you can download the current one from this forum thread.
All the best,
Atanas Korchev
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
adeel zahid
Top achievements
Rank 1
answered on 15 Jun 2010, 07:59 AM
Thanks Atanas

I am using 2010-1-309. i wonder if i have to upgrade for this little functionality or there is a bug in my code

regards
Adeel
0
adeel zahid
Top achievements
Rank 1
answered on 18 Jun 2010, 08:46 AM
Hi guys,

Finally i have sorted this out. the problem is that ActionLink converts '<' and '>' symbols to &lt and &gt that is y it was not putting actual value on the page. i have replaced Html.ActionLink with anchor tag and it is working perfectly but i m still interested in how can i avoid encoding of symbols using ActionLink.

regards
Adeel
Tags
Grid
Asked by
adeel zahid
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
adeel zahid
Top achievements
Rank 1
Share this question
or