Just drag and drop one button control to page.
Just call CreateTextbox () on-click event of that button control.
In run-time if you click button the dynamic controls will display.
[code]
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>Dynamic Form</title>
<script type="text/javascript" >
function CreateTextbox()
{
var i = 1;
createTextbox.innerHTML = createTextbox.innerHTML +"<input type=text name='mytext'+ i/>"
createTextbox.innerHTML = createTextbox.innerHTML +"<input type=button value='Dynamci Button'+ i name='mytext'+ i/>"
}
</script>
</head>
<body>
<form name="form">
<input type="button" value="clickHere" onClick="CreateTextbox()"/>
<div id="createTextbox">
</div>
</form>
</body>
</html>
[/code]
No comments:
Post a Comment
Plz Share your comments...