events not firing! :-/

Results 1 to 2 of 2

Thread: events not firing! :-/

  1. #1
    Join Date
    Dec 1969

    Default events not firing! :-/

    Hi all..As you may have asserted from the threads title, this is a web app. I&#039;m a .net beginner here, and I&#039;m seriously teetering on the boundries of sanity. As a disclaimer, I&#039;m going to state my problem(s) If I&#039;m forgetting some fundamental step here, please let me know I will accept any advice (tryin to stay sane...)<BR><BR>SO. Basically, if I put a label on my page<BR><BR>&#060;asp:label id=myLabel runat=server /&#062;<BR><BR>and then in the page_load event, I assign it a text value like so..<BR>
    <BR>Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load<BR>     myLabel.Text = "Some Text here..."<BR>End Sub<BR>[/vbcode]<BR><BR>..nothing happens.  This is ultra-baffling to me, since if I switch projects in VS.Net this identical code works perfectly, and given the utter simplicity here, I can&#039;t imagine what I could be missing.  I write the code, build the project and then navigate to it with my browser.  There are a bunch of other things on my codeBehind and I&#039;m experiencing other strange behavior.  <BR><BR>this is my full codebehind pasted right off<BR><BR>[vbcode]<BR>Public Class Form<BR>    Inherits System.Web.UI.Page<BR>    Protected WithEvents EmpNumber As System.Web.UI.WebControls.TextBox<BR>    Protected WithEvents CurrDate As System.Web.UI.WebControls.Label<BR>    Protected WithEvents EmpName As System.Web.UI.WebControls.TextBox<BR>    Protected WithEvents empPhone As System.Web.UI.WebControls.TextBox<BR>    Protected WithEvents empTitle As System.Web.UI.WebControls.TextBox<BR>    Protected WithEvents empLocation As System.Web.UI.WebControls.TextBox<BR>    Protected WithEvents chkAdminServices As System.Web.UI.WebControls.CheckBox<BR>    Protected WithEvents cellAdminServices As System.Web.UI.HtmlControls.HtmlTableCell<BR>    Protected WithEvents chkArtWork As System.Web.UI.WebControls.CheckBox<BR>    Protected WithEvents chkJanitorial As System.Web.UI.WebControls.CheckBox<BR>    Protected WithEvents chkAudVid As System.Web.UI.WebControls.CheckBox<BR>    Protected WithEvents chkLandscaping As System.Web.UI.WebControls.CheckBox<BR>    Protected WithEvents chkCafe As System.Web.UI.WebControls.CheckBox<BR>    Protected WithEvents chkDoors As System.Web.UI.WebControls.CheckBox<BR>    Protected WithEvents chkMoves As System.Web.UI.WebControls.CheckBox<BR>    Protected WithEvents chkFurniture As System.Web.UI.WebControls.CheckBox<BR>    Protected WithEvents chkParking As System.Web.UI.WebControls.CheckBox<BR>    Protected WithEvents chkGenMaint As System.Web.UI.WebControls.CheckBox<BR>    Protected WithEvents chkSecurity As System.Web.UI.WebControls.CheckBox<BR>    Protected WithEvents chkHVAC As System.Web.UI.WebControls.CheckBox<BR>    Protected WithEvents chkUtilities As System.Web.UI.WebControls.CheckBox<BR>    Protected WithEvents cellArtwork As System.Web.UI.HtmlControls.HtmlTableCell<BR>    Protected WithEvents cellJanitorial As System.Web.UI.HtmlControls.HtmlTableCell<BR>    Protected WithEvents cellAudVid As System.Web.UI.HtmlControls.HtmlTableCell<BR>    Protected WithEvents cellLandscaping As System.Web.UI.HtmlControls.HtmlTableCell<BR>    Protected WithEvents cellCafe As System.Web.UI.HtmlControls.HtmlTableCell<BR>    Protected WithEvents cellDoors As System.Web.UI.HtmlControls.HtmlTableCell<BR>    Protected WithEvents cellMoves As System.Web.UI.HtmlControls.HtmlTableCell<BR>    Protected WithEvents cellFurniture As System.Web.UI.HtmlControls.HtmlTableCell<BR>    Protected WithEvents cellParking As System.Web.UI.HtmlControls.HtmlTableCell<BR>    Protected WithEvents cellGenMaint As System.Web.UI.HtmlControls.HtmlTableCell<BR>    Protected WithEvents cellSecurity As System.Web.UI.HtmlControls.HtmlTableCell<BR>    Protected WithEvents celHVAC As System.Web.UI.HtmlControls.HtmlTableCell<BR>    Protected WithEvents cellUtilities As System.Web.UI.HtmlControls.HtmlTableCell<BR>    Protected WithEvents cellLights As System.Web.UI.HtmlControls.HtmlTableCell<BR>    Protected WithEvents descrip As System.Web.UI.WebControls.TextBox<BR>    Protected WithEvents empRegion As System.Web.UI.WebControls.TextBox<BR>    Protected WithEvents myButton As System.Web.UI.WebControls.Button<BR>    Protected WithEvents myLabel As System.Web.UI.WebControls.Label<BR>    Protected WithEvents empAddress As System.Web.UI.WebControls.TextBox<BR>    Protected WithEvents chkLights As System.Web.UI.WebControls.CheckBox<BR>    Protected WithEvents myPanel As System.Web.UI.WebControls.Panel<BR>    Protected WithEvents myTextBox As System.Web.UI.WebControls.TextBox<BR>    Protected WithEvents txt As System.Web.UI.WebControls.TextBox<BR>    Public WithEvents Form1 As System.Web.UI.HtmlControls.HtmlForm<BR>    Private objCollection As Collection<BR><BR>#Region " Web Form Designer Generated Code "<BR><BR>    &#039;This call is required by the Web Form Designer.<BR>    &#060;System.Diagnostics.DebuggerStepThrough()&#062; Private Sub InitializeComponent()<BR><BR>    End Sub<BR><BR>    Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init<BR>        &#039;CODEGEN: This method call is required by the Web Form Designer<BR>        &#039;Do not modify it using the code editor.<BR>        InitializeComponent()<BR>        Me.myLabel.Text = "this is text..."<BR>    End Sub<BR><BR>#End Region<BR><BR>    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load<BR>        &#039;Put user code to initialize the page here<BR>        Me.CurrDate.Text = DateValue(Now())<BR>        setUpPage()<BR>        &#039;code for attributes<BR>        Me.cellAdminServices.Attributes.Add("OnMouseOver", _<BR>                        "show(&#039;DivAdminServices&#039;);")<BR>        Me.cellArtwork.Attributes.Add("OnMouseOver", _<BR>                        "show(&#039;DivArtwork&#039;);")<BR>        Me.cellAudVid.Attributes.Add("OnMouseOver", _<BR>                        "show(&#039;DivAudVid&#039;);")<BR>        Me.cellCafe.Attributes.Add("OnMouseOver", _<BR>                        "show(&#039;DivCafe&#039;);")<BR>        Me.cellDoors.Attributes.Add("OnMouseOver", _<BR>                        "show(&#039;DivDoors&#039;);")<BR>        Me.cellFurniture.Attributes.Add("OnMouseOver", _<BR>                        "show(&#039;DivFurniture&#039;);")<BR>        Me.cellGenMaint.Attributes.Add("OnMouseOver", _<BR>                        "show(&#039;DivGenMaint&#039;);")<BR>        Me.celHVAC.Attributes.Add("OnMouseOver", _<BR>                        "show(&#039;DivHVAC&#039;);")<BR>        Me.cellJanitorial.Attributes.Add("OnMouseOver", _<BR>                        "show(&#039;DivJanitorial&#039;);")<BR>        Me.cellLandscaping.Attributes.Add("OnMouseOver", _<BR>                        "show(&#039;DivLandscaping&#039;);")<BR>        Me.cellLights.Attributes.Add("OnMouseOver", _<BR>                        "show(&#039;DivLights&#039;);")<BR>        Me.cellMoves.Attributes.Add("OnMouseOver", _<BR>                        "show(&#039;DivMoves&#039;);")<BR>        Me.cellSecurity.Attributes.Add("OnMouseOver", _<BR>                        "show(&#039;DivSecurity&#039;);")<BR>        Me.cellUtilities.Attributes.Add("OnMouseOver", _<BR>                        "show(&#039;DivUtilities&#039;);")<BR>        Me.cellParking.Attributes.Add("OnMouseOver", _<BR>                        "show(&#039;DivParking&#039;);")<BR><BR>        &#039;Move all checkboxes into a collection<BR>        objCollection = New Collection()<BR>        objCollection.Add(chkArtWork)<BR>        objCollection.Add(chkJanitorial)<BR>        objCollection.Add(chkAudVid)<BR>        objCollection.Add(chkLandscaping)<BR>        objCollection.Add(chkCafe)<BR>        objCollection.Add(chkDoors)<BR>        objCollection.Add(chkMoves)<BR>        objCollection.Add(chkFurniture)<BR>        objCollection.Add(chkParking)<BR>        objCollection.Add(chkGenMaint)<BR>        objCollection.Add(chkSecurity)<BR>        objCollection.Add(chkHVAC)<BR>        objCollection.Add(chkUtilities)<BR>        objCollection.Add(chkLights)<BR>        objCollection.Add(chkAdminServices)<BR><BR>    End Sub<BR><BR>    Sub setUpPage()<BR>        myPanel.Visible = True<BR>        myLabel.Text = "someText."<BR>        Dim l As New Label()<BR>        l.Text = "Label" + "whatever"<BR>        l.ID = "Label" + "someID"<BR>        myPanel.Controls.Add(l)<BR><BR>    End Sub<BR><BR>    &#039;Click event for submit button<BR>    Sub Click(ByVal sender As Object, ByVal e As EventArgs)<BR><BR>        &#039;Response.Redirect("conf.aspx")<BR>        &#039;Server.Transfer("conf.aspx", True)<BR>        Dim ctl As Control<BR>        Dim ctl2 As Control<BR>        Dim objCheck As CheckBox<BR>        For Each objCheck In objCollection<BR>            If objCheck.Checked = True Then<BR>                txt.Text &= objCheck.ID & "- Checked" & vbCrLf<BR>            End If<BR>        Next<BR><BR><BR>    End Sub<BR>End Class<BR>
    <BR><BR>Another example of strange behavior; in bolded line above..If I change the ID of the element so anything else (be it another textbox, or a label) the code will not reflect the change....It will simply put the value into txt anyway... So if I put<BR><BR>&#060;snip&#062;<BR>txt2.Text &= objCheck.ID & "- Checked" & vbCrLf<BR>&#060;/snip&#062;<BR><BR>In there instead, and I verify my txt2 control is above in my C/B page like so:<BR>Protected WithEvents txt2 As System.Web.UI.WebControls.TextBox<BR><BR>No dice. Values go right back into the control with ID txt, not txt2. :confused: <BR><BR>any guidance here would be splendid, I thank you in advance

  2. #2
    Join Date
    Dec 1969

    Default RE: events not firing! :-/

    How are you running the project? From the quick read-over that I did, it sounds like your dll simply isn&#039;t being recompiled. Trying running it from Visual Studio via F5, and see if that doesn&#039;t do the trick.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts