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 like
firstname,
lastname, etc.
Now, I have a main Asp page, called
Index.aspx. A user control called
GatherInfo.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 from
Index.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 projectIf 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.
" src="/emoticons/emotion-39.gif">
Mike
Here is some code for the user control i did.
Public
userInfo As User
Public
Property uInfo() As User
Get
Return userInfo
End Get
Set(ByVal value As User)
userInfo = value
End Set
End Property
'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.
Public Sub retrieveUserInfo()
With userInfo
.firstname = txtName.text
.lastname = txtlName.text
End With
End Sub