Việc sử dụng window.external là gì? Điều này được sử dụng để gọi các hàm/phương thức phía máy chủ trong C#/VB.NET (ASP.NET) từ JavaScript? Bạn có thể vui lòng chỉ cho tôi đi đúng hướng không?Việc sử dụng window.external là gì?
Cảm ơn
Lỗi:
<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="WebForm1.aspx.vb" Inherits="WebApplication1.WebForm1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<input type="button" name="button1" value="Click" onclick="javascript:window.external.SayHello('Mike');" />
</div>
</form>
</body>
</html>
Public Class WebForm1
Inherits System.Web.UI.Page
Public Sub SayHello(ByVal name As String)
Response.Write("Hello :- " & name)
End Sub
End Class
<% @ Page Ngôn ngữ = "vb" AutoEventWireup = "false" CodeBehind = "WebForm1.aspx.vb" Inherits = "WebApplication1.WebForm1"%>
Công Lớp WebForm1.class Inherits System.Web.UI.Page Protected Sub SayHello (tên ByVal Dưới dạng chuỗi) Response.Write ("Xin chào: -" & tên) End Sub End Class – user1054625
Gặp lỗi. Bạn có thể vui lòng cho tôi biết tại sao không? – user1054625