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

template column null value passed

2 Answers 26 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.
Nebras
Top achievements
Rank 1
Nebras asked on 01 Mar 2011, 09:10 AM

Hello ,
I have a server template column in my grid
I want to pass a parameter to the action
but the parameter is dilivered as NULL although the parameter in the context is not null
Here's a sample of my code :

columns.Template(c =>  
               {        
                   %> 
<%= Html.ActionLink("ReportLink", "GoToReport", "Home", new { patientReportId = c.PatientReportId })%>  
                   <%               
                         }).Title("Report Link");      
               })


public ActionResult GoToReport(string  patientReportId)
      {   .............    }

what is wrong with that?

2 Answers, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 01 Mar 2011, 09:30 AM
Hello Nebras ,

 This is very strange - the code looks perfectly ok. Do you see the right patientReportId in the output HTML? You can check this by viewing the source of your page. Is there a chance to provide a runnable project which we can troubleshoot? Just attach it to this forum post.

Regards,
Atanas Korchev
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
0
Nebras
Top achievements
Rank 1
answered on 03 Mar 2011, 07:44 AM
Thanks for your response,I found the problem , it was that i sent my parameter as html attribute but i have to sent it as "route attribute "
and set the html attributes to be = null then the syntax will be as follows:

<%= Html.ActionLink(
"ReportLink", "GoToReport", "Home", new { patientReportId = c.PatientReportId },null)%>  
            
Tags
Grid
Asked by
Nebras
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Nebras
Top achievements
Rank 1
Share this question
or