English 中文(简体)
网络浏览器控制与一些javascript 构造不合作
原标题:WebBrowser control does not work with some javascript constructs

i have found that WebBrowser control (both Winforms and WPF) has certain javascript constructs not supported especially when they are rendered using showModalDialog / showModelessDialog calls....

这一点很容易得到推广。

(1) 创建测试的html网页,例如C:Temp Test.htm

    <input type=button
           onclick="showModalDialog( C:\Temp\Test.htm );"
           value="Show Me as Modal Page." />
    <BR />
    <a href="javascript:alert( I am shown. )">
       I should work using href.
    </a>
    <BR />
    <a href="#"
       onclick="javascript:alert( I am shown. )">
       I should work using onclick.
    </a>

If you load the page above using the IE browser, both hyperlinks should work. Now in the IE browser, if you you click the "Show Me as Modal Page." button, the same page opens as MSHTML dialog window and again on that both hyperlinks work.

预计会这样做。

(2) 现在创建<条码>WPF或<条码>。 页: 1

    <WebBrowser Source="C:TempTest.htm" Height="500" Width="500"/>

如果你使用<条码>WebBrowser控制,两条超级链接都将在装页上工作。

But 如果你使用“Show Me as Modal pp. Button”,将“Show Me”装上“Show Me as Modal pp. Button”,那么“示范窗口就利用第一个超级链接(即<>>>代码)发出警报。 我应当使用《手法》()开展工作。

第二台超链接按预期运行。

您是否认为存在第一个与工作超级联系的工作?

In my case I have no access to the page s content that I am loading using the javascript:showModalDialog() call, so the issue fix is intended from the web browser s perspective.

http://www.ohchr.org。

他们说,必须使<><>> > 标准>-标准_SCRIPTURL_MITATION 能够做到这一点。 但是,这已经在我的登记册中得以实现。 人均国民核算制度继续说......

By default, this feature is enabled for Internet Explorer and disabled for applications hosting the WebBrowser Control. It has to be manually enabled for webBrowser control.

如何使网络浏览器控制能够做到这一点?

最佳回答
问题回答

暂无回答




相关问题
Bring window to foreground after Mutex fails

I was wondering if someone can tell me what would be the best way to bring my application to the foreground if a mutex was not able to be created for a new instance. E.g.: Application X is running ...

How to start WinForm app minimized to tray?

I ve successfully created an app that minimizes to the tray using a NotifyIcon. When the form is manually closed it is successfully hidden from the desktop, taskbar, and alt-tab. The problem occurs ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...

Handle DataTable.DataRow cell change event

I have a DataTable that has several DataColumns and DataRow. Now i would like to handle an event when cell of this DataRow is changed. How to do this in c#?

Apparent Memory Leak in DataGridView

How do you force a DataGridView to release its reference to a bound DataSet? We have a rather large dataset being displayed in a DataGridView and noticed that resources were not being freed after the ...

ALT Key Shortcuts Hidden

I am using VS2008 and creating forms. By default, the underscore of the character in a textbox when using an ampersand is not shown when I run the application. ex. "&Goto Here" is not ...

WPF-XAML window in Winforms Application

I have a Winforms application coded in VS C# 2008 and want to insert a WPF window into the window pane of Winforms application. Could you explain me how this is done.

热门标签