2015-01-06 4 views
2

이것은 버튼에 대해 가지고있는 코드입니다. 클릭하면 configbutton 팝업 창이 표시됩니다. 나는 다른 코드를 찾아 보았지만 그 중 아무 것도 작동하지 않았습니다. 핵심 구성 요소가 누락 된 것처럼 느껴지지 만 그 부분이 무엇인지 확신 할 수 없습니다. 도움을 감사하십시오!버튼을 클릭 할 때 팝업 창을 만드는 방법

tr = new TableRow(); 
// Create the cell 
tc = new TableCell(); 
tc.Width = Unit.Point(300); 
tc.BorderWidth = 0; 
tc.BorderStyle = BorderStyle.None; 

Button ConfigButton = new Button(); 
ConfigButton.Text = "Configuration"; 
ConfigButton.Visible = true; 

tc.Controls.Add(ConfigButton); 
tr.Cells.Add(tc); 
tbl.Controls.Add(tr); 
+1

, 버튼의'에 대한 처리기를 추가 : 여기

이 컨트롤이 작동하는 방법을 보여주는 그는 AJAX 컨트롤 툴킷 샘플 웹 사이트에 대한 링크입니다 '이벤트를 클릭하고'MessageBox'를 표시하십시오. – grabthefish

+0

팝업 창에 무엇이 있습니까? – ZoomVirus

+1

이전 주석은'MessageBox'를 사용하고 질문은 __popupwindow__라고 말합니다. 내가 생각하기에 __popupwindow__는 ASP.Net을 사용하고 ** javascript ** 솔루션을 원한다고 생각하고 있습니다. MessageBox는 WinForm 및 대화 상자와 비슷하게 들립니다. –

답변

0

Using JavaScript Along with ASP.NET는 다음을 수행 할 것입니다 : 내가 AJAX 컨트롤 툴킷 ModalPopupExtender를 사용하여에보고하는 것이 좋습니다

// when you create the button, you can add attributes 
Button ConfigButton = new Button(); 

// this example will display alert dialog box 
ConfigButton.Attributes.Add("onclick", "javascript:alert('ALERT ALERT!!!')"); 

// to get you popup windows 
// you would use window.open with the BLANK target 

ConfigButton.Text = "Configuration"; 
ConfigButton.Visible = true; 
관련 문제