当前位置:编程学习 > C#/ASP.NET >>

将开发的项目迁移到其他电脑上的怪现象

我将开发的项目从一台机子迁移到另一台机子上是发生一个怪现象: 在登陆窗口的用户名和密码的输入文本框都不可以见了! --------------------编程问答-------------------- 无法回答。。。。。 --------------------编程问答-------------------- 你的开发环境是什么,用户登录是如何实现的? --------------------编程问答-------------------- 再试一台,第三台机器上呢? --------------------编程问答-------------------- 你的登录窗口用了什么特殊技术?

查看源码,看有没有用户名和密码的HTML --------------------编程问答-------------------- 附上源代码:

-----------------------------------web.config---------------------------------------<?xml version="1.0"?>
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
<appSettings>
<!--***以下为数据处理串*************************************************************************************************-->
<add key="connType" value="sql"/>
<add key="connString" value="initial catalog=gl;Server=.;Connect Timeout=30;user id=sa;password=;"/>
</appSettings>
<connectionStrings/>
<system.web>
<compilation debug="true">
<assemblies>
<add assembly="System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Xml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="CppCodeProvider, Version=8.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/></assemblies>
</compilation>
<authentication mode="Windows"/>
<customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
<error statusCode="403" redirect="/ucError.aspx"/>
<error statusCode="404" redirect="/ucError.aspx"/>
</customErrors>
</system.web>
</configuration>
-----------------------------------web.config---------------------------------------<?




--------------------编程问答-------------------- -----------------------------------login.aspx---------------------------------------<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Login.aspx.cs" Inherits="Login1" %>
<%@ OutputCache Location="None" %>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>登录系统</title>
    <link href="share/mainFrame.css" rel="stylesheet" type="text/css" />        
    <script language="javascript" type ="text/javascript" src="share/Common.js"></script>   
</head>
<body >
    <form id="loginFrom" class="sysLogin" runat="server" >
    <div style="text-align: center" class="sysLogin" >
        <br />
        <br />
        <br />
        <br />
        <br />

       <table unselectable="on" align=center>
            <tr>
                <td style="width: 704px; height: 521px; background-image:url(images/denglu.jpg); text-align: center;">
                    <br />
                    <br />
                    <br />
                    <br />
                    <br />
                    <table style="width: 376px; height: 58px;">
                        <tr>
                            <td style="width: 100px">
                            </td>
                            <td style="width: 53px">
                            </td>
                            <td colspan="2">
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 100px; text-align: right">
                            </td>
                            <td style="width: 53px; text-align: right">
                            </td>
                            <td colspan="2">
                                <asp:TextBox ID="txtUserName" runat="server" Width="80%">admin</asp:TextBox>
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtUserName"
                                    ErrorMessage="*" SetFocusOnError="True"></asp:RequiredFieldValidator></td>
                        </tr>
                        <tr>
                            <td style="width: 100px; text-align: right">
                            </td>
                            <td style="width: 53px; text-align: right">
                            </td>
                            <td colspan="2">
                                <asp:TextBox ID="txtPassWord" runat="server" TextMode="Password" Width="80%"></asp:TextBox>
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="txtPassWord"
                                    ErrorMessage="*" SetFocusOnError="True"></asp:RequiredFieldValidator></td>
                        </tr>
                        <tr>
                            <td style="width: 100px; text-align: right; height: 27px;">
                            </td>
                            <td style="width: 53px; text-align: right; height: 27px;">
                            </td>
                            <td colspan="2" style="height: 27px">                            
                                <asp:Button ID="btnLogin" runat="server" CssClass="bLogin"  Text="登录系统" OnClick="btnLogin_Click" />                                
                                
              </td>
                        </tr>
                        <tr>
                            <td style="width: 100px; height: 40px; text-align: right">
                            </td>
                            <td style="width: 53px; height: 40px; text-align: right">
                            </td>
                            <td colspan="2" >
                                
                            </td>
                        </tr>
                    </table>                    
                    </td>
            </tr>
        </table>
        <asp:Label ID = "lblErro" Text = "" runat="server" ForeColor="red"/>
        <br/>
        <br/>
        <br/>
        <br/>
        <br/>
        <br/>
    </div>
    </form>
</body>
</html>
-----------------------------------login.aspx---------------------------------------<% --------------------编程问答--------------------
-----------------------------------login.aspx.cs---------------------------------------
using System;
using Microsoft.Win32;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using JieYuan.Fromwork;

public partial class Login1 : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            Session.Clear();
            lblErro.Text = JieYuanControl.userInfo; 
        }
    }

    protected void btnLogin_Click(object sender, EventArgs e)
    {
        if (JieYuanControl.proJuageLogin(txtUserName.Text, txtPassWord.Text))
        {
            printnull();
            Response.Redirect("Default.aspx");
        }
        else
        {
            JieYuanShow.ShowAlert("对不起,您输入的用户名或密码不正确!");  
        }
    }

    private void printnull()
    {
        RegistryKey pregkey;            
        pregkey = Registry.CurrentUser.OpenSubKey("Software\\Microsoft\\Internet Explorer\\PageSetup\\", true);

        if (pregkey == null)
        {
            JieYuanShow.ShowAlert("自动调整失败,打印时会出现页眉信息,请从IE-->文件-->页面设置中清除。该操作不影响系统正常使用!");  
        }
        else
        {
            pregkey.SetValue("footer", "");
            pregkey.SetValue("header", "");
        }
    }
}

-----------------------------------login.aspx.cs---------------------------------------
--------------------编程问答-------------------- 代码没问题,检查下看看是不是浏览器的原因 --------------------编程问答-------------------- to chouto
           应该不是浏览器问题,
           我做了以下测试:1. 用那台有问题的机子测试了原开发机子的项目 没有问题
                            2. 用开发机子测试了两个项目 还是现在这个机子上的没有文本框 --------------------编程问答-------------------- 又见 灵异事件~~~ --------------------编程问答-------------------- --------------------编程问答-------------------- 这个个帖子暂且不结了!等待高手, 那太机子我估计没有什么问题,可能有些小毒.(之前用他做服务器还正常) --------------------编程问答-------------------- CTRL+A看看有没有! --------------------编程问答-------------------- 把Login.aspx页顶部的

<%@ OutputCache Location="None" %> 

这句去掉,然后重启IIS试一下。 --------------------编程问答-------------------- LZ的机器在三鹿中泡过吧。 --------------------编程问答-------------------- 直接去看源文件里面看有没有这个输出的textbox的源码在.. --------------------编程问答--------------------
引用 15 楼 pcitlju 的回复:
LZ的机器在三鹿中泡过吧。

太有才了,楼上的仁兄!
应该是浏览器样式不兼容
补充:.NET技术 ,  ASP.NET
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,