views:

26

answers:

1

Hi Guys

I just wrote this into my WebForms .aspx:

<span id="GenerateChartButton" runat="server"></span>

I went to the code-behind, and typed this:

this.GenerateChartButton

and it's not recognising that I added the span to the page. Is there something I need to do to make this happen? I have been working in MVC lately, so I haven't had to worry about the relationship between the page & code-behind in a while, but I can't remember any tricks that I had to perform to reference a HTML element in my code.

Can anyone remind/inform me of what I'm not doing?

Thanks

Dave

+1  A: 

Delete the .designer file (make a backup first) and then right click on the .aspx file and select 'Convert to Web Application'. That should make the designer file for you.

If it does not then you either have duff HTML which you need to correct first, your header line is poitning to the wrong class or a reference to a piece of code is broken.

Ryan ONeill
DaveDev
Yep, I know what you mean. The dev tool found a problem but didn't tell you. Try VS 2010 when you can, it's a pretty neat tool and they 'may' have fixed the bug.
Ryan ONeill