Fracking Stupid Visual Designer Drops Event Linkages!!!

M

Mark Olbert

I am so mad at those, ahem, nice people up in Redmond that I could spit!!

I'm running VS2003 and .NET 1.1. In an ASP.NET page I'm developing, the blasted visual designer
keeps throwing away the linkages between my objects and the event handlers I've written.

The cycle is totally bizarre: everything will be fine, and then I'll run the website one more time
under debug and... voila! none of the event handlers fire because none of the linkages exist!

Going back into the visual designer shows that the linkages have all...vanished.

Restoring them all by hand -- which is a ROYAL pain in the butt, given that there are probably about
30 of them on this page! -- sometimes works. Then again, sometimes it doesn't.

And even if it does, the problem will re-appear at random intervals.

What the bloody blue blazes is going on?!? How do I fix this?!?

Thanx in advance for any help or advice.

- Mark
 
C

Cowboy \(Gregory A. Beamer\)

I had this problem on one machine and I have not had it since. not sure why,
so rebuild is my only advice to completely cure.

If C#, move the event hooks to your own routine and set that routine up when
the page initializes (in the "secret code"). You can do the same with
VB.NET, but it will go contrary to the "training wheels" set up with the
Handles keyword. The negative here is double clicking in the IDE will cause
it to get double wired, which is not nice.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

*************************************************
Think outside the box!
*************************************************
 
M

Mark Olbert

George,

Thanx for your reply. Those are good workarounds. I've also discovered that deleting the local
project cache seems to delay the onset of the problem...but it doesn't cure it. BTW, you can write
code to check for whether an event is already wired before you wire it again (at least, you can
under Windows.Forms), but that's ugly, too.

However, there's a bigger question here. I guess I'd still like to know >>why<< I have to do these
workarounds in the first place (I realize you don't work for MS, so I'm not demanding an answer from
you). I've written code generators in .NET (under Windows.Forms again), so it looks to me like the
ASP.NET code generator is broken somewhere.

But, most importantly, this seems like a serious bug in the development environment: sometimes
things work, and sometimes they don't, and nothing the programmer does seems to have anything to do
with whether things work or not. Ouch!

- Mark
 
J

Jeremy S.

<< Those are good workarounds>>
Another is to simply *not* use VS.NET for visual design/layout of Web pages.
Don't give it a chance to screw up and it won't. I'm not sure if or how this
would relate to your event-rewriting problems - but if you haven't
experienced it yet, you may find that VS.NET will also rewrite your HTML for
you (a royal pain if you like to hand-code you HTML - which is one of the
only ways to get good HTML). This rewrite may result in a completely
different layout than what you started with. Because of this, many
developers use VS.NET for *only* code-behind/C#programming work and use
another tool like FrontPage or Dreamweaver for all page layout
(HTML-related) work. Personally I keep both open and switch between the two
(Dreamweaver and VS.NET) - with all test sessions launched from VS.NET. Rule
of thumb - never open an aspx or ascx in VS.NET; classes and code-behind
okay.
 
M

Mark Olbert

I use Dreamweaver MX 2004 for most of my design work for just that reason. Unfortunately, IMHO,
Dreamweaver sux big time so far as stability is concerned; I can't tell you how often I've had work
vanish because it blows up [and I have a reflex arc to save very frequently :)].

- Mark
 

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top