-
Strange intellisense error.
Hi, I have this strange error coming up in VS2008, where is says a variable in not declared in HTML view, when it clearly is declared in the codebehind:
http://i50.tinypic.com/313oxh1.gif http://i50.tinypic.com/20u1yiv.gif
Can anyone help with why this might be happening? I've tried all sorts of things, even recreating the page from scratch, but this keeps coming up. :confused: Any pointers in any direction would be appreciated.
-
Re: Strange intellisense error.
That's strange. Its working well for me
-
Re: Strange intellisense error.
Hey,
If at all possible, I would recommend that you don't use this approach. Don't mix server side variables/code with your ASPX markup.
Gary
-
Re: Strange intellisense error.
Do you mean by this one Gary ?
Code:
<ul id="UL1" runat="server" />
UL1.InnerText = "Test"
-
Re: Strange intellisense error.
Hey,
Yes, change the UL's text in the server side code, as you have described. Doing this in the ASPX markup is mixing code when there is really no need.
Gary
-
Re: Strange intellisense error.
Wow, what theme is that? You could try clearing the temporary ASP.NET files folder.
You could also use a Repeater instead of the <ul>. In the Repeater, define the <ul> with the <li> as the template and bind the repeater to your list items.
-
Re: Strange intellisense error.
Quote:
Originally Posted by
mendhak
Wow, what theme is that?
heh.. none, just my own choice of colours. I come from the age of DOS and green-screens, so I like the moody colours on black. :)
-
Re: Strange intellisense error.
Ha ha. I wasn't going to mentions the colours, but now that we have...
Do you not find that difficult to read and work with? I tend to stick to the default colours that ship with Visual Studio, I have never felt the need to change it. But I guess everyone has their own preference.
Gary
-
Re: Strange intellisense error.
No, I definitely find those colours easier on my eyes than a white background. I avoid white backgrounds in my editors whenever possible. :)
-
Re: Strange intellisense error.
-
Re: Strange intellisense error.
Quote:
Originally Posted by
polyglot
No, I definitely find those colours easier on my eyes than a white background. I avoid white backgrounds in my editors whenever possible. :)
Me, too, but black....? :eek:
I like a silver background - very restful on the eyes!
-
Re: Strange intellisense error.
Black and moody colours is more creative I find. Gets the juices going. So to speak.
-
Re: Strange intellisense error.
Quote:
Originally Posted by
paulorton
Me, too, but black....? :eek:
I like a silver background - very restful on the eyes!
Okay, this I have to see. Can you post a screen shot?
Gary
-
Re: Strange intellisense error.
I find white too bright - and silver enhances the syntax colour highlighting.
Attachment 76660
-
Re: Strange intellisense error.
Hey,
Your attachment doesn't seem to be working :(
Gary
-
1 Attachment(s)
Re: Strange intellisense error.
-
Re: Strange intellisense error.
Hmm, that's interesting.
I see what you mean about it starting out a little more.
I think I would be more inclined to use this, rather than the black. I might actually have to give this some thought.
Gary
-
Re: Strange intellisense error.
Hey,
On a side note, you know you shouldn't really be using MsgBox in an ASP.Net application, right?
Gary
-
Re: Strange intellisense error.
No, I didn't, why is that?
Actually my error handlers are deliberately just skeletons at this stage - I want to tackle the site's functionality first and then look at how to do this properly.
-
Re: Strange intellisense error.
Quote:
Originally Posted by
gep13
Hmm, that's interesting.
I see what you mean about it starting out a little more.
I think I would be more inclined to use this, rather than the black. I might actually have to give this some thought.
Gary
Ooh, a potential convert!
To some tastes this background is a little too dark but of course you can always choose a slightly different shade.
-
Re: Strange intellisense error.
Quote:
Originally Posted by
paulorton
No, I didn't, why is that?
Actually my error handlers are deliberately just skeletons at this stage - I want to tackle the site's functionality first and then look at how to do this properly.
MsgBox, or more correctly MessageBox, will work on your local development machine, because it is both the server and the client. However, when you go to put that application onto the server, and then access it from another machine, the message box will not actually appear.
If you are trying to display the error to the user, you should really write it out to a label, or inject some JavaScript to display an alert, or something similar, on the client.
Gary
-
Re: Strange intellisense error.
Quote:
Originally Posted by
paulorton
Ooh, a potential convert!
To some tastes this background is a little too dark but of course you can always choose a slightly different shade.
I said "think" :D
Always nice to see different opinions though, so thanks for sharing!!
-
Re: Strange intellisense error.
Quote:
Originally Posted by
paulorton
Me, too, but black....? :eek:
I like a silver background - very restful on the eyes!
I'm with the other guy. First thing I do when I get a new environment is switch it to a black background. The lighter colors just give me headaches after a while. Even my desktop is just plain black.
-
1 Attachment(s)
Re: Strange intellisense error.
This is what I'm using. Also a dark background, but the colors aren't as contrasting as the OP's. It's basically this vssetting file, but I've changed the font to Consolas. You may have seen the Consolas font used heavily on Office 2007.
-
Re: Strange intellisense error.
Quote:
Originally Posted by
paulorton
Can you get me your VSSettings file? (Tools>Import and Export Settings). I'd like to try it. Might be a convert...
-
Re: Strange intellisense error.
Ooo, I didn't know you could do an export of your settings.
That would be interesting to give these a try.
-
1 Attachment(s)
Re: Strange intellisense error.
Had to change the file extension obviously.
Note that the background colour is a custom colour (after our little discussion I changed the original - the one in the screenshot I posted - to something a little lighter. If you want the original colour it's just plain old Silver).
-
Re: Strange intellisense error.
Quote:
Originally Posted by
mendhak
This is what I'm using. Also a dark background, but the colors aren't as contrasting as the OP's. It's basically
this vssetting file, but I've changed the font to Consolas. You may have seen the Consolas font used heavily on Office 2007.
I quite like this but the colours are still a little harsh for my sensitive eyes! I love the font, though - off to try that out now!
-
Re: Strange intellisense error.
Quote:
Originally Posted by
paulorton
Had to change the file extension obviously.
Note that the background colour is a custom colour (after our little discussion I changed the original - the one in the screenshot I posted - to something a little lighter. If you want the original colour it's just plain old Silver).
This is actually quite good.
It looks like a code block on a web page too :D Doesn't go well with Consolas though, looks a bit better with Courier New. Did you come up with this yourself?
-
Re: Strange intellisense error.
Sweet Jesus, look at the bunch of us. Talking about VS themes like women talk about shoes. It really is the year 2010. /facepalm
Although, it is code related, so that makes it somewhat OK.
-
Re: Strange intellisense error.
Quote:
Originally Posted by
mendhak
Sweet Jesus, look at the bunch of us. Talking about VS themes like women talk about shoes. It really is the year 2010. /facepalm
Although, it is code related, so that makes it somewhat OK.
I don't know, considering how much of our lives we spent abusing our eyes on computer screens, it's not a bad conversation. I've personally been holding out on glasses for years because in the end they just make your vision worse, but it's getting to the point where I can't read subtitles any more on the TV without my eyes starting to water.
-
Re: Strange intellisense error.
Quote:
Originally Posted by
mendhak
Sweet Jesus, look at the bunch of us. Talking about VS themes like women talk about shoes. It really is the year 2010. /facepalm
Although, it is code related, so that makes it somewhat OK.
Ha ha :)
-
1 Attachment(s)
Re: Strange intellisense error.
That's true, I'm a -8. Yes, -8. I've been staring at computers since I was six, so it's gotten progressively worse over time. Those exercises that they teach you about looking away, blinking more often, they are quite important and you really should pay attention to that.
I've also attached mine with the consolas font. It's alright to move your font size up a notch as well. It's your eyes after all.