开发者

form.defaultbutton does not work in Firefox

开发者 https://www.devze.com 2022-12-17 01:19 出处:网络
i am asking this question because my code has the following which works perfectly on IE but not on any other browsers.

i am asking this question because my code has the following which works perfectly on IE but not on any other browsers. Protected Sub Page开发者_如何学编程_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load If Not IsPostBack Then --- my code here -- Form.DefaultButton = Button_new.UniqueID End Sub

I have used Button_new.ID, Button_new.ClientID and it crashes completely. This is the error I get -

"System.InvalidOperationException: The DefaultButton of 'form1' must be the ID of a control of type IButtonControl."

What can I do to make this work in browsers other than just IE?


I experienced a problem that sounds a lot like what you describe. I solved it by upgrading to the latest service packet (.NET 3.5 SP1).

I recall seeing some people solve issues like this with Javascript code, but was fortunate that the service pack fixed my issue without the need to apply a workaround.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号