Hi Robert,
When we move a control (for example a TextBox) into the MultiView control, there will not be a prefix to the TextBox’s client ID. Hence, we can simply use document.getElementById('SearchTextBox').
What we should notice is that if a View is unActive, the controls in the View will not render to the client so that they do not exist on the client side.
The following code is for your reference. If you change the ActiveViewIndex property to -1, you can find SearchTextBox doesn’t exist in html.
<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
<title>Test height</title>
<script type="text/javascript">
function setValue()
{
var tb = document.getElementById(' SearchTextBox');
tb.value = 'hello';
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:MultiView ID="MultiView1" runat="server" ActiveViewIndex="0">
<asp:View ID="View1" runat="server">
<asp:TextBox ID=" SearchTextBox" runat="server" Style="position: static"></asp:TextBox></asp:View>
</asp:MultiView>
<input id="Button2" style="position: static" type="button" value="button" onclick="setValue()" /></div>
</form>
</body>
</html>