Control Reference

Hi

i am trying to add a control to my ASP.NET app.  I have added it in the usual way through the tool box.  i can paste the control on to a form and the control wotrks ok.  

The problem when I am writing my code ito access properties etc it get errors saying that it is not a member of the form. I knew I was accessing the right name of the control so I tried the page and the code worked !!

I must be missing a refernece from somewhere that is stopping visual studio from accessing the control properly but not sure where!
LVL 3
Kevin RobinsonPrivate VB.NET ContractorAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

naveenkohliCommented:
Where are you trying to access the properties of that control? Client side or server side?

If you can post some code to show how you are declaring the c ontrol and how you are accesing the properties, that would be great.
Kevin RobinsonPrivate VB.NET ContractorAuthor Commented:
I am tring to access the controls properties in the usual way   Contol.property = .  Visual studio does not seem to see the control so this does not bring up intilisence, but the web page works ok in the browser.


This works

HTML
======
<%@ Register Assembly="FreeTextBox" Namespace="FreeTextBoxControls" TagPrefix="FTB" %>

<FTB:FreeTextBox id="FreeTextBox1" runat="server" ToolbarLayout="StylesMenu,|Bold,Italic,Underline,RemoveFormat|JustifyLeft,JustifyRight,JustifyCenter,JustifyFull;BulletedList,NumberedList,Indent,Outdent;CreateLink,Unlink,InsertImage,InsertRule|Cut,Copy,Paste;Undo,Redo,Print" AutoGenerateToolbarsFromString="True" BreakMode="LineBreak" ButtonImagesLocation="InternalResource" DisableIEBackButton="True" HtmlModeCss="volunteer.css" HtmlModeCssClass="volunteer.css" ToolbarBackgroundImage="True" UpdateToolbar="False">
</FTB:FreeTextBox>


This shows an error in VS but does work
VB CODE
===========
Freetextbox1.text = "Some Text"



naveenkohliCommented:
Declare variable FreeTextBox1 in your code behind file.
samtran0331Commented:
this happens to me sometimes..especially using copy and pasting controls...in both vs2003 and vs2005...
but visual studio is not adding it to the designer , "generated code" section
....so if youre in vs2005, from solution explorer, click the "show hidden files" button, open the designer page and look for:

    Protected WithEvents yourControlName As System.Web.UI.WebControls.yourControlType


and I bet it's missing....add it and you will have intellisense again

if youre in vs2003, expand the "generated code" section and look for the same line of code, it won't be there...add it to the section...

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
samtran0331Commented:
...so you're missing something like:

    Protected WithEvents FreeTextBox1 As FreeTextBoxControls.FreeTextBox

also, you do have the dll added as a reference right?
and you did "import" it to the top of the codebehind too right?...
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP.NET

From novice to tech pro — start learning today.