This error is an auto-generated JavaScript function __doPostBack inserted by ASP.NET indicating that "theForm" was undefined. After much searching around I figured out I had left out the initial body tag which rectified the issue.
Another remedy if the <body> tags are in position is to declare the form's id in the body tag, e.g.,
<body onload="javascript: theForm = document.forms[0];">
The following code can be placed in the PreRender event of the custom filebrowsers page if the latter 2 options do not work.
I include this tip in case "theForm is undefined" is searched here at Tek-tips and so perhaps may save someone a minute or two down the road.
Another remedy if the <body> tags are in position is to declare the form's id in the body tag, e.g.,
<body onload="javascript: theForm = document.forms[0];">
The following code can be placed in the PreRender event of the custom filebrowsers page if the latter 2 options do not work.
Code:
Me.ClientScript.RegisterClientScriptBlock(Me.GetType, "__doPostBack", _
"function __doPostBack(eventTarget, eventArgument) { " & _
" theForm = document.forms[0]; " & _
" if (!theForm.onsubmit || (theForm.onsubmit() != false)) { " & _
" theForm.__EVENTTARGET.value = eventTarget; " & _
" theForm.__EVENTARGUMENT.value = eventArgument; " & _
" theForm.submit(); " & _
" } " & _
"} " _
, True)
This line is the work-around: " theForm = document.forms[0]; " & _
I include this tip in case "theForm is undefined" is searched here at Tek-tips and so perhaps may save someone a minute or two down the road.