| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 343 人关注过本帖
标题:各位,遇到奇怪的问题
只看楼主 加入收藏
lijia0105
Rank: 1
等 级:新手上路
帖 子:20
专家分:0
注 册:2006-8-17
收藏
 问题点数:0 回复次数:1 
各位,遇到奇怪的问题

index.aspx:
<%@ Page language="c#" Codebehind="index.aspx.cs" AutoEventWireup="false" Inherits="Test.index" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
<HEAD>
<title>index</title>
<meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1">
<meta name="CODE_LANGUAGE" Content="C#">
<meta name="vs_defaultClientScript" content="JavaScript">
<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
</HEAD>
<body>
<form id="dd" method="post" action="text.aspx" runat="server">
<table border="0" cellpadding="0" cellspacing="0" width="750" align="center">
<tr>
<td>USER</td>
</tr>
<tr>
<td>
<asp:TextBox id="TextBox1" runat="server"></asp:TextBox></td>
</tr>
<tr>
<td>
<asp:Button id="Button1" runat="server" Text="Button"></asp:Button></td>
</tr>
</table>
</form>
</body>
</HTML>
index.aspx.cs:
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;

namespace Test
{
/// <summary>
/// Summary description for index.
/// </summary>
public class index : System.Web.UI.Page
{
protected System.Web.UI.WebControls.TextBox TextBox1;
protected System.Web.UI.WebControls.Button Button1;
protected Class1 c=new Class1();

private void Page_Load(object sender, System.EventArgs e)
{
// Put user code to initialize the page here
}

#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeComponent();
base.OnInit(e);
}

/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.Button1.Click += new System.EventHandler(this.Button1_Click);
this.Load += new System.EventHandler(this.Page_Load);

}
#endregion

private void Button1_Click(object sender, System.EventArgs e)
{
if(TextBox1.Text!="")
{
c.aaa=TextBox1.Text;
Session.Add("c",c);
//Response.Write("<script>alert('" + TextBox1.Text + "');</script>");
Response.Redirect("test.aspx?sdf=rr");
}
else
{
Response.Write("<script>alert('NULL');</script>");
}
}
}
}
我点击buttom1后,总是到index.aspx,不能到text.aspx,为什么呢?哪位大侠能帮忙?谢谢

2006-09-11 14:11
lijia0105
Rank: 1
等 级:新手上路
帖 子:20
专家分:0
注 册:2006-8-17
收藏
得分:0 

已解决,谢谢,重新启动项目就行了,我刷新过,不知为什么不行,关注中

2006-09-11 14:39
快速回复:各位,遇到奇怪的问题
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.011854 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved