Author: RSquared | Posted on: 8/3/2010 9:56:02 PM | Views : 935

I am using the following code to to programmatically add View controls to a MultiView control. But I get the this error

ActiveViewIndex is being set to '0'.  It must be smaller than the current number of View controls '0'. For dynamically added views, make sure they are added before or in Page_PreInit event.
Parameter name: value <%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
...

Go to the complete details ...