server crashes when I access a certain control

Ask a Question related to ASP.NET General, Design and Development.

  1. #1

    Default server crashes when I access a certain control


    I have the following control defined (among others) ... it represents the
    active form on the ASP

    Protected WithEvents frmMain As System.Web.UI.HtmlControls.HtmlForm

    Then I have this

    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
    System.EventArgs) Handles MyBase.Load

    If Page.IsPostBack Then
    For Each ctl As WebControl In Me.frmMain.Controls
    If ctl.CssClass = "FieldInError" Then
    ctl.CssClass = ""
    End If
    Next
    End If

    End Sub



    The "for each" loop is just designed to clear up any "highlighting" I may
    have done during a previous round trip.

    When this code is executed, the 'for each ....' statement crashes ASP.NET

    The error in the Application Log says that it was recycled because it sucked
    up too much memory. I watched it. It goes from 30k to 360k within a couple
    of seconds.

    I stepped through this code, and it never gets to the 'if ctl.cssClass'
    statement ... it dies on the 'for each' statement.


    Any ideas?






    Boban Dragojlovic Guest

  2. Similar Questions and Discussions

    1. using javascript in User controls to access server controls of the user control
      Hello all, I have an asp.net textbox (named txtHidden) and an HtmlButton(named btnAction). I wanted to write a javascript function which will get...
    2. Custom Server Control works on page but not User Control...why?
      I'm developing the DevEdit.NET server control (an online HTML editor - www.devedit.com) but there's an extremely bizarre bug. The control runs fine...
    3. #6674 [Com]: Apache crashes as soon as I access my server running PHP 4.0.2 + mod_perl 1.24
      ID: 6674 Comment by: peitschie at hotmail dot com Reported By: ruudc at home dot nl Status: Closed Bug Type: ...
    4. Building a custom control that implement table server control
      Hi, I want to create a custom control that implements the table htmlcontrol. In my webform page I want to include that custom control and add...
    5. Query crashes Access 2000
      I am working on a Access database for a client that uses office 2000 on winXp, I use OfficeXP.on win2000. Using access 2000 fileformat. Everything...
  3. #2

    Default Re: server crashes when I access a certain control

    Most of the controls in the Controls collection are not going to be
    WebControl so it would bomb. Get them as Control and then test for children
    and is it a WebControl. You will have to step into the children to get the
    controls say...under the HtmlForm control.

    bill



    "Boban Dragojlovic" <news@_N_O_S_P_AM_dragojlovic.org> wrote in message
    news:SicVa.19$xC6.65705165@newssvr13.news.prodigy. com...
    >
    > I have the following control defined (among others) ... it represents the
    > active form on the ASP
    >
    > Protected WithEvents frmMain As System.Web.UI.HtmlControls.HtmlForm
    >
    > Then I have this
    >
    > Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
    > System.EventArgs) Handles MyBase.Load
    >
    > If Page.IsPostBack Then
    > For Each ctl As WebControl In Me.frmMain.Controls
    > If ctl.CssClass = "FieldInError" Then
    > ctl.CssClass = ""
    > End If
    > Next
    > End If
    >
    > End Sub
    >
    >
    >
    > The "for each" loop is just designed to clear up any "highlighting" I may
    > have done during a previous round trip.
    >
    > When this code is executed, the 'for each ....' statement crashes ASP.NET
    >
    > The error in the Application Log says that it was recycled because it
    sucked
    > up too much memory. I watched it. It goes from 30k to 360k within a
    couple
    > of seconds.
    >
    > I stepped through this code, and it never gets to the 'if ctl.cssClass'
    > statement ... it dies on the 'for each' statement.
    >
    >
    > Any ideas?
    >
    >
    >
    >
    >
    >

    William F. Robertson, Jr. Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139