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

Discussion in '.NET' started by meskaline, Nov 2, 2006.

  1. meskaline

    meskaline

    Joined:
    Nov 2, 2006
    Messages:
    1
    Hi!
    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;Integrated Security=SSPI;database=questionariohst")
    sql = "INSERT INTO [questionario] " & _
    "([1denominacao],[1unidfabris],[1localizacao],[1numcolaboradores],[1producao],[1manutencao],[1comadmin]) Values" & _
    "(@1denominacao,@1unidfabris,@1localizacao,@1numcolaboradores,@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))



    Try
    myConnection.Open()
    mySqlCommand.ExecuteNonQuery()

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

    Catch myException As Exception
    Response.Write(myException.ToString())
    Finally
    myConnection.Close()
    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:
    http://www.codingforums.com/showthread.php?t=97104
    or in
    http://www.velocityreviews.com/foru...-event-from-a-control-inside-a-container.html

    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"@"iol.pt)
    Last edited: Nov 5, 2006
    meskaline, Nov 2, 2006
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?RGVhc3Vu?=
    Replies:
    1
    Views:
    380
    Ken Cox [Microsoft MVP]
    May 10, 2005
  2. Chad
    Replies:
    4
    Views:
    8,323
  3. AAaron123
    Replies:
    0
    Views:
    268
    AAaron123
    Jan 21, 2009
  4. foldface@yahoo.co.uk

    button.onclick = new Function("func2()") + button.onclick

    foldface@yahoo.co.uk, Sep 25, 2005, in forum: Javascript
    Replies:
    2
    Views:
    250
    foldface@yahoo.co.uk
    Sep 26, 2005
  5. Moses
    Replies:
    3
    Views:
    188
    scripts.contact@gmail.com
    Mar 19, 2007
Loading...

Share This Page