Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/oracle/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Asp.net core 如何将asp页面处理程序动态添加到<;a></a>;asp.net核心中的标记?_Asp.net Core_.net Core - Fatal编程技术网

Asp.net core 如何将asp页面处理程序动态添加到<;a></a>;asp.net核心中的标记?

Asp.net core 如何将asp页面处理程序动态添加到<;a></a>;asp.net核心中的标记?,asp.net-core,.net-core,Asp.net Core,.net Core,布尔结果=真 如果结果为真,则: <a asp-route-pageIndex="1">1</a> <a>1</a> 怎么做?@{ @{ //just for illustration var result = true; var pageIndex = 1; } @if (result) { <a asp-route-pageIndex="@pageIndex">@pageIndex</a&g

布尔结果=真

如果
结果
,则:

<a asp-route-pageIndex="1">1</a>
<a>1</a>
怎么做?

@{
@{ 
   //just for illustration
    var result = true;
    var pageIndex = 1;
}
@if (result)
{
    <a asp-route-pageIndex="@pageIndex">@pageIndex</a>
}
else
{
    <a>1</a>
}
//只是为了举例说明 var结果=真; var pageIndex=1; } @如果(结果) { @页面索引 } 其他的 { 1. }
无论如何,你需要区分。