如何使用C#代码获取浏览器宽度?

编程入门 行业动态 更新时间:2024-10-24 07:22:07
本文介绍了如何使用C#代码获取浏览器宽度?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

实际上我使用javascript来识别浏览器的宽度,现在我需要通过使用C#代码找到浏览器的宽度,是否可以在浏览器被更改时获得浏览器的宽度值。 div class =h2_lin>解决方案

你在找这个吗? stackoverflow/questions/14746564/asp-net-get-screen-width?rq=1 [ ^ ]

您无法从c#代码中获取浏览器宽度,但您可以使用当前的javascript来更新表单上隐藏字段的值,并且该值将随表单供您使用,或者找到一些其他适当的方法将数据传递到您的服务器代码,具体取决于您正在做什么。

Actually i'm using javascript to identify the width of the browser, now i need to find the width of the browser by using the C# code, Is it possible to get width value of the browser whenever the browser is altered.

解决方案

are you looking for this - stackoverflow/questions/14746564/asp-net-get-screen-width?rq=1[^]

You can't get the browser width from your c# code, but you can use the javascript you currently have to update the value a hidden field on a form and that value will be submitted with the form for you to use, or find some other appropriate way of passing the data to your server code depending on what it is you're doing.

更多推荐

如何使用C#代码获取浏览器宽度?

本文发布于:2023-10-11 22:35:27,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1483036.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:如何使用   宽度   浏览器   代码

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!