Quantcast
Channel: C1 CMS Foundation - Open Source on .NET
Viewing all articles
Browse latest Browse all 2540

New Post: Can I use C# extension methods in a Razor function?

$
0
0
I called the C# function from Razor function. I've got an error:
Compilation failed: IhbarHatti.cshtml(156): error CS0030: Cannot convert type 'System.Web.IHtmlString' to 'bool'
Function (bool)Function("izo.Utils.SendMailToList") returns a bool value.

I couldn't call a C# function from another C# function either.
string credentialUser = izo.Utils.InlineMethodFunction.GetValue("POP3 User");
or
string credentialUser = izo.Utils.GetValue("POP3 User");
Got an error:
'izo.Utils.InlineMethodFunction' doesn't contain a definition for 'GetValue'
Invoking Function("myfunc") won't help in C# function either :
The name Function doesn't exist in the current context
I don't use Visual Studio, I write code in Notepad like built-in code editor. So I can't examine the error.

Viewing all articles
Browse latest Browse all 2540

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>