Hi Shiva,
Thanks so much for your reply.
Maybe I didn't describe the question clearly.
I did an experiment, I created a custom aspx page using the Visual Studio and drag the XmlFormView control to the page, after that, I insert the URL of the form template, the code of this aspx page would add a line of code like this:
<cc1:xmlformview id="XmlFormView2" runat="server" editingstatus="Editing" height="250px" width="100%" xsnlocation="http://servername/formlibrary/Forms/template.xsn" OnInitialize="LoadForm"></cc1:xmlformview>
and then, in the code behind, I add the LoadForm function, I tried to use the
XmlFormView2.XmlForm.ViewInfos["ViewName"].IsDefault=true;
to set the default view when the form is opened via browser, but, there's no "IsDefault" statement provided.
So, the OnLoad view switch seems not gonna work...
And then, I tried the OnClick event, I add a button to the aspx page, and use the button's OnClick Event to call a function named "ChangeView" to change the view, the code is below:
protected void ChangeView(object sender, EventArgs e)
{
XmlFormView2.XmlForm.ViewInfos.SwitchView("View2");
}
when I debug, in the aspx page, I click the button, an NullReferenceException occur, this really puzzle me, is there anything I can do to fix these problems?