Results 1 to 33 of 33

Thread: Strange intellisense error.

  1. #1
    Member
    Join Date
    Feb 10
    Posts
    58

    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:


    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. Any pointers in any direction would be appreciated.

  2. #2
    Learning .Net danasegarane's Avatar
    Join Date
    Aug 04
    Location
    VBForums
    Posts
    5,815

    Re: Strange intellisense error.

    That's strange. Its working well for me
    Please mark you thread resolved using the Thread Tools as shown



    Windows 8 Developer Preview Available For Download
    www.techreceipe.com




  3. #3
    ASP.NET Moderator gep13's Avatar
    Join Date
    Nov 04
    Location
    The Granite City
    Posts
    21,735

    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

  4. #4
    Learning .Net danasegarane's Avatar
    Join Date
    Aug 04
    Location
    VBForums
    Posts
    5,815

    Re: Strange intellisense error.

    Do you mean by this one Gary ?

    Code:
      <ul id="UL1" runat="server" />
    UL1.InnerText = "Test"
    Please mark you thread resolved using the Thread Tools as shown



    Windows 8 Developer Preview Available For Download
    www.techreceipe.com




  5. #5
    ASP.NET Moderator gep13's Avatar
    Join Date
    Nov 04
    Location
    The Granite City
    Posts
    21,735

    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

  6. #6
    ASP.NET Moderator mendhak's Avatar
    Join Date
    Feb 02
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,174

    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.

  7. #7
    Member
    Join Date
    Feb 10
    Posts
    58

    Re: Strange intellisense error.

    Quote Originally Posted by mendhak View Post
    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.

  8. #8
    ASP.NET Moderator gep13's Avatar
    Join Date
    Nov 04
    Location
    The Granite City
    Posts
    21,735

    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

  9. #9
    Member
    Join Date
    Feb 10
    Posts
    58

    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.

  10. #10

  11. #11
    Fanatic Member paulorton's Avatar
    Join Date
    Aug 06
    Location
    West Wales
    Posts
    793

    Re: Strange intellisense error.

    Quote Originally Posted by polyglot View Post
    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....?
    I like a silver background - very restful on the eyes!
    Paul Orton
    VB6
    Visual Web Developer 2008 Express Edition
    Microsoft Visual Basic 2012 Express

  12. #12
    Member
    Join Date
    Feb 10
    Posts
    58

    Re: Strange intellisense error.

    Black and moody colours is more creative I find. Gets the juices going. So to speak.

  13. #13
    ASP.NET Moderator gep13's Avatar
    Join Date
    Nov 04
    Location
    The Granite City
    Posts
    21,735

    Re: Strange intellisense error.

    Quote Originally Posted by paulorton View Post
    Me, too, but black....?
    I like a silver background - very restful on the eyes!
    Okay, this I have to see. Can you post a screen shot?

    Gary

  14. #14
    Fanatic Member paulorton's Avatar
    Join Date
    Aug 06
    Location
    West Wales
    Posts
    793

    Re: Strange intellisense error.

    I find white too bright - and silver enhances the syntax colour highlighting.
    Attachment 76660
    Paul Orton
    VB6
    Visual Web Developer 2008 Express Edition
    Microsoft Visual Basic 2012 Express

  15. #15
    ASP.NET Moderator gep13's Avatar
    Join Date
    Nov 04
    Location
    The Granite City
    Posts
    21,735

    Re: Strange intellisense error.

    Hey,

    Your attachment doesn't seem to be working

    Gary

  16. #16
    Fanatic Member paulorton's Avatar
    Join Date
    Aug 06
    Location
    West Wales
    Posts
    793

    Re: Strange intellisense error.

    Sorry!

    Name:  silver.jpg
