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)
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: