我找不到我的 C# Asp.Net 应用程序的调整大小事件。我正在尝试做这样的事情,但onresize
我的<body runat="server" ..>
.
如何在 C# ASP.NET 应用程序中的浏览器调整大小事件中添加函数调用?
You need to add your custom resize handler to the window using JavaScript. Something like this.
<script>
function customResize(){
//your code
}
function onLoad(){
window.onresize = customResize;
}
</script>
<body onload="onLoad"></body>
您可以查看下面的文章,其中有一个 jQuery 示例:https ://www.geeksforgeeks.org/cross-browser-window-resize-event-using-javascript-jquery/
抱歉,看起来很旧。我只是想把它放在这里,以防有人还在寻找答案。