Hi!
I have added a imagebutton on to a usercontrol. Here is the formcode
Here is the codebehind codeHTML Code:<div style="WIDTH: 1000px; HEIGHT: 55px"> <table cellSpacing="3" cellPadding="3" width="1000" border="0"> <!--DWLayoutTable--> <tr> <td vAlign="top" width="24" height="24"><IMG height="24" alt="Ny kontakt" src="Images/Ikoner/ny.gif" width="24"></td> <td vAlign="top" width="24"><a href="frmListContact.aspx"><IMG src="Images/Ikoner/Lista.gif" alt="Lista" width="24" height="24" border="0"></a></td> <td vAlign="top" width="24"> <asp:ImageButton id="imgbSave" runat="server" ImageUrl="Images/Ikoner/Spara.gif"></asp:ImageButton></td> <td vAlign="top" width="24"><IMG height="24" alt="Ta bort" src="Images/Ikoner/radera.gif" width="24"></td> <td class="text" align="right" width="844"> </td> </tr> <TR> <TD vAlign="top" bgColor="#000000" colSpan="5" height="1"></TD> </TR> <TR> <TD vAlign="top" bgColor="#ffffff" colSpan="5" height="1"><img src="Images/Ikoner/kundkort.gif" width="32" height="32" align="absMiddle"> <strong class="text style1">KUNDKORT</strong></TD> </TR> </table> </div>
VB Code:
Public Class ContactMenu Inherits System.Web.UI.UserControl #Region " Web Form Designer Generated Code " 'This call is required by the Web Form Designer. <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent() End Sub Protected WithEvents Panel1 As System.Web.UI.WebControls.Panel Protected WithEvents imgbSave As System.Web.UI.WebControls.ImageButton 'NOTE: The following placeholder declaration is required by the Web Form Designer. 'Do not delete or move it. Private designerPlaceholderDeclaration As System.Object Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init 'CODEGEN: This method call is required by the Web Form Designer 'Do not modify it using the code editor. InitializeComponent() End Sub #End Region Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load End Sub Public Sub imgbSave_Click(ByVal sender As System.Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles imgbSave.Click Dim obj As Contactcard = New Contactcard Dim I As Integer = obj.Save_Contact() If I = 1 Then End If End Sub End Class
My problems is that the imgbSave_Click metod is not executed when i press the imagebutton.
What´s wrong?
/Tyson




Reply With Quote