10853 : I want to know if there is a way in which i can call methods of an IE-hosted Gantt from a codebehind file ?

Question

My program is implemented like your http://www.plexityhide.nu/IEHostedGantt/Default.htm < ?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

from Q10027

 

But I want to know is there a way in which i can call methods of this dll from a codebehind file? (Want to pass a DataSet that i can populate the table with)

 

And also if it is possible to send information from the dll to the codebehind file? (So when a time item gets changed i send this information back to the codebehind file to update other fields in a different user control)

Answer

Please refer to this article for useful tips on using the XBAP deploy: https://plexityhide.com/faqs_gen_GTPNET/10787.htm

 

The dll is hosted locally and it is not executed at the server at all.

You can produce javascript code and have that call the dll on the client side.

To get feedback from dll I guess you can expose events and implement and assign a javascript event handler to it, then have some javascript do a postback with necessary information.

 

10787 : I want to host my UserControl with a Gantt in internet explorer and call it with javascript

< ?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />Question

I am trying to host my UserControl that contains a plexityhide Gantt in internet explorer. I cant get it to work and I get more or less zero feedback on what goes wrong so I am lost… Further more I want to call some stuff inside the UserControl with javascript once I get the thing to load….

 

Answer

Depending on the strict security context there are many mistakes to be made and Microsoft has chosen not to reveal security exceptions to the end user to make it harder for hackers.

 

In .NET 2.0 there are good tools to see security exceptions and you may just as well learn about them directly so that you can get stuff to work.

 

#1 You want to be able to call my UserControl from Javascript. To handle this your UserControl must be made COM-visible. Check the box in Project/properties/Assembly Information called “Make assembly Com-visible”.

 

#2 To smoke out all big and small security breaches that effectively stops your UserControl from being loaded go like this:

– Create a new windows form project

– Add your UserControl to it

– Choose Project/properties/Security on the new windowsform project. Check “Enable clickonce security settings”. Set “Zone your app is installed from” to “Internet” (or what you need).

– Now run the new winform app and behold all the minor and major stuff that gets caught by the security context. Like you cannot use SystemColors since that will need system access on the client. You cannot do this: Application.CurrentCulture = new System.Globalization.CultureInfo

And since you cannot set the culture you will get unexpected result from functions like decimal.Parse:

//HK decimal.Parse may not work since you may have the wring culture

//decimal num = decimal.Parse(Phase[“BudgetMoney”].ToString());

 Drag and drop requires extra permissions too

//gantt1.Grid.AllowDrop = true;   //HK Need UI-permissions

 

So either increase the security context by asking for more trust, or remove functionality…