简体   繁体   中英

View return of a function in ASP.NET View

I have written a function that returns an int. Now I would like to use it in my View, but I don't know how I can integrate the function or the return of the function in the HomeController.

 ViewBag.Number = yourFunction();

在您可以使用的视图中

<h1>@ViewBag.Number</h1>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM