2
동적 asp : table에 필요한 Validator (예제 텍스트 상자)를 추가하고 싶습니다.Dynamic Asp : net 테이블에 필요한 Validator 추가
코드 : 라인 당신이 나를 도와 줄 수 Row.Cells.Add(Cell);
에
" System.Web.UnhandledException in System.web.dll"
:이 오류를 얻고있다
foreach (KeyValuePair<string, string> o in Collection)
{
TableRow Row = new TableRow();
TableCell valueCell = new TableCell();
TableCell Cell = new TableCell();
TextBox txtBox = new TextBox();
TextBox txtBox1 = new TextBox();
txtBox1.ID = o.Key + o.Value;
if (o.Value.Contains("Mandatory"))
{
RequiredFieldValidator req = new RequiredFieldValidator();
req.ErrorMessage = "Required";
req.BorderColor = System.Drawing.Color.Red;
req.ControlToValidate = txtBox1.ID;
req.Enabled = true;
req.Display = ValidatorDisplay.Dynamic;
Cell.Controls.Add(req);
}
valueCell.Controls.Add(txtBox1);
Row.Cells.Add(valueCell);
Row.Cells.Add(Cell);
table.Rows.Add(Row);
}
그러나?
예외 메시지의 세부 정보를 최소한 입력하십시오. –
이 예외에 대한 세부 정보는 어떻게 얻을 수 있습니까? VS가 표준 Exception 창을 열지 않기 때문입니다. –
빠른 해결책으로,'try/catch' 블록에 코드를 래핑하고'catch' 블록에 중단 점을 넣을 수 있습니다. –