大家好我刚刚开始处理MVC
,这就是我在cshtml
页面内写的内容
@if (Request.QueryString["TechID"] != null)
{
int TechID = Convert.ToInt16(Request.QueryString["TechID"].ToString());
forumAPP.newForumDBEntities db = new forumAPP.newForumDBEntities();
var topic = from p in db.tblTechnologies where p.TechID == TechID select p.TechName;
string strText = "A forum where you can post questions regarding " + topic.FirstOrDefault().ToString(); ;
@Html.Label("Name", strText)
}
我只是想知道编写一些代码来处理会话以显示一些示例内容(例如Username
或所需文本而不是写入model