[RESOLVED]why my helper havent any output after run !!!!!!

Hi dear,

I‘ve created
a method and
run it
. But
this method
does not
output
. So I
trace the code
and found
the body of a method
is not implemented.
I do not know
why
.
Please give me
what’s problem.

my code:

 @helper SetName(string name)
                {
                          string first_name = name;
                          <label>@first_name</label>
                      
    
                }
---------------run helper ----
  SetName("asp.net");

 

how can i solve this problem

 @helper SetName(string name)
 {
     <label>@name</label>
 }

That should be all you need. If you want it to render, you should call it like this (prefix with @):

@SetName("asp.net")

Mikesdotnetting

 @helper SetName(string name)
 {
     <label>@name</label>
 }

That should be all you need. If you want it to render, you should call it like this (prefix with @):

@SetName("asp.net")

thank you very veryyyy much Mikesdotnett

Leave a Reply