반응형
동적으로 Textbox를 생성하고 특정값을 보관하고 있다가
쓰려니깐 Textbox가 보인다.
숨길수 없을까?
javascript 로 숨길수 있다.
http://www.daniweb.com/forums/thread86493.html
여기를 참고하였다 ^^
There are many ways to show/hide, render/not render a control
For ASP.NET webcontrols you have the Visible property which can be set to true or false but that's serverside.
For client side you have visibility attribute in CSS which can be "visible" or "hidden", here is an example:
asp Syntax (Toggle Plain Text)
-
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ControlVisibilityClientSide.aspx.cs" Inherits="ControlVisibilityClientSide" %>
-
-
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-
-
<html xmlns="http://www.w3.org/1999/xhtml" >
-
<head runat="server">
-
<title>ControlVisibilityClientSide</title>
-
<script type="text/javascript">
-
function toggleVisibility(controlId)
-
{
-
var control = document.getElementById(controlId);
-
if(control.style.visibility == "visible" || control.style.visibility == "")
-
control.style.visibility = "hidden";
-
else
-
control.style.visibility = "visible";
-
-
}
-
</script>
-
</head>
-
<body>
-
<form id="form1" runat="server">
-
<div>
-
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
-
<input type="button" ID="btnShowHide" value="Show/Hide" onclick="toggleVisibility('TextBox1');" /></div>
-
</form>
-
</body>
-
</html>