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.
Hi @Ming Cheung ,
What is the content of the form you plan to call for automatic submission,
why do you need to submit it automatically,
and can you describe your needs in more detail?
Best regards,
Lan Huang
i want to auto enroll a cert, the public CA require to submit a pin 16digits, some text number
and next page, there is a download button to download a cert file,
i want to do this programmingly, rather than i manual do 1 by 1
thank you
Hi @Ming Cheung ,
Is your data obtained from a third party?
Best regards,
Lan Huang
Yes, it is a public CA "Hong Kong Post" web site,
it only support normal page web form, no web service no API
i checked that .net has latest "webview2", obsoleted "webbroswer" component from nuget, but "webview2" not display anything, do you have any idea?
Hi LanHuang
i can use the "Webview2" in VS2019, but it can not pass the proxy, and no working example after searching internet, do you have any workable reference code?
i tried a obsoleted bulid in "Webbroswer", it will ask the login for proxy, but it shows script error when broswering some normal page, i suppose it only for former version html, css, any old stuffs, so ofcourse it obsoleted.
Sign in to comment
Please cancel the question
Sign in to comment