表單與JQuery

來源:互聯網
上載者:User

標籤:

表單:Html標籤注意:1.提交action2.提交按鈕:類型一定為type="submit" ,不然無反應3.Jquery: 個人認為屬於JS1.一般不用表單提交2.直接onClick提交給JS中的Jquery,在由Jquery提交給後台並接收Json傳回值=====================================================================================================<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/ViewMasterPageAdmin.Master" Inherits="System.Web.Mvc.ViewPage<dynamic>" %><%@ Import Namespace="CMSLYF.Models.Entity" %><asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">     Index</asp:Content><asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server"><div id="LYF_all">   <img src="../../Content/Image/lyf_siteMapPath.gif" />    <asp:SiteMapPath ID="SiteMapPath1" runat="server"></asp:SiteMapPath>    <fieldset id="content_fieldset" style="border:1px solid yellow">                   <h2>SiteSetting_Index</h2>        <table>            <tr style="background-color:#ff6a00;">                <th>Name</th>                <th>Value</th>                <th>操作</th>            </tr>            <%foreach(SiteSettingsEntity sse in Model){ %>            <tr>                <th><%=sse.Name %></th>                <th><%=sse.Value %></th>                <th><a href="javascript:FunShowSiteSetting(<%=sse.SiteSettingId %>)">修改</a>|</th>            </tr>            <tr style="background-color:yellow">                <th></th>                <th></th>                <th></th>            </tr>            <%} %>        </table>      <form action="/SiteSetting/Index" method="post">        網站設定資訊:<br />        名稱:<input type="text" id="Name" name="Name" /><br />        值  :<input type="text" id="Value" name="Value" /><br />        <input type="submit" id="ButtonSave" name="" value="儲存修改" hidden="hidden" />        <input type="button" id="ButtonAddSet" name="" value="添加" />      </form> </fieldset></div></asp:Content><asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolderStyle" runat="server">    <script src="../../Scripts/jquery-1.8.2.js"></script>    <script type="text/javascript">        function FunShowSiteSetting(id) {            $.post("/SiteSetting/SelectSiteSettingById/" + id, function (data) {                $("#Name").val(data.Name);                $("#Value").val(data.Value);                $("#ButtonAddSet").hide();                $("#ButtonSave").show();            });                    }    </script></asp:Content>

表單與JQuery

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.