Views: 51
Size:  75.2 KB
    Paul Orton
    VB6
    Visual Web Developer 2008 Express Edition
    Microsoft Visual Basic 2012 Express

  17. #17
    ASP.NET Moderator gep13's Avatar
    Join Date
    Nov 04
    Location
    The Granite City
    Posts
    21,735

    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

  18. #18
    ASP.NET Moderator gep13's Avatar
    Join Date
    Nov 04
    Location
    The Granite City
    Posts
    21,735

    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

  19. #19
    Fanatic Member paulorton's Avatar
    Join Date
    Aug 06
    Location
    West Wales
    Posts
    793

    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.
    Paul Orton
    VB6
    Visual Web Developer 2008 Express Edition
    Microsoft Visual Basic 2012 Express

  20. #20
    Fanatic Member paulorton's Avatar
    Join Date
    Aug 06
    Location
    West Wales
    Posts
    793

    Re: Strange intellisense error.

    Quote Originally Posted by gep13 View Post
    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.
    Paul Orton
    VB6
    Visual Web Developer 2008 Express Edition
    Microsoft Visual Basic 2012 Express

  21. #21
    ASP.NET Moderator gep13's Avatar
    Join Date
    Nov 04
    Location
    The Granite City
    Posts
    21,735

    Re: Strange intellisense error.

    Quote Originally Posted by paulorton View Post
    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

  22. #22
    ASP.NET Moderator gep13's Avatar
    Join Date
    Nov 04
    Location
    The Granite City
    Posts
    21,735

    Re: Strange intellisense error.

    Quote Originally Posted by paulorton View Post
    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"

    Always nice to see different opinions though, so thanks for sharing!!

  23. #23
    Frenzied Member
    Join Date
    Mar 04
    Location
    Orlando, FL
    Posts
    1,529

    Re: Strange intellisense error.

    Quote Originally Posted by paulorton View Post
    Me, too, but black....?
    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.
    Sean

    Some days when I think about the next 30 years or so of my life I am going to spend writing code, I happily contemplate stepping off a curb in front of a fast moving bus.

  24. #24
    ASP.NET Moderator mendhak's Avatar
    Join Date
    Feb 02
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,174

    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.
    Attached Images Attached Images  

  25. #25
    ASP.NET Moderator mendhak's Avatar
    Join Date
    Feb 02
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,174

    Re: Strange intellisense error.

    Quote Originally Posted by paulorton View Post
    Sorry!

    Name:  silver.jpg
Views: 51
Size:  75.2 KB
    Can you get me your VSSettings file? (Tools>Import and Export Settings). I'd like to try it. Might be a convert...

  26. #26
    ASP.NET Moderator gep13's Avatar
    Join Date
    Nov 04
    Location
    The Granite City
    Posts
    21,735

    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.

  27. #27
    Fanatic Member paulorton's Avatar
    Join Date
    Aug 06
    Location
    West Wales
    Posts
    793

    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).
    Attached Files Attached Files
    Paul Orton
    VB6
    Visual Web Developer 2008 Express Edition
    Microsoft Visual Basic 2012 Express

  28. #28
    Fanatic Member paulorton's Avatar
    Join Date
    Aug 06
    Location
    West Wales
    Posts
    793

    Re: Strange intellisense error.

    Quote Originally Posted by mendhak View Post
    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!
    Paul Orton
    VB6
    Visual Web Developer 2008 Express Edition
    Microsoft Visual Basic 2012 Express

  29. #29
    ASP.NET Moderator mendhak's Avatar
    Join Date
    Feb 02
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,174

    Re: Strange intellisense error.

    Quote Originally Posted by paulorton View Post
    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 Doesn't go well with Consolas though, looks a bit better with Courier New. Did you come up with this yourself?

  30. #30
    ASP.NET Moderator mendhak's Avatar
    Join Date
    Feb 02
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,174

    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.

  31. #31
    Frenzied Member
    Join Date
    Mar 04
    Location
    Orlando, FL
    Posts
    1,529

    Re: Strange intellisense error.

    Quote Originally Posted by mendhak View Post
    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.
    Sean

    Some days when I think about the next 30 years or so of my life I am going to spend writing code, I happily contemplate stepping off a curb in front of a fast moving bus.

  32. #32
    ASP.NET Moderator gep13's Avatar
    Join Date
    Nov 04
    Location
    The Granite City
    Posts
    21,735

    Re: Strange intellisense error.

    Quote Originally Posted by mendhak View Post
    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

  33. #33
    ASP.NET Moderator mendhak's Avatar
    Join Date
    Feb 02
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,174

    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.
    Attached Files Attached Files

Posting Permissions

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