[英]ASP.Net web application VS ASP.net MVC web application
我是Asp.Net框架的新手。 如屏幕截圖所示,我對Asp.Net Web應用程序和Asp.Net MVC Web應用程序模板感到困惑。
我不知道從哪里開始。
我知道,由於新技術Asp.net MVC,如今Asp.Net Web表單對於開發Web應用程序來說並不是什么大問題。 如果可以使用Asp.net Web應用程序模板來開發Web應用程序,那么Asp.net MVC和asp.net Web表單有什么需求? Asp.Net Web表單,Asp.Net Web應用程序和Asp.Net MVC是用於開發Web應用程序的三個不同模板,然后向我提出建議,就將來獲得工作而言,哪一個是最好的選擇? 我目前正在使用visual Studio 2015專業版。
如果您不熟悉ASP.NET,請先使用Web表單。 瀏覽代碼要容易得多。 一旦您熟悉了框架,mvc就會更容易理解。
編輯:
這是最簡單的單頁aspx頁。 它沒有CS或設計器文件。
<%@ Page Language="C#" %>
<html>
<body>
<form id="form1" runat="server">
<asp:Label ID="ctlLabel1" runat="server"></asp:Label>
<asp:TextBox ID="ctlTextBox1" runat="server"></asp:TextBox>
<asp:Button ID="ctlButton1" runat="server" OnClick="ctlButton1_Click" Text="Submit" />
</form>
</body>
</html>
<script runat="server">
protected void Page_Load(object sender, EventArgs e) {
if (!Page.IsPostBack) {
ctlTextBox1.Text = "Hello 1";
}
}
protected void ctlButton1_Click(object sender, EventArgs e) {
ctlLabel1.Text = ctlTextBox1.Text;
}
</script>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.