Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > onclick button event dont work in IE, only works in FIREFOX

Thread Tools

onclick button event dont work in IE, only works in FIREFOX

meskaline meskaline is offline
Junior Member
Join Date: Nov 2006
Posts: 1
I have a problem that hopefully someone can help me to find a solution, as soon as possible.
I have a form where i have a button with an onclick event, but that event only works when i run the page (aspx) in FIREFOX. In INTERNET EXPLORER it doenst work. WHY?

Well, i have a button where the client submit the data, like you can see above (i use framework 2.0) in page.aspx:

<asp:Button ID="enviar" runat="server" Text="Enviar" UseSubmitBehavior="false" OnClick="enviar_Click" OnClientClick="if (!confirm('Confirma envio de dados?')) return;"/>

In the code file (ASPX.VB), i have the enviar_click:

Protected Sub enviar_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles enviar.Click

Dim myConnection As SqlConnection
Dim mySqlCommand As SqlCommand
Dim sql As String

myConnection = New SqlConnection("server=(local)\SQLExpress;Integrate d Security=SSPI;database=questionariohst")
sql = "INSERT INTO [questionario] " & _
"([1denominacao],[1unidfabris],[1localizacao],[1numcolaboradores],[1producao],[1manutencao],[1comadmin]) Values" & _
"(@1denominacao,@1unidfabris,@1localizacao,@1numco laboradores,@1producao,@1manutencao,@1comadmin)"

mySqlCommand = New SqlCommand(sql, myConnection)

mySqlCommand.Parameters.Add(New SqlParameter("@1denominacao", TextBox1.Text))
mySqlCommand.Parameters.Add(New SqlParameter("@1unidfabris", unidadesfabris.SelectedValue))
mySqlCommand.Parameters.Add(New SqlParameter("@1localizacao", TextBox3.Text))
mySqlCommand.Parameters.Add(New SqlParameter("@1numcolaboradores", TextBox4.Text))
mySqlCommand.Parameters.Add(New SqlParameter("@1producao", TextBox5.Text))
mySqlCommand.Parameters.Add(New SqlParameter("@1manutencao", TextBox6.Text))
mySqlCommand.Parameters.Add(New SqlParameter("@1comadmin", TextBox7.Text))


'pnlMain.Visible = False //this is to show the panel pnlMain
'pnlResult.Visible = True //this is to show the panel pnlResult

Catch myException As Exception
End Try

End Sub

There are more people with this problem, i think (Buttons events works in Firefox but not in IE). In the following, there' a girl with a problem equal to mine:
or in

I tryed to send a message to the owner of the previous post (Ken Sturgeon), but i couldnt find a way to send a private message... because he could have a solution, so if anybody know him, please forward this. All help is welcome!

Thanks once again for your attention and reply. Possible you can help or know someone that can, because i dont have any more solutions...

If you know a solution, please reply me again.

Best regards,
Mesk (meskaline"@"

Last edited by meskaline; 11-05-2006 at 07:47 PM..
Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
GetMap() works as a button event but not inline. Problem ONLY in IE AAaron123 ASP .Net 0 01-21-2009 02:54 PM
DOM onClick event (works in FF and does not work in IE) Moses Javascript 3 03-19-2007 04:08 AM
button.onclick = new Function("func2()") + button.onclick Javascript 2 09-26-2005 08:13 AM
User Control Question: Button Onclick Event won't work (won't fire) Chad ASP .Net 4 05-27-2005 09:02 PM
Have an object that dont work on host but works on my PC ? =?Utf-8?B?RGVhc3Vu?= ASP .Net 1 05-10-2005 03:00 AM