Asp.net 2.0动态HTML在服务器2012(IIS)上呈现不同 [英] Asp.net 2.0 dynamically HTML rendered differently on server 2012 (IIS)

查看:66
本文介绍了Asp.net 2.0动态HTML在服务器2012(IIS)上呈现不同的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个奇怪的问题。

希望有人对此有一个简单而合乎逻辑的解释



基于网络的系统是一个课程注册系统。



ASP.NET 2.0站点已从Windows 2003服务器(IIS)移至新的Windows 2012服务器(IIS)。

在此版本之后,在新的2012服务器上以不同方式呈现动态生成的HTML文件。 2003服务器上的复选框成为2012服务器上的文本框。



我尝试过:



我们一直在研究两台服务器上的ASP.NET代码,这是完全相同的。但是动态生成的HTML弹出框在2012服务器上略有不同。下面我插入了两个版本的HTML代码。设置(正确)ID为6154以在2003服务器上键入checkbox,并错误地在2012服务器上键入text。



Windows 2003 Server:

====================

< input id =CH6156type =checkboxname =CH6156/>< label for =CH6156 >





Windows 2012 Server:

============ ========
$ b $bBekræft*< input name =DF6156type =textmaxlength =1id =DF6156class =INPUTstyle =width :100像素; />






因为它是动态生成的我不能更改HTML文件(弹出框)此弹出框对于每个课程都是新的,并且该人必须通过在复选框中设置复选标记来确认她已阅读一般条款。





我们做了很多测试。

如果HTML中的源代码被更改,那么它引用旧的2003服务器,重新运行Course9999.HTML正确呈现。

如果更改了Course9999.HTML中的源代码,因此它引用了新的2012服务器,则重新运行该文件现在会显示一个文本框。



我们已经检查过2003服务器和2012服务器上的网站都运行.NET Framework 2.0.50727。

两台服务器上的REGESTRY已经过调查,并且如何进行调查版本显示。我目前无法访问服务器,所以我无法检查它是否像新服务器上缺少的.NET Framework SP2一样简单。



我受到启发,通过这篇文章深入研究这个问题https://support.microsoft.com/en-us/kb/318785

I have a strange problem.
Hopefully someone has an easy and very logical explanation on this 

The web based system is a course enrollment system.

An ASP.NET 2.0 site has been moved from Windows 2003 server (IIS) to a new Windows 2012 server (IIS).
After this potation a dynamically generated HTML file is rendered differently on the new 2012 server. A checkbox on 2003 server becomes a text box on the 2012 server.

What I have tried:

We have been investigating the ASP.NET code on both servers and this is identically. But the dynamically generated HTML pop up box is slightly different on the 2012 server. Below I have inserted the HTML code for both versions. It is the ID "6154" that is set (correctly) to type "checkbox" on 2003 server and wrongly to type "text" on 2012 server.

Windows 2003 Server:
====================
<input id="CH6156" type="checkbox" name="CH6156" /><label for="CH6156">


Windows 2012 Server:
====================
Bekræft *<input name="DF6156" type="text" maxlength="1" id="DF6156" class="INPUT" style="width:100px;" />



Because it is dynamically generated I cannot change the HTML file (the pop up box) This pop up box is new for every course and the person must confirm the she has read the "general terms" by setting a check mark in the check box.


We have done a lot of testing.
If the source code in the HTML is changed so it refers to the old 2003 server, a rerun of the Course9999.HTML is rendered correctly.
If the source code in the Course9999.HTML is changed so it refers to the new 2012 server, a rerun of the file now displays a text box.

We have checked that websites on both 2003 server and 2012 server runs .NET Framework 2.0.50727.
The REGESTRY on both servers has been investigated and there is a little difference in how the versions are displayed. I have no access to the servers at the moment so I cannot checkup if it is as simple as a missing NET Framework SP2 on the new server.

I was inspired to dig into this matter by this article https://support.microsoft.com/en-us/kb/318785

推荐答案

显然,两台服务器上的行为都不同。

唯一的解决方案是在两台服务器上使用调试器查看代码行为不一样。你可能会发现有一点不能做同样的事情。



你应该学会尽快使用调试器。而不是猜测你的代码在做什么,现在是时候看到你的代码执行并确保它完成你期望的。



调试器允许你跟踪执行逐行检查变量,你会看到它有一个停止做你期望的点。

调试器 - 维基百科,免费的百科全书 [ ^ ]

掌握Visual Studio 2010中的调试 - A初学者指南 [ ^ ]

http: //docs.oracle.com/javase/7/docs/technotes/tools/windows/jdb.html [ ^ ]

https://www.jetbrains.com/idea/help/debugging-your -first-java-application.html [ ^ ]



调试器在这里向您展示您的代码正在做什么,您的任务是与它应该做什么进行比较do。

当代码没有达到预期效果时,你就接近了一个bug。
Obviously, something behave differently on both servers.
The only solution is to use the debugger on both servers to see where the code don't behave the same. You will probably see that there is a point where it don't do the same.

You should learn to use the debugger as soon as possible. Rather than guessing what your code is doing, It is time to see your code executing and ensuring that it does what you expect.

The debugger allow you to follow the execution line by line, inspect variables and you will see that there is a point where it stop doing what you expect.
Debugger - Wikipedia, the free encyclopedia[^]
Mastering Debugging in Visual Studio 2010 - A Beginner's Guide[^]
http://docs.oracle.com/javase/7/docs/technotes/tools/windows/jdb.html[^]
https://www.jetbrains.com/idea/help/debugging-your-first-java-application.html[^]

The debugger is here to show you what your code is doing and your task is to compare with what it should do.
When the code don't do what is expected, you are close to a bug.


这篇关于Asp.net 2.0动态HTML在服务器2012(IIS)上呈现不同的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