How to Get value from a control - SecurityException - InfoPath Dev
in

InfoPath Dev

How to Get value from a control - SecurityException

Last post 10-27-2008 09:18 PM by onefootswill. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 10-27-2008 12:05 AM

    How to Get value from a control - SecurityException

     Hi there.

     

    I am trying to learn how to access the controls on an infopath form using VB.NET (using VSTA). Using the following code:

            Public Sub btnTest_Clicked(ByVal sender As Object, ByVal e As ClickedEventArgs)
                ' Write your code here.
                Dim chkBox As XPathNavigator = Me.MainDataSource.CreateNavigator().SelectSingleNode _
                            ("/my:myFields/my:chkCompleted", NamespaceManager)

            End Sub

     I am getting the following exception: "System.Security.SecurityException was unhandled by user code"
     

    If anyone can help, that would be ace!

  • 10-27-2008 09:18 PM In reply to

    Re: How to Get value from a control - SecurityException

    It's OK. I figured it out. I had to make it fully trusted.

    For other newbies with this problem, do this (when you are in design view of Infopath):

    1. Tools / Form Options
    2. click the 'Security and Trust' category
    3. uncheck 'Automatically determine security level'
    4. check 'Full Trust'

    Then, you should no longer get that error.

     

Page 1 of 1 (2 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.