调试问题,在线急等,大侠们帮忙解决呀,要不回不了家了!!!

haoren7842 2005-03-11 03:15:57
各位大侠,小弟很着急!!
我有个注册页面,刚完成一部分的时候,调试button能响应server事件,可是,等我全做完了,这个页面的所有button,imagebutton都不响应了,什么反映都没有,我把所有验证控件都删了,还是不响应,到底怎么回事呀????最可气的是,设断点也没用呀!!!
大哥,大侠们帮帮忙吧!!!!
...全文
128 17 打赏 收藏 转发到动态 举报
写回复
用AI写文章
17 条回复
切换为时间正序
请发表友善的回复…
发表回复
jony413 2005-03-11
  • 打赏
  • 举报
回复
好像不见页面有调用后台的哦。
没有<% Page %>
确实不行的话,建议此文件再建一次。
baobei7758 2005-03-11
  • 打赏
  • 举报
回复
保存文件,重启电脑!

然后再试~~我遇见相同问题时的做法!
haoren7842 2005-03-11
  • 打赏
  • 举报
回复
帮忙呀!!!
haoren7842 2005-03-11
  • 打赏
  • 举报
回复
我找到毛病了,是两个用户控件有问题,可是,我不知道为什么有问题
我把控件和引用给大家贴上来,大家帮我看看
引用:<%@ Register TagPrefix="uc1" TagName="navigation" Src="modules/navigation.ascx" %>
<%@ Register TagPrefix="uc1" TagName="function" Src="modules/function.ascx" %>

<uc1:navigation id="Navigation1" runat="server"></uc1:navigation>
<uc1:function id="Function1" runat="server"></uc1:function>

控件:
<%@ Control Language="c#" AutoEventWireup="false" Codebehind="forumtool.ascx.cs" Inherits="MusicYY.web.modules.forumtool" TargetSchema="http://schemas.microsoft.com/intellisense/ie5"%>
<table cellSpacing="0" cellPadding="0" width="778" border="0">
<tr>
<td vAlign="bottom" bgColor="#ffffff" height="62">
<OBJECT codeBase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0"
height="57" width="781" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000">
<PARAM NAME="_cx" VALUE="20664">
<PARAM NAME="_cy" VALUE="1508">
<PARAM NAME="FlashVars" VALUE="">
<PARAM NAME="Movie" VALUE="../images/dh.swf">
<PARAM NAME="Src" VALUE="../images/dh.swf">
<PARAM NAME="WMode" VALUE="Window">
<PARAM NAME="Play" VALUE="-1">
<PARAM NAME="Loop" VALUE="-1">
<PARAM NAME="Quality" VALUE="High">
<PARAM NAME="SAlign" VALUE="">
<PARAM NAME="Menu" VALUE="-1">
<PARAM NAME="Base" VALUE="">
<PARAM NAME="AllowScriptAccess" VALUE="always">
<PARAM NAME="Scale" VALUE="ShowAll">
<PARAM NAME="DeviceFont" VALUE="0">
<PARAM NAME="EmbedMovie" VALUE="0">
<PARAM NAME="BGColor" VALUE="">
<PARAM NAME="SWRemote" VALUE="">
<PARAM NAME="MovieData" VALUE="">
<PARAM NAME="SeamlessTabbing" VALUE="1">
<embed src="../images/dh.swf" width="781"></embed><!--


quality="high"




pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"




