If you need to update the text of a textbox after closing a popup window, you can achieve this in client-side code by following these steps:
Dim jsCode As String
jsCode = "var wnd = window.open('About.aspx', 'MsgWindow', 'width=500, height=500'); wnd.onbeforeunload = function() { document.getElementById('textboxvalue').value = 'Hello'; };"
ClientScript.RegisterClientScriptBlock(Me.GetType, "date", jsCode, True)
In this scenario, ensure that the ID referenced as textboxvalue matches the actual ID of the TextBox element in the HTML markup.
UPDATE - Implementing button click processing in client-side code:
<asp:Button ID="btnSelectDate" runat="server" OnClientClick="ProcessSelectDate(); return false;" />
<script>
function ProcessSelectDate()
{
var wnd = window.open('About.aspx', 'MsgWindow', 'width=500, height=500');
wnd.onbeforeunload = function () { document.getElementById('textboxvalue').value = 'Hello'; var form = document.forms['form1']; form.submit(); };
}
</script>
It is important to note that in the provided script, form1 represents the specific ID assigned to the form on the page.