Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > declared or not declared ?

Reply
Thread Tools

declared or not declared ?

 
 
JohnZing
Guest
Posts: n/a
 
      02-05-2006
I'm usinf asp 2.0 and visual studio 2005

In html
<img id="selcolorimg" runat="server" name="selcolorimg"
src="image4.jpg">

I want to use selcolorimg in code behind, but vs2005 throws an error
"selcolorimg is not declared"

Ok, i tried to insert

Protected selcolorimg As HtmlImage

BUT, NOW i get a new error
'selcolorimg' is already declared as 'Protected Dim WithEvents
selcolorimg As System.Web.UI.HtmlControls.HtmlImage' in this class.

Declared where?? So, why vs2005 says is not declared??

 
Reply With Quote
 
 
 
 
Terry Burns
Guest
Posts: n/a
 
      02-05-2006
Well it's clear that it is declared otherwise you would not get this error.
The question is why intellisense is not recognising the fact when you are
trying to use the variable. Try saving all. Recompiling the entire project,
and restarting 2005 and see if it appears in intellisense.

--
Terry Burns
http://TrainingOn.net

"JohnZing" <> wrote in message
news: oups.com...
> I'm usinf asp 2.0 and visual studio 2005
>
> In html
> <img id="selcolorimg" runat="server" name="selcolorimg"
> src="image4.jpg">
>
> I want to use selcolorimg in code behind, but vs2005 throws an error
> "selcolorimg is not declared"
>
> Ok, i tried to insert
>
> Protected selcolorimg As HtmlImage
>
> BUT, NOW i get a new error
> 'selcolorimg' is already declared as 'Protected Dim WithEvents
> selcolorimg As System.Web.UI.HtmlControls.HtmlImage' in this class.
>
> Declared where?? So, why vs2005 says is not declared??
>



 
Reply With Quote
 
 
 
 
JohnZing
Guest
Posts: n/a
 
      02-05-2006
Thank you Terry!
I had to restart vs2005. Now it works! Lost 2 hours searching and
trying to figure out whats wrong with my code I feel so stupid... oh
well..

 
Reply With Quote
 
Jon Paal
Guest
Posts: n/a
 
      02-05-2006
There is a bug in VS, where it keeps trying to declare items which don't need to be declared

The solution is to save work and close VS, then reopen VS, big pain in rear.


"JohnZing" <> wrote in message news: oups.com...
> I'm usinf asp 2.0 and visual studio 2005
>
> In html
> <img id="selcolorimg" runat="server" name="selcolorimg"
> src="image4.jpg">
>
> I want to use selcolorimg in code behind, but vs2005 throws an error
> "selcolorimg is not declared"
>
> Ok, i tried to insert
>
> Protected selcolorimg As HtmlImage
>
> BUT, NOW i get a new error
> 'selcolorimg' is already declared as 'Protected Dim WithEvents
> selcolorimg As System.Web.UI.HtmlControls.HtmlImage' in this class.
>
> Declared where?? So, why vs2005 says is not declared??
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Why in some compilers if a function is not declared, the compilergives out a "warning" and not an "error"?? lostlander C Programming 5 12-10-2007 07:44 PM
Name <whatever> not declared?!?!?! Aaargh!! Scott M. ASP .Net 2 02-05-2004 06:18 PM
"name not declared" but it is TJS ASP .Net 2 02-03-2004 11:47 PM
Name 'DiffGram' is not declared. Guoqi Zheng ASP .Net 0 01-12-2004 04:42 PM
Not declared..? Kent Johnson ASP .Net 2 10-20-2003 04:59 PM



Advertisments
 



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