Options

Nav is hanging when Browser controladdin page is closed

smshydsmshyd Member Posts: 72
edited 2013-08-28 in NAV Three Tier
Hi all,
I have created a Browser client addin using following code in VS.(not much idea on .net
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Dynamics.Framework.UI.Extensibility.WinForms;
using Microsoft.Dynamics.Framework.UI.Extensibility;
using System.Windows.Forms;
using System.Drawing;


namespace MyCompany.MyProduct.BrowserAddins
{
    [ControlAddInExport("MyCompany.MyProduct.BrowserAddin")]
    public class BrowsercontrolAddin : WinFormsControlAddInBase, IStringControlAddInDefinition
    {
        WebBrowser webBrowser1;
        string urlstring;
        System.Uri weburi;
        protected override Control CreateControl()
        {
            //throw new NotImplementedException();
            webBrowser1 = new System.Windows.Forms.WebBrowser();
            webBrowser1.Dock = System.Windows.Forms.DockStyle.Fill;
            webBrowser1.Location = new System.Drawing.Point(0, 0);
            webBrowser1.MinimumSize = new System.Drawing.Size(20, 20);
            webBrowser1.Name = "webBrowser1";
            webBrowser1.TabIndex = 0;
            weburi = new System.Uri("http://www.google.com");
            webBrowser1.Url = weburi;
            return webBrowser1;
        }
        //protected override Control CreateControl()
        //{
        //    throw new NotImplementedException();
        //}

        #region IValueControlAddInDefinition<string> Members

        public bool HasValueChanged
        {
            get { throw new NotImplementedException(); }
        }
        
            public string Value
            {
                get
                {
                    //    throw new NotImplementedException();
                    return urlstring;
                }
                set
                {
                    //throw new NotImplementedException();
                    urlstring = value;
                    if (value != "")
                    {
                        weburi = new System.Uri(value);
                        webBrowser1.Url = weburi;
                    }
                }
            }

        #endregion

            #region IEventControlAddInDefinition Members

            public event ControlAddInEventHandler ControlAddIn;

            #endregion
        }
        //[ControlAddInExport("MyCompany.MyProduct.BrowserAddin")]
        //public class BrowsercontrolAddin : WinFormsControlAddInBase, IStringControlAddInDefinition
        //{ 
        //}

    }
   
)
I have build and generated dll and registered Client addin through Addin Registration tool(christian blog I guess). Page running 5n and able to browse in RTC page also. But while closing the Page, nav gets stopped working . IS there any solution for this?

Comments

  • Options
    smshydsmshyd Member Posts: 72
    Hi all,
    is there any solution for the above issue.
Sign In or Register to comment.