作者a2975313 (GN)
看板C_Sharp
标题Re: [问题] ASP.NET如何侦错?
时间Tue Aug 5 01:48:12 2008
※ 引述《a2975313 (GN)》之铭言:
: ※ 引述《a2975313 (GN)》之铭言:
: : 想请问客位
: : 我写了一个程式,主要是使用Repeater,我分成2个档案 一个是xxx.aspx
: : 另一个是xxx.aspx.cs
: : 想问xxx.aspx.cs档要如何侦错?
: xxx.aspx.cs档里面的程式是↓
: using System;
: using System.Collections;
: using System.Configuration;
: using System.Data;
: using System.Web;
: using System.Web.Security;
: using System.Web.UI;
: using System.Web.UI.HtmlControls;
: using System.Web.UI.WebControls;
: using System.Web.UI.WebControls.WebParts;
: public partial class _Default : System.Web.UI.Page
: {
: protected void Page_Init(object sender, EventArgs e)
: {
: rp.ItemCommand += new RepeaterCommandEventHandler(rp_ItemCommand);
: }
: void rp_ItemCommand(object source, RepeaterCommandEventArgs e)
: {
: if (e.CommandName.Equals("delCmd"))
: {
: foreach (RepeaterItem item in rp.Items)
: {
: //如果CheckBox 有勾选,进入抓取系统编号,然後删掉此笔资料
: if (((CheckBox)item.FindControl("cb")).Checked)
: {
: int 系统编号 = Int32.Parse(((HiddenField)item.FindControl("hfd_系统编号")).Value);
: //删除资料的动作.
: }
: }
: }
: }
: protected void Page_Load(object sender, EventArgs e)
: {
: }
: }
: 这要如何侦错~"~
开启专案贴上以上的程式码後按F5,电脑显示
「找不到型别或命名空间名称'RepeaterCommandEventArgs'
(您是否遗漏using指示词或组件参考?)」
因为xxx.aspx.cs档要搭配xxx.aspx档才能使用,cs档里面是Repeater的按钮按下去後的
功能,好像不能直接侦错上面的程式码~"~
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 125.229.42.65
1F:→ KENyroj:你可能要找书来看比较快喔 = =+ 新增 web 专案 & 参考组件 08/05 08:14
2F:→ VZA:电脑显示 ~ 已告诉你"问题"的原因了 ~ 08/05 19:59
3F:→ a2975313:因为那个档案不是个完整的执行档,这样侦错的时候能run吗 08/06 02:21
4F:→ VZA:有错误的程式码,不能侦错!要先解决问题才能侦错! 08/06 20:41