type="application/x-shockwave-flash"
width="781"
height="57">
</embed> -->
</OBJECT>
</td>
</tr>
</table>
<!-- <table cellSpacing="2" cellPadding="0" width="778" border="0">
<tr>
<td id="TDPos" runat="server"><font color="#ff6600">您现在的位置:</font><A class="black12" href="index.aspx">
Musicyy论坛</A> > 
<asp:label id="LabelGroup" runat="server"></asp:label>>
<asp:label id="LabelBoard" runat="server"></asp:label></td>
</tr>
</table>
<table cellSpacing="2" cellPadding="0" width="778" border="0">
<tr>
<td width="600" id="TDAmount" runat="server">版面公告:·本版主题数:
<asp:label id="LabelTotal" runat="server"></asp:label>·今日主题数:
<asp:label id="LabelToday" runat="server"></asp:label></td>
<td align="right" width="178"><asp:dropdownlist id="DropBoard" runat="server" Width="94px" AutoPostBack="True">
<asp:ListItem Value="跳转论坛">跳转论坛</asp:ListItem>
</asp:dropdownlist></td>
</tr>
</table>
<table cellSpacing="0" cellPadding="0" width="778" bgColor="#f3fdfe" border="0">
<tr>
<td id="TDGL" runat="server">帖子管理: 
<asp:linkbutton id="BtnTop" runat="server" ForeColor="Black">置顶</asp:linkbutton>| 
<asp:linkbutton id="BtnPrime" runat="server" ForeColor="Black">精华</asp:linkbutton>

<asp:LinkButton id="BtnLock" runat="server" ForeColor="Black">锁定</asp:LinkButton></td>
</TD>
<td id="TDManager" width="278" runat="server"></td>
</tr>
</table> -->


另一控件:<%@ Control Language="c#" AutoEventWireup="false" Codebehind="function.ascx.cs" Inherits="MusicYY.web.modules.function" TargetSchema="http://schemas.microsoft.com/intellisense/ie5"%>
<table height="28" cellSpacing="0" cellPadding="0" width="778" bgColor="#000000" border="0">
<tr>
<td align="center" width="37%" valign="bottom">
<asp:panel id="logonPanel" Runat="server">
<FONT color="#ffffff">    用户名</FONT>
<asp:TextBox id="userTextBox" Runat="server" Width="80"></asp:TextBox>
<FONT color="#ffffff"> 密码 </FONT>
<asp:TextBox id="passwordTextBox" Runat="server" Width="80" TextMode="Password"></asp:TextBox>
<asp:LinkButton id="logonLinkButton" Runat="server" CssClass="nav-white" CausesValidation="False"> 登录</asp:LinkButton>
</asp:panel>
<asp:panel id="logoutPanel" Runat="server">
<FONT color="#ffffff">
<asp:Label id="userLabel" Runat="server"></asp:Label> 欢迎您登录    </FONT>
<asp:LinkButton id="logoutLinkButton" Runat="server" CssClass="nav-white" CausesValidation="False">退出登录</asp:LinkButton>
</asp:panel>
<asp:HyperLink id="messageHyperLink" runat="server" ForeColor="Red" Font-Bold="True">您有未读短消息!</asp:HyperLink>
</td>
<td align="center" width="8%" valign="bottom"><asp:hyperlink id="registerLink" Runat="server" CssClass="nav-white" NavigateUrl="../register.aspx">免费注册</asp:hyperlink></td>
<td align="center" width="55%"><select name="select7">
<option selected>- 搜索类别 -</option>
</select>
<input type="text" size="14" value="关键字" name="textfield16"> <input type="submit" value="搜索" name="Submit">
<A class="nav-white" href="#">使用帮助</A> <A class="nav-white" href="#">网站地图</A>
</td>
</tr>
</table>

gscp 2005-03-11
  • 打赏
  • 举报
回复
你新建一个页面,把这个页面的代码拷贝过去试试,
设断点也没用是指什么?
把你说的先前行的代码先拷贝过去,行的话再一个一个的拷贝
应该没什么大问题D
haoren7842 2005-03-11
  • 打赏
  • 举报
回复
楼上的,不是呀,真奇怪!!!我们有定义好的命名规范呀!!!
大哥们,给点建议呀!!!好想回家呀!!
blackhero 2005-03-11
  • 打赏
  • 举报
回复
你双击控件
看看
xiaogueizi 2005-03-11
  • 打赏
  • 举报
回复
是不是到<from></from>外面克了啊?
blackhero 2005-03-11
  • 打赏
  • 举报
回复
有没有原码
xiaogueizi 2005-03-11
  • 打赏
  • 举报
回复
查一下aspx里是不是到<from></from>外面克了??
zxy1092003 2005-03-11
  • 打赏
  • 举报
