Re: [問題] ASP.NET如何偵錯?
※ 引述《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
→
08/05 08:14, , 1F
08/05 08:14, 1F
→
08/05 19:59, , 2F
08/05 19:59, 2F
→
08/06 02:21, , 3F
08/06 02:21, 3F
→
08/06 20:41, , 4F
08/06 20:41, 4F
討論串 (同標題文章)
本文引述了以下文章的的內容:
完整討論串 (本文為第 3 之 3 篇):