ASP.NET 用到的語法

MVC
https://sites.google.com/site/ageechen/work_notes/web-developing-in-php/codeigniter-mvc


用到的語法


**後端把值送給前端


this.debug.InnerText += ex.Message;



this.GridView.InnerHtml += "
";

            cmd.CommandText = "select Name from Cust where ID=@ID and Pwd= @Pwd";
            cmd.Parameters.AddWithValue("@ID", txAccount.Text);
            cmd.Parameters.AddWithValue("@Pwd", txPwd.Text);


**C# 後端程式
Response.Write("");



**後端-導到其它頁面(**網頁名稱不分大小寫
Response.Redirect("WelCome.aspx"); Response.Redirect("http://www.google.com");
Response.Write("");

            if (Session["Login"]==null)
                Response.Write("");

            if (Session ["Login"]!="Y")
                Response.Write("");

**get

    http://localhost:6547/webForm.aspx?a1=555

取(後端程式)
    Request.QueryString ["a1"];

取(前端程式)
   

    <%:Request.QueryString ["a1"]%>
   

**post


   

        帳號:
        密碼:
   
   

    string sID = Request.Form["ID"].ToString();
    string sPwd = Request.Form["Pwd"].ToString();


**View Engige
檢視引擎View Engige(在html裡面使用的語言)
Razor ASPX
<% %>

留言

熱門文章