javascript how to dynamically add asp button
<head runat="server">
<title></title>
<script type="text/javascript">
window.addEventListener('load', function () {
var submitbtn = document.createElement("INPUT");
submitbtn.setAttribute("id", "button2");
submitbtn.type = "submit";
submitbtn.value = "SUBMIT2";
submitbtn.addEventListener("click", postbackfunction);
document.getElementById('form1').appendChild(submitbtn);
});
function postbackfunction() {
console.log("Heihei");
__doPostBack("submit", "");
}
</script>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<div>
<asp:Button ID="button1" runat="server" OnClick="button1_Click" Text="SUBMIT1" />
<asp:TextBox ID="text1" runat="server"></asp:TextBox>
</div>
</form>
</body>
Also in JavaScript:
- send message to user facebook game
- back press subscriptions i is not a function react native
- react keep screen on
- javascript split array into chunks
- array unique values javascript
- how to get element by attribute value in javascript
- Image react native
- mapping a pojo with json via gson
- multidimensional array javascript
- redirect to url in javascript
- mongodb gte
- javascript get distinct values from array
- ionic modal navbar not showing
- javascript stringify an object
- js random quine number
- cookie clicker hack
- mac os chrome opne debug new tab
- how to test useeffect with enzyme
- javascript check if two date are ugual
- use bootstrap in react
- manifest.webmanifest example
- js random minus
- double question mark javascript
- javascript json deserialize