Custom InfoPath SharePoint Page Keep getting an error on form load?

Hi I am trying to host the XMLForm control on a custom page in sharepoint so that I can run some JS against it.
I have set up a page like so
<body>
<form id="form1" runat="server">
<div>
<asp:Label ID="status" runat="server" />
<InfoPath:XmlFormView PrintWindow="true" OnInit="Init_InfoPath" OnInitialize="Load_InfoPath" EditingStatus="Init" id="FormControl" Style="width:100%;" runat="server" __WebPartId="{2A7ABDDD-7682-4556-AE3E-FFF07257B593}"/>
</div>
</form>
</body>
A Init method like so
protected void Init_InfoPath(object sender, EventArgs e)
_xmlLocation = Request.QueryString["XmlLocation"];
_saveLocation = Request.QueryString["Source"];
FormControl.XmlLocation = _xmlLocation;
FormControl.EditingStatus = XmlFormView.EditingState.Editing;
FormControl.DataBind();
But I keep getting an error like so
The given key was not present in the dictionary.
System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
at System.ThrowHelper.ThrowKeyNotFoundException()
at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
at Microsoft.Office.InfoPath.Server.Util.ReadOnlyDictionary`2.System.Collections.Generic.IDictionary<K,V>.get_Item(K key)
at New_Programme.FormCode.FormEvents_Loading(Object sender, LoadingEventArgs e)
at Microsoft.Office.InfoPath.Server.SolutionLifetime.FormEventsHost.<>c__DisplayClass6.<>c__DisplayClassa.<add_Loading>b__3()
at Microsoft.Office.InfoPath.Server.Util.DocumentReliability.InvokeBusinessLogic(Thunk thunk)
at Microsoft.Office.InfoPath.Server.SolutionLifetime.FormEventsHost.<>c__DisplayClass6.<add_Loading>b__2(Object sender, LoadingEventArgs e)
at Microsoft.Office.InfoPath.Server.SolutionLifetime.FormEventsHost.<>c__DisplayClass34.<FireLoadingEvent>b__30()
at Microsoft.Office.InfoPath.Server.DocumentLifetime.OMExceptionManager.CallFormCodeWithExceptionHandling(UserMessages userMessages, OMCall d)
An entry has been added to the Windows event log of the server.
Log ID:5337
I have narrowed it down to the InfoPath form I am trying to host on this page specifically the loading method.
public void FormEvents_Loading(object sender, LoadingEventArgs e)
try
this.Path = e.InputParameters["XmlLocation"];
catch (Exception)
string str2 = e.InputParameters["SaveLocation"].ToString();
this.Path = str2.Substring(0, str2.LastIndexOf("/"));
Trace.WriteLine("save location is " + this.Path);
// NotifyHost("Message from InfoPath");
The e.inputParameter("XMLLocation") value is always null even though I am passing in the URL when i step through it at my page level but it never seems to get into the form.
If I press continue on the browser once the error shows the form data loads?
Can anyone explain what I have missed out here?
Later: I have figured out that e.InputParameters has no values, Do I need to do something to push values into this other than what I am doing above?

I figured out my issue from this url:
http://msdn.microsoft.com/en-us/library/microsoft.office.infopath.server.controls.initializeeventargs.inputparameters.aspx
Basically the aspx page control needed the OnInitialize.
<InfoPath:XmlFormView PrintWindow="true" OnInit="Init_InfoPath"
OnInitialize="Load_InfoPath" EditingStatus="Init" id="FormControl"
Style="width:100%;" runat="server" __WebPartId="{2A7ABDDD-7682-4556-AE3E-FFF07257B593}"/>
Then I needed the method to push the parameters into the infopath form, which wasn't clear in any of the sites which I was using to try get this working.
protected void Initialize_InfoPath(object sender, InitializeEventArgs e)
e.InputParameters["XmlLocation"] = _xmlLocation;
Hope this helps others who have struggled.

Similar Messages

  • Have rented a movie from iTunes but keep getting an error message cannot load film

    I have downloaded a rental movie to my iPad started to watch it and it gave me an error of cannot load film, have tried deleting the film from my videos but cannot do that either, when I go back I to iTunes to start the process again it immediately tries to play the film but the same message come up. Any ideas?

    Sounds like you might need to take it to an Apple Store but if it is an iPhone 3G it would no longer be under warranty.
    Looking at the Apple Store online you can get an iPhone 3GS from $49 on AT&T if it comes to having to get a new one. Your other option is second hand.

  • My hard drive fried and had to be replaced. I'm trying to install CS4 from my original discs but keep getting this error message - "One or more of the required components of Adobe Creative Suite 4 Design Standard failed to install correctly". A customer s

    My hard drive fried and had to be replaced. I'm trying to install CS4 from my original discs but keep getting this error message - "One or more of the required components of Adobe Creative Suite 4 Design Standard failed to install correctly". A customer service rep gave me a link to download off the Adobe site, but when I try to open the file to run it, I get this error message - "A problem occurred extracting the archive".
    Can anyone help?

    Yep.  Nothing happens at all. Windows tries to execute the uninstaller, but I don't get any other screen and all activity stops for the MSI.  I monitored it in Process Monitor and the MSI executable appears, but is quickly ended, like it couldn't find anything or something.
    It's as if windows has a blank entry in Programs and Features, because it used to show the size of the Adobe application in the "Size" column.  Now it's just blank.  Link to screenshot below:
    http://img829.imageshack.us/img829/5006/screenshotcaf.jpg
    Note the install date.  That's when I was able to successfully reinstall it.  Now I can't even do that.  I should also mention I tried Revo Uninstaller.  It deleted one small registry key, but nothing changed.
    By the way, is the CS cleaner supposed to ask for a disc in the drive when you run it?  It refused to run unless I had one in it, so I used my install dvd.

  • I just downloaded Mountain Lion and everything is working great. But i keep getting an error in the app store and i can't download 'Pages"

    I just downloaded Mountain Lion and everything is working great. But i keep getting an error in the app store and i can't download 'Pages' or any other apps. I keep getting an "error" and it says credit card processing is temporarily unavailable......help

    Try deleting the cache associated with the App Store.
    Quit the App Store if it's open.
    Open the Finder. From the Finder menu bar click Go > Go to Folder
    Type this exactly as you see it here:
    ~/Library/Caches/com.apple.appstore/Cache.db
    Click Go
    Move the Cache.db file to the Trash.
    Launch the App Store. See if that made a difference...

  • Downloaded but can't install - keep getting an error message because I never upgraded Keynote to 9.0, just pages and numbers

    Downloads but can't install the upgrade because I never upgraded Keynote, just Keynote and Numbers so I keep getting the error message about Keynote, which I don't use.  I just want to upgrade Pages and Numbers.

    If you purchased Pages and Numbers from the MAS:
    Dock > App Store > Updates (top bar of window) > click update next to the applications
    Peter

  • When trying to connect airport express keep getting unexpected error please try again.  IVE TRIED A HUNDRED TIMES AND HAVE FOUND SUPPORT PAGES UNHELPFUL

    when trying to connect airport express keep getting unexpected error please try again.  IVE TRIED A HUNDRED TIMES AND HAVE FOUND SUPPORT PAGES UNHELPFUL

    Have you tried using a WEP password for your wireless network instead of a WPA one? That fixed it for me.

  • I keep getting script errors when accessing Amazon Seller merchant pages. I get the following A script on this page may be busy, or it may have stopped responding. You can stop the script now, or you can continue to see if the script will complete. Script

    I keep getting script errors when accessing Amazon Seller merchant pages. I get the following A script on this page may be busy, or it may have stopped responding. You can stop the script now, or you can continue to see if the script will complete. Script: chrome://spautofill/content/spOverlay.js:150, I also get js210 as well. I have cleared all cookies and history and unistalled Firefaox and reinstalled. Been thru my AVS and set the site as trusted in every possible place. Still get the problem. Do not get it with IE on same PC.
    == URL of affected sites ==
    https://sellercentral.amazon.co.uk

    Same problem but with a different vendor site:
    https://www.webvitamins.com/myfavorites.aspx
    Not only does the page hang, but the other tabs also hang.
    I contacted the vendor and their reply was "we were told that this looks like a script that is used by "Sticky Password", third-party software that must have been installed on your browser. However, our website did not install it and does not have anything to do with it." As far as I can tell, "Sticky Password" is not installed on my Firefox.
    Same problem as above occurs, but with IE 8.0.6001.18702. Therefore, it is not unique to Firefox.
    CAUSE DETERMINED: Have determined that this problem only occurs when Kaspersky Password Manager is installed. In Firefox, if the "Password Manager Autofill Engine" add-on is disabled, the problem goes away.

  • I keep getting this error message and the spinning wheel on all websites, any fix? (Webpages are not responding, so loading cannot be stopped. Do you want to force reload this page and all pages in other tabs and windows?)

    I keep getting this error message and the spinning wheel on all websites, any fix? (Webpages are not responding, so loading cannot be stopped. Do you want to force reload this page and all pages in other tabs and windows?)

    Hi, this has worked for a few...
    Make a New Location, Using network locations in Mac OS X ...
    http://support.apple.com/kb/HT2712
    10.7…
    System Preferences>Network, top of window>Locations>Edit Locations, little plus icon, give it a name.
    10.5.x/10.6.x/10.7.x instructions...
    System Preferences>Network, click on the little gear at the bottom next to the + & - icons, (unlock lock first if locked), choose Set Service Order.
    The interface that connects to the Internet should be dragged to the top of the list.
    Instead of joining your Network from the list, click the WiFi icon at the top, and click join other network. Fill in everything as needed.
    For 10.5/10.6, System Preferences>Network, unlock the lock if need be, highlight the Interface you use to connect to Internet, click on the advanced button, click on the DNS tab, click on the little plus icon, then add these numbers...
    208.67.222.222
    208.67.220.220
    Click OK.

  • Trying to convert Pages to Word doc, but keep getting this error message:  TypeError:  Object doesn't support property or method 'invalidate'  JavaScript console contains more details.   Any ideas on how to get past this?

    Trying to convert Pages to Word doc, but keep getting this error message:  TypeError:  Object doesn't support property or method 'invalidate'  JavaScript console contains more details.   Any ideas on how to get past this?

    Right. If you are using delegated privs and sudo, make sure that sudo is configured to pass on the PERL5LIB and ORACLE_HOME environment variables at least.

  • I am using iWeb '08 2.0.4 to create a web page...since I will not be able to publish to Mobileme I am trying to publish to another server...I keep getting this error message " Parse error: syntax error, unexpected T_STRING"  I have no idea what to do????

    I am using iWeb '08 2.0.4 to create a web page...since I will not be able to publish to Mobileme I am trying to publish to another server...I keep getting this error message " Parse error: syntax error, unexpected T_STRING"  I have no idea what to do???? Any Suggestions?

    This is to do with the .htaccess file on your server.
    You either need to deal with this and open it with an html editor or change your web host.
    Do a search of this forum and there are plenty of posts that relate to parse error and .htaccess pages.  Have a look on the right hand side of this post and you will see similar ones like yours.

  • DO YOU KEEP Getting a error page when you reload

    I keep getting a error, server may be down when I reload the forum page, or post.  I hope this isn't a preview of what is to come on my end.

    walterkarroll wrote:
    I keep getting a error, server may be down when I reload the forum page, or post.  I hope this isn't a preview of what is to come on my end.
    its the forum software.  its terrible.
    close your browser, (entire thing not just the tab) and reopen.

  • I keep getting the error "Download Error. Press Retry or try again or contact customer suppor.(0)" when clicking on 'Apps' in the Creative Cloud program. Please help!

    Hey all,
    I keep getting this error when trying to use Adobe Creative Cloud. I only downloaded it today and I keep getting this download error. I have tried a few of the other solutions found and none seem to work. Sorry if there is an obvious fix but other solutions haven't worked for me
    I also keep getting this error. "Unable to reach Adobe Servers. Please check your internet connectivity, firewall settings, and then try again."
    Although I have no firewall enabled so...
    Thanks for the help!

    I had this problem with acrobat downloading.  I shut down the computer, restarted and it worked. 

  • I have a nexus 7 32gb Tablet. I installed firefox for android. i signed in to my internet page to check email. I keep getting the error script not responing

    So I keep getting this error when I try to sign in to check my email. It says continue or stop script. i have tried both. I never get to my email. Is there a fix to this problem,

    Try with Firefox Beta version
    *https://play.google.com/store/apps/details?id=org.mozilla.firefox_beta&hl=en

  • How to enable JIT debugging on my Windows 7 (64 bit) computer? I keep getting different Errors popping up on my computer about debugging different programs and that JIT debugging must be enabled!

    How do I enable JIT debugging on my Windows 7 (64 bit) computer? I keep getting different Errors popping up on my computer and the latest one says when I attempted to watch a DVD video with VLC media player but this isn't the first error this week saying
    that JIT debugging must be enabled and I don't know how to do that : ( "Microsoft Visual C++  Runtime Library"  Assertion Failed! Program C:\Program Files (x86) VideoLAN\VLC\vlc.exe  File: vm.c
    Line: 1765
    Expression: pgcit != NULL
    For information on how your program can cause an assertion failure, see the Visual C++ documentation on asserts.
    (Press Retry to debug the application- JIT must be enabled)

    Hi Rhondavas77,
    To enable/disable Just-In-Time debugging
    On the Tools menu, click Options.
    In the Options dialog box, select the Debugging folder.
    In the Debugging folder, select the Just-In-Time page.
    In the Enable Just-In-Time debugging of these types of code box, select or clear the relevant program types:
    Managed, Native, or Script.
    To disable Just-In-Time debugging, once it has been enabled, you must be running with Administrator privileges. Enabling Just-In-Time debugging sets a registry key, and Administrator privileges are required to change that key.
    Click OK.
    More information is here.
    http://msdn.microsoft.com/en-us/library/k8kf6y2a(v=vs.85).aspx
    Best Regards.
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • The new updated version of iMovie 10 won't let me open my previous files I created before the update today. I have a wedding that I'm trying to finish and deliver and now I can't because that file version won't open. I keep getting an error message

    Hello,
    Please help me figure this out. I'm very unhappy at the moment. I'm fustrated and don't have any idea how to revert to the original version before the update was done on iMovie 10. I NEVER hated APPLE until NOW!! I love APPLE products and apps so please help me stay in that mindset. So I worked on some movie projects when I got my macbook pro 6 months ago. I update reguarly. I saw the update prompt and honestly, I did not think I would have ANY issuess with opening my previous files that I created only a few months ago with this updated version.The new updated version of iMovie 10 won't let me open my previous files I created before the update today. I have a wedding that I'm trying to finish and deliver and now I can't because that file version won't open. I keep getting an error message and the iMovie app closes. Last night I saw the file and tried to open it but no luck. Error message came up again. I reboot and turned off my laptop for the evening and tried again just now but nothing!! I need that video. My job depends on it! I worked so hard on this wedding video and now it's lost and won't open. I work another job and don't have much time. I really don't want to start all over again. Please help me. Thanks so much for your assistance.
    Fustrated APPLE customer
    Jolly A. Rupp

    I also have Jolly's problem. I found the iMovie 9.0.9 folder and tried to launch the older version of iMove. It would not launch. I removed all of the iMovie preferences from the Preferences folder, removed iMove 10 from the applications folder, and restarted my Mac. iMove 9.0.9 still won't launch and I can't access my videos created with the older version of iMovie. Is there a way to uninstall iMovie 10 and reinstall iMovie 9.0.9?
    I am running Yosemitie on a  iMac.
    Paul

Maybe you are looking for