C# | ASP.NET/ASP.NET
ASP.NET Texbox에 포커스 이동시 팝업창 띄우기
bboks.net
2011. 6. 20. 19:31
1. 팝업창을 띄우기 위한 javascript를 aspx파일에 작성
axpx 파일
function CheckId() {
window.showModalDialog("CheckID.aspx", window, "dialogWidth:410px; dialogHeight:258px;status:no; scroll:no;help:no;unaborned:no");
}
function CheckId() {
window.showModalDialog("CheckID.aspx", window, "dialogWidth:410px; dialogHeight:258px;status:no; scroll:no;help:no;unaborned:no");
}
2. Code Behind에서 Textbox에 javascript 연결
axpx.cs (code behind)
protected void Page_Load(object sender, EventArgs e)
{
txtUserId.Attributes.Add("onFocus", "CheckIdl()");
}
protected void Page_Load(object sender, EventArgs e)
{
txtUserId.Attributes.Add("onFocus", "CheckIdl()");
}
[참조] Change Textbox/Input background color on focus