当前位置:网站首页>C# asp,net core框架传值方式和session使用
C# asp,net core框架传值方式和session使用
2022-06-25 18:12:00 【济南医疗小程序状元】
控制器
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace Database_First625.Controllers
{
public class FirstController : Controller
{
public IActionResult Index()
{
base.TempData["u1"] = "temo data u1";
base.ViewBag.u2 = "temo data u2";
base.ViewData["u3"]= "temo data u3";
string data = "this data";
// session传值,没有被成功输出
base.HttpContext.Session.SetString("u4","this is session");
return View("Index",data);
}
}
}
视图
@using Microsoft.AspNetCore.Http;
@{
ViewData["Title"] = "Index";
}<h1>Index&l
边栏推荐
- Solve nvprof error err_ NVGPUCTRPERM - The user does not have permission to profile on the target device.
- 【深入理解TcaplusDB技术】 Tmonitor模块架构
- Article 7: there is no code prompt in clion,,,
- 近来开发的一款简单易用的图可视化工具
- Expressing integers by the sum of consecutive natural numbers
- New characteristics of cultural consumption in the era of digital economy
- TLV decoding
- 【 NLP 】 in this year's English college entrance examination, CMU delivered 134 high scores with reconstruction pre training, significantly surpassing gpt3
- Good news | Haitai Fangyuan has passed the cmmi-3 qualification certification, and its R & D capability has been internationally recognized
- 十大券商的排名是?手机开户安全么?
猜你喜欢
随机推荐
篇4:win10安装MingW64
QT generate random numbers (random strings) within the specified range
OSError: Unable to open file (truncated file: eof = 254803968, sblock->base_addr = 0, stored_eof = 2
Redis趋势—NVM内存
Qt使用SQLITE数据库
[how do I refresh the shuttle page after jumping back?]
Chapter 4:win10 installing mingw64
Hash of redis command
How to judge whether you are suitable for software testing
lock
How to delay the delay function
CentOS7 安装 Redis 7.0.2
[daily record] - bug encountered during BigDecimal Division
How to develop the hash quiz game system? Hash quiz game system development application details case and source code
【深入理解TcaplusDB技术】单据受理之创建业务指南
【深入理解TcaplusDB技术】TcaplusDB业务数据备份
What is an operator?
Is the actual account opening complicated? Is online account opening safe?
存在重复元素III[利用排序后的有序性进行剪枝]
Qinheng ch583 USB custom hid debugging record








![存在重复元素III[利用排序后的有序性进行剪枝]](/img/26/5c3632a64945ea3409f8240ef5b18a.png)
