用于实时编辑会话和视图状态变量的工具(类似于 Firebug)
有人有任何好的方法或工具来实时编辑 ASP.NET 会话变量和视图状态变量吗?每次我想测试某些东西时,我都需要更新我的源代码,重新编译我的应用程序,然后再次登录,然后导航到我正在测试的页面。如果有一个类似于 Firebug 的工具,您可以在其中更改变量并立即查看结果,那将会非常高效。是我在做梦还是真的有这样的事情?如果没有,是否有一些东西可以向我展示会话变量和视图状态的易于阅读的良好表示?
Does anyone have any good methodologies OR tools for editing session variables and viewstate variables real time for ASP.NET? Every time I want to test something, I need to update my source code, recompile my application and then log in again, then navigate to the page I'm testing. It would be really efficient if there was a tool out there, similar to Firebug, where you can change a variable and see the outcome immediately. Am I dreaming or is there such a thing? If not, is there something that shows me a nice easily readable representation of the session variables and viewstate?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
会话变量存储在服务器上。您无法在浏览器中查看/调整它们。
另一方面,视图状态可以被解码。这是一个在线解码器: http://lachlankeown.blogspot.com/ 2008/05/online-viewstate-viewer-decoder.html
然而,修改它是很棘手的,.Net 可以防止篡改。
但是,Session/Viewstate 不像 dom/script/css 元素,您可能需要调整一两个设置并解决问题。调整它们并不容易,也不会达到相同的目的/好处。
如果我忽略了什么,请告诉我。
Session variables are stored on server. There is no way you can view/tweak them in the browser.
Viewstate on the other hand can be decoded. Here's an online decoder: http://lachlankeown.blogspot.com/2008/05/online-viewstate-viewer-decoder.html
However, modifying it is tricky and .Net guards against tampering.
But then, Session/Viewstate are not like dom/script/css elements where you may want to tweak one or two settings and fix the issue. Tweaking them is not going to be easy, nor is it going to server the same purpose/benefit.
Let me know if I'm overlooking something.
如果您可以在服务器上编辑aspx页面的html,那么只需在@Page指令中设置Trace =“true”,如下所示:
然后,当您在浏览器中加载页面时,您将看到有关该页面的大量信息向下滚动到其底部,包括会话变量名称和值。
If you can edit the html of the aspx page on the server then just set Trace="true" in the @Page directive as below:
Then when you load the page in the browser you will see a lot of information about the page when you scroll down to the bottom of it, including the session variable names and values.