日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程语言 > C# >内容正文

C#

Third,C#

發布時間:2023/12/18 C# 30 豆豆
生活随笔 收集整理的這篇文章主要介紹了 Third,C# 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

Ajax:

需要以下技術:

DHtml:

DHTML是Dynamic?HTML的簡稱,就是動態的html(標準通用標記語言下的一個應用),是相對傳統的靜態的html而言的一種制作網頁的概念。所謂動態HTML(Dynamic HTML,簡稱DHTML),其實并不是一門新的語言,它只是HTML、CSS和客戶端腳本的一種集成,即一個頁面中包括html+css+javascript(或其它客戶端腳本),其中css和客戶端腳本是直接在頁面上寫而不是鏈接上相關文件。DHTML不是一種技術、標準或規范,只是一種將目前已有的網頁技術、語言標準整合運用,制作出能在下載后仍然能實時變換頁面元素效果的網頁設計概念。

javascript: 在Dhtml中訪問Dom

XmlhttpRequest:

這個對象用于從javaScript中進行異步調用,向服務器請求額外的數據。

XHR英文全名XmlHttpRequest,中文可以解釋為可擴展超文本傳輸請求。Xml可擴展標記語言,Http超文本傳輸協議,Request請求。XMLHttpRequest對象可以在不向服務器提交整個頁面的情況下,實現局部更新網頁。當頁面全部加載完畢后,客戶端通過該對象向服務器請求數據,服務器端接受數據并處理后,向客戶端反饋數據。 XMLHttpRequest 對象提供了對 HTTP 協議的完全的訪問,包括做出 POST 和 HEAD 請求以及普通的 GET 請求的能力。XMLHttpRequest 可以同步或異步返回 Web 服務器的響應,并且能以文本或者一個 DOM 文檔形式返回內容。盡管名為 XMLHttpRequest,它并不限于和 XML 文檔一起使用:它可以接收任何形式的文本文檔。XMLHttpRequest 對象是名為 AJAX 的 Web 應用程序架構的一項關鍵功能。

Json:

JSON(JavaScript Object Notation) 是一種輕量級的數據交換格式。它基于ECMAScript的一個子集。 JSON采用完全獨立于語言的文本格式,但是也使用了類似于C語言家族的習慣(包括C、C++、C#、Java、JavaScript、Perl、Python等)。這些特性使JSON成為理想的數據交換語言。 易于人閱讀和編寫,同時也易于機器解析和生成(一般用于提升網絡傳輸速率)。

?

such as:

使用UpdatePanel,ScriptManager

<form id="form1" runat="server">
<div>
<asp:ScriptManager ID="ScriptManager1" runat="server" ></asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode ="Conditional"><ContentTemplate >
<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label><asp:Button ID="Button1" runat="server" Text="Buttona" OnClick="Button1_Click" /></ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="Button2" EventName="Click" />
</Triggers>
</asp:UpdatePanel>

<asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode ="Conditional"><ContentTemplate>
<asp:Button ID="Button2" runat="server" Text="Buttonb" OnClick="Button1_Click" /><asp:Label ID="Label2" runat="server" Text="Label"></asp:Label></ContentTemplate></asp:UpdatePanel>
</div>
</form>

Label1 .Text = Convert.ToString(DateTime.Now.ToLocalTime().AddHours(1));
Label2 .Text = DateTime.Now.ToLongTimeString();

?

2。

<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
<div>

</div>
<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:Timer ID="Timer1" runat="server" Interval="1000" OnTick="Timer1_Tick"></asp:Timer>
<asp:Label ID="Label2" runat="server" Text="Label"></asp:Label>
</ContentTemplate>
</asp:UpdatePanel>

</form>

protected void Timer1_Tick(object sender, EventArgs e)
{
// Label1.Text = DateTime.Now.ToLongTimeString();
Label2.Text = DateTime.Now.ToLongTimeString();
}

?web服務:

<script type ="text/javascript" >var helloService;function b(){ alert(5);}function pageLoad() {//alert(1);//debugger;helloService = new HelloService();helloService.set_defaultSucceededCallback(hellosucceed);helloService.set_defaultFailedCallback(helloFailed);}function a(){alert(4);}function hellosucceed(result) {debugger;alert(2)var d = document.getElementById("result");d.innerHTML = result;}function helloFailed(error, userContext, methodName) {alert(3);debugger;}function callService() {alert(6);debugger;var l = document.getElementById("Text1");helloService.Greeting(l.value,hellosucceed );//或helloService.Greeting (1.value,hellosucced,helloFailed); }</script></head> <body><form id="form1" runat="server"><div><asp:ScriptManager ID="ScriptManager1" runat="server"><Services><asp:ServiceReference Path="../HelloService.svc" /></Services></asp:ScriptManager></div><div><%-- <asp:UpdatePanel ID="UpdatePanel1" runat="server"><ContentTemplate ><asp:Button runat="server" Text="Button ajax" OnClick="Unnamed1_Click" /><asp:Label runat="server" Text="Label" ID="lbajax"></asp:Label></ContentTemplate></asp:UpdatePanel>--%><input id="Button1" type="button" value="service" οnclick="callService()"/><input id="Text1" type="text" /><div id="result"></div></div></form> 調用頁面 [ServiceContract(Namespace = "")] [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)] public class HelloService {// To use HTTP GET, add [WebGet] attribute. (Default ResponseFormat is WebMessageFormat.Json)// To create an operation that returns XML,// add [WebGet(ResponseFormat=WebMessageFormat.Xml)],// and include the following line in the operation body:// WebOperationContext.Current.OutgoingResponse.ContentType = "text/xml"; [WebGet][OperationContract]public string Greeting(string name){return "Hello, " + name;}[OperationContract]public void DoWork(){// Add your operation implementation herereturn;}// Add more operations here and mark them with [OperationContract] } .svc服務頁面

?

轉載于:https://www.cnblogs.com/zhubenxi/articles/5323279.html

總結

以上是生活随笔為你收集整理的Third,C#的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。