Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi Guys.
I have .cs file in App_Code folder:
namespace n1 {
public class c1 {
public static string m1 { }
}
How do I access "m1" method form within Razor script placed inside macroScripts folder?
Solution is found, thanks everybody :)
Would you please post the solution for others facing the same problem?
Just referencing the full path to the method like:
n1.c1.m1()
Here's an example:
<ul class="nav">
@foreach (var data in someClass.getData()) {
<li>
<a href="#''>
<img src="@Href(n1.c1.m1())" alt="" />
</a>
</li>
</ul>
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
How do I reference App_Code class from within a Razor script
Hi Guys.
I have .cs file in App_Code folder:
namespace n1 {
public class c1 {
public static string m1 { }
}
}
How do I access "m1" method form within Razor script placed inside macroScripts folder?
Solution is found, thanks everybody :)
Would you please post the solution for others facing the same problem?
Just referencing the full path to the method like:
n1.c1.m1()
Here's an example:
<ul class="nav">
@foreach (var data in someClass.getData()) {
<li>
<a href="#''>
<img src="@Href(n1.c1.m1())" alt="" />
</a>
</li>
}
</ul>
is working on a reply...