Hi @Ming Cheung ,
I think you can use JavaScript
to do this, using the javascript onload
method. Just add the following JavaScript code on your form page.
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script type="text/javascript">
window.onl oad = function () {
document.getElementById('<%= commentTextBox.ClientID %>').value = 'whatever value';
var form = document.getElementById("form1");
form.submit();
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:TextBox id="commentTextBox" runat="server"></asp:TextBox>
</div>
</form>
</body>
</html>
Best regards,
Lan Huang
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.