내 웹 페이지에 세 개의 링크 버튼이 있습니다. 링크 버튼의 배경색을 제공했지만 특정 링크 버튼을 클릭 한 경우에만 표시되기를 원합니다. 어떻게 할 수 있는지 제안 해주세요. 내 코드는 다음과 같습니다.
protected void Link_Click(object sender, EventArgs e)
{
LinkButton lbtn = (LinkButton)sender;
lbtn.BackColor = System.Drawing.Color.Blue;
string id = lbtn.ID;
if (id == "lnkcot")
{
###
}
else if (id == "lnktex")
{
###
}
else if (id == "lnkgar")
{
###
}
}
감사합니다
나는 이것을하는 방법을 얻었다. . .! 다른 두 개의 링크 버튼 배경색을 투명과 동일하게 설정하십시오. 아래에서 확인하십시오.
protected void Link_Click(object sender, EventArgs e)
{
LinkButton lbtn = (LinkButton)sender;
lbtn.BackColor = System.Drawing.Color.Blue;
string id = lbtn.ID;
if (id == "lnkcot")
{
// set other two to transparent
lnktex.BackColor = Color.Transparent;
lnkgar.BackColor = Color.Transparent;
}
else if (id == "lnktex")
{
lnkcot.BackColor = Color.Transparent;
lnkgar.BackColor = Color.Transparent;
}
else if (id == "lnkgar")
{
lnkcot.BackColor = Color.Transparent;
lnktex.BackColor = Color.Transparent;
}
}
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다