홈>
동적 텍스트 상자를 ASP 마법사에 추가하고 SQL Server 테이블의 ID와 일치하도록 텍스트 상자 ID를 설정하고 있습니다. ID가 모두 고유하고 확인되었지만 마법사 단계에서 다른 단계로 클릭하면 다음 오류가 계속 발생합니다.
아약스를 사용하여 데이터를 다시 게시 할 때 데이터베이스의 고유 ID와 일치하는 텍스트 상자 ID가 필요합니다. 오류를 일으키는 것은 분명히 textbx ID입니다.
protected void Page_Init()
{
play1(null,null);
}
protected void play1(object sender, EventArgs e)
{
var wizsteps = sdc.usp_WizSteps().ToList();
foreach (var step in wizsteps)
{
WizardStep ws = new WizardStep();
ws.ID = step.SectionId;
ws.Title = step.SectionName;
wz1.WizardSteps.Add(ws);
ws.Title = step.SectionName;
Table tbl = new Table();
ws.Controls.Add(tbl);
//tbl.ID = UniqueID;
///End of step
var conts = sdc.usp_WizStepContent(int.Parse(step.SectionId)).ToList();
foreach (var cont in conts)
{
string txt = cont.strText;
//DataTable dt = new DataTable();
TableRow tr = new TableRow();
tbl.Rows.Add(tr);
System.Web.UI.WebControls.Label lbl = new System.Web.UI.WebControls.Label();
lbl.Text = txt;
TableCell td = new TableCell();
tr.Controls.Add(td);
td.Controls.Add(lbl);
if (cont.InputType == "Textbox")
{
TableCell tdi = new TableCell();
tr.Controls.Add(tdi);
System.Web.UI.WebControls.TextBox tb = new System.Web.UI.WebControls.TextBox();
tdi.Controls.Add(tb);
tb.ID = cont.id.ToString();
tb.CssClass = "changable";
tb.Text = cont.id.ToString();
}
}
}
wz1.ActiveStepIndex = 0;
}
- 답변 # 1
관련 질문
- C# SQLite 테이블을 생성하고 테이블이 존재하지 않을 경우 행 삽입
- 인덱스가 배열 범위를 벗어났습니다. c# SQL로 로그인할 때 오류가 발생했습니다.
- c# 사전 채우기 방법
- c# : 선거 투표 쿼리
- c# : Dapper 및 Microsoft SQL Server를 사용하여 항목을 업데이트하려고 할 때 SQL 오류
- c#의 csv에서 값을 가져오는 방법
- C# 상수 문자열을 연결하여 SQL 쿼리를 구성하는 것이 안전한가요?
- c# : SQL Server 데이터베이스에서 테이블 열 값을 가져오는 방법
- c# : from, to, via를 기준으로 경로의 시작점과 끝점을 선택합니다.
- LINQ to SQL C#에서 SELECT COUNT
나쁘다. 마법사 단계와 텍스트 상자 사이에 ID를 복제했습니다.