回复
急也沒用﹐還是等高手來吧
看看要就发发 2005-03-11
  • 打赏
  • 举报
回复
up
估计有错误无法帮你
haoren7842 2005-03-11
  • 打赏
  • 举报
回复
无论是button 还是imagebutton都不管用了!!!是没任何反映,根本不提交!!!!
gy348 2005-03-11
  • 打赏
  • 举报
回复
button的ID 是不是submit?
如果是就换一下
haoren7842 2005-03-11
  • 打赏
  • 举报
回复
没有丢失呀
怎么就没反映了呢???真是急死人了!!!马上要上线了!!!
代码如下:是个三层结构,事件注册没有丢失!!!

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 MusicYY.web
{
using MusicYY.Common.Data;
using MusicYY.Business;

/// <summary>
/// register 的摘要说明。
/// </summary>
public class register : PageBase
{
protected System.Web.UI.WebControls.TextBox userTextBox;
protected System.Web.UI.WebControls.TextBox passwordTextBox;
protected System.Web.UI.WebControls.TextBox confirmTextBox;
protected System.Web.UI.WebControls.TextBox emailTextBox;
protected System.Web.UI.WebControls.TextBox yearTextBox;
protected System.Web.UI.WebControls.TextBox nameTextBox;
protected System.Web.UI.WebControls.TextBox homepageTextBox;
protected System.Web.UI.WebControls.TextBox qqTextBox;
protected System.Web.UI.WebControls.TextBox phoneTextBox;
protected System.Web.UI.WebControls.TextBox mobileTextBox;
protected System.Web.UI.WebControls.TextBox IDTextBox;
protected System.Web.UI.WebControls.TextBox postcodeTextBox;
protected System.Web.UI.WebControls.TextBox addressTextBox;
protected System.Web.UI.WebControls.DropDownList genderList;
protected System.Web.UI.WebControls.DropDownList educationList;
protected System.Web.UI.WebControls.DropDownList jobList;
protected System.Web.UI.WebControls.Image validateImage;
protected System.Web.UI.WebControls.DropDownList districtList;
protected System.Web.UI.WebControls.TextBox questionTextBox;
protected System.Web.UI.WebControls.TextBox answerTextBox;
protected System.Web.UI.WebControls.ImageButton submitImageButton;
protected System.Web.UI.WebControls.Label errorLabel;
protected System.Web.UI.WebControls.DropDownList monthList;
protected System.Web.UI.WebControls.DropDownList dayList;
protected System.Web.UI.WebControls.CheckBox agreeCheckBox;
protected System.Web.UI.WebControls.RequiredFieldValidator UserNameValidator;
protected System.Web.UI.WebControls.RequiredFieldValidator PasswordValidator;
protected System.Web.UI.WebControls.RequiredFieldValidator PasswordCompareValidator;
protected System.Web.UI.WebControls.CompareValidator ComparePasswordValidator;
protected System.Web.UI.WebControls.RequiredFieldValidator QuestionValidator;
protected System.Web.UI.WebControls.RequiredFieldValidator AnswerValidator;
protected System.Web.UI.WebControls.RequiredFieldValidator EmailValidator;
protected System.Web.UI.WebControls.Button ValidateButton;
protected System.Web.UI.WebControls.Label ValidateLabel;
protected System.Web.UI.WebControls.ImageButton ResetImageButton;
protected System.Web.UI.WebControls.RegularExpressionValidator RegularExpressionValidator1;
protected System.Web.UI.WebControls.TextBox validateTextBox;

private void Page_Load(object sender, System.EventArgs e)
{
// 在此处放置用户代码以初始化页面

if(!IsPostBack)
{
ValidateLabel.Visible = false;
}
}

#region Web 窗体设计器生成的代码
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: 该调用是 ASP.NET Web 窗体设计器所必需的。
//
InitializeComponent();
base.OnInit(e);
}

/// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
/// 此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.ValidateButton.Click += new System.EventHandler(this.ValidateButton_Click);
this.submitImageButton.Click += new System.Web.UI.ImageClickEventHandler(this.submitImageButton_Click);
this.ResetImageButton.Click += new System.Web.UI.ImageClickEventHandler(this.ResetImageButton_Click);
this.Load += new System.EventHandler(this.Page_Load);

}
#endregion



private void submitImageButton_Click(object sender, System.Web.UI.ImageClickEventArgs e)
{
errorLabel.Text = String.Empty;
// if(this.IsValid)
// {
if(agreeCheckBox.Checked)
{
if(validateTextBox.Text.Trim() == Session_CheckCode)
{
validateTextBox.Text = String.Empty;

string userName = userTextBox.Text.Trim();
string password = passwordTextBox.Text.Trim();
string email = emailTextBox.Text.Trim();
string realName = nameTextBox.Text.Trim();
string homepage = homepageTextBox.Text.Trim();
string qq = qqTextBox.Text.Trim();
string phone = phoneTextBox.Text.Trim();
string mobile = mobileTextBox.Text.Trim();
string IDNumber = IDTextBox.Text.Trim();
string postcode = postcodeTextBox.Text.Trim();
string address = addressTextBox.Text.Trim();
string gender = genderList.SelectedValue;
string education = educationList.SelectedValue;
string job = jobList.SelectedValue;
string question = questionTextBox.Text.Trim();
string answer = answerTextBox.Text.Trim();
string district = districtList.SelectedValue;
string birthday;
if(yearTextBox.Text.Trim() != String.Empty)
{
birthday = yearTextBox.Text.Trim() + "-" + monthList.SelectedValue + "-" + dayList.SelectedValue;
}
else
{
birthday = "1970-01-01";
}

MemberSystem memberSystem = new MemberSystem();
if(memberSystem.InsertMember(userName, password, email, realName, gender, birthday,
phone, mobile, qq, homepage, district, postcode, address, IDNumber, education, job, question, answer))
{
errorLabel.Text = "成功。";
}
else
{
validateTextBox.Text = String.Empty;
errorLabel.Text = "失败。";
}
}
else
{
validateTextBox.Text = String.Empty;
errorLabel.Text = "输入验证码有误,请重新输入。";
}
}
else
{
validateTextBox.Text = String.Empty;
errorLabel.Text = "只有接受我们的协议条款才能注册成为会员。";
}
// }
}

private void ValidateButton_Click(object sender, System.EventArgs e)
{
string userName = userTextBox.Text.Trim();
if(userName != "")
{
MemberSystem memberSystem = new MemberSystem();
if(memberSystem.ValidateUserName(userName))
{
ValidateLabel.Visible = true;
ValidateLabel.Text = "用户名已存在,请重新输入";
}
else
{
ValidateLabel.Visible = true;
ValidateLabel.Text = "您的用户名没有重复,可用";
}
}
else
{
ValidateLabel.Visible = true;
ValidateLabel.Text = "请输入用户名";
}
}

private void ResetImageButton_Click(object sender, System.Web.UI.ImageClickEventArgs e)
{
userTextBox.Text = String.Empty;
passwordTextBox.Text = String.Empty;
userTextBox.Text = String.Empty;
passwordTextBox.Text = String.Empty;
confirmTextBox.Text = String.Empty;
emailTextBox.Text = String.Empty;
yearTextBox.Text = String.Empty;
nameTextBox.Text = String.Empty;
homepageTextBox.Text = String.Empty;
qqTextBox.Text = String.Empty;
phoneTextBox.Text = String.Empty;
mobileTextBox.Text = String.Empty;
IDTextBox.Text = String.Empty;
postcodeTextBox.Text = String.Empty;
addressTextBox.Text = String.Empty;
questionTextBox.Text = String.Empty;
answerTextBox.Text = String.Empty;
validateTextBox.Text = String.Empty;
agreeCheckBox.Checked = false;
}


}
}
poleax81 2005-03-11
  • 打赏
  • 举报
回复
看看注册事件有没有丢失
haoren7842 2005-03-11
  • 打赏
  • 举报
回复
谢谢,斑竹了,谢谢大家了帮忙看看呀!!!
真是在线等!!!

62,072

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

试试用AI创作助手写篇文章吧