Quantcast
Viewing all articles
Browse latest Browse all 3509

Reference issues/App_Code

Hello all,

I've created (in the app_code folder) a class called common.vb.
At the top of the file, before the public class common line,
i created a public structure called User, and it contains basic properties likefirstname, lastname, etc.
Now, I have a main Asp page, called Index.aspx. A user control calledGatherInfo.ascx. With GatherInfo.ascx.vb,the code behind imports the common class, and has its own property of type User (from common.vb). When I attempt to access this property fromIndex.aspx (having of course registered the class at the top of the page with a tagprefix of User1)
I receive the following visual studios error:

Reference Required to assembly 'AppCode.kqzkqziee, version = 0.0.0.0 culture = neutral, PublicKeyToken=null, containing the type User, add one to your project

If i were to try to access that structure. for example imagine i did this:

1) Create a variable of type UserInfo (from the common class)
2) Call the User1.retrieveUserInfo sub  (remember User1 was the tag prefix for the GatherInfo user control)
3) Assign this property from User1 to the struct we declared in step 1 (both of the same type of course)
4) Line 3 would generate the above error in red.

Now if i just changed the property's type from User to something basic, like integer, everything works fine.
Any suggestions? Thanks all this is killing me. I'm assuming its some sort of register/compile issue i've confused.Image may be NSFW.
Clik here to view.
Super Angry [8o|]


Mike

Here is some code for the user control i did.

Public

 userInfoAs User

Public

Property uInfo() As User
Get
     Return
userInfo
EndGet

Set(ByVal valueAs User)
     userInfo = value
EndSet

EndProperty

'this code below is responsible for taking any values typed into the textboxes in the user control, and assigning them to the struct's values.

PublicSub retrieveUserInfo()

With userInfo
   .firstname = txtName.text
   .lastname = txtlName.text
End
With

EndSub


Viewing all articles
Browse latest Browse all 3509

Trending Articles