heyheyhey its your favorite noob ever...
ok so i need to instance my user control using code behind... been at this for a couple hours almost ( i exceeded my rate of two lines of code per day )
here is what i got:
User Control Class:
(it spawns a messageSending type of application, just a txtbox, send button, and a list of friends...) here i am trying to create the control after the user clicks the "Compose" link
Code:
UserControls_SendToContactsPanel objPanel = new UserControls_SendToContactsPanel();
objPanel.Initialize();
in the Initialize() method is the following:
Code:
publicvoid Initialize()
{
string user = HttpContext.Current.User.Identity.Name.ToString();
string conString = WebConfigurationManager.ConnectionStrings["myHomeConnection"].ConnectionString;
DataContext db = newDataContext(conString);
MembershipUser myObject = Membership.GetUser();
string UserID = myObject.ProviderUserKey.ToString();
var friends = (from m in db.GetTable<FriendList>() where m.UserID == UserID select m.FriendID);
if (friends != null)
{
ListView1.DataSource = friends;
ListView1.DataBind();
}
}
it appears that ListView1 doesnt exist... so should i have called Init on the Page_Loaded event? im going to try that... if it doesnt work.. im out of ideas.