<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://www.infopathdev.com:443/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Views</title><link>https://www.infopathdev.com:443/forums/42.aspx</link><description> </description><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: INFOPATH 2007 SwitchView in XmlFormView Aspx Page</title><link>https://www.infopathdev.com:443/forums/thread/11662.aspx</link><pubDate>Tue, 20 Mar 2007 22:47:34 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:11662</guid><dc:creator>Matt Faus</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/11662.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=42&amp;PostID=11662</wfw:commentRss><description>You cannot use this method to switch views in OnLoad.  To switch views in this event handler you have to set the default view of the form, then when OnLoad finishes that view will be displayed.&lt;br /&gt;&lt;br /&gt;I'm not sure of the exact syntax of this command but it should be something like:&lt;br /&gt;&lt;br /&gt;XmlFormView1.XmlForm.ViewInfos["Approver1"].IsDefault = true;</description></item><item><title>INFOPATH 2007 SwitchView in XmlFormView Aspx Page</title><link>https://www.infopathdev.com:443/forums/thread/11518.aspx</link><pubDate>Thu, 08 Mar 2007 09:37:00 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:11518</guid><dc:creator>sumit_kute</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/11518.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=42&amp;PostID=11518</wfw:commentRss><description>INFOPATH 2007: &lt;br /&gt;Hello,  &lt;br /&gt;I have created a custom .aspx page and placed a XMLFORMVIEW control on it. I want to switch the view in XMLFormView control hosting an infoPath template programitically.&lt;br /&gt;I tried to write the following line in Onload and Initilize on  XMLFormView Control. The code is &lt;br /&gt;&lt;br /&gt;      XmlFormView1.XmlForm.ViewInfos.SwitchView("Approver1");&lt;br /&gt;&lt;br /&gt;This is returning an "Object Reference not set to an instance of an object" error.  Any ideas?&lt;br /&gt;&lt;br /&gt;Please help.&lt;br /&gt;&lt;br /&gt;Thanks</description></item></channel></rss>