The basic idea of what I want to do is: I've got 2 textboxes and a button that gets written from the server control, when the button is clicked, it should to a postback to the server where I want to extract the values posted in the textboxes and work with them.
I have an implementation of the IPostbackDataHandler in the server control:
public bool LoadPostData(string postDataKey, System.Collections.Specialized.NameValueCollection postCollection)
{
if (postCollection["__EVENTTARGET"] == this.UniqueID)
{
UserName = postCollection["LightBoxUsername"];
Password = postCollection["LightBoxPassword"];
return true;
}
else
{
return false;
}
}
public void RaisePostDataChangedEvent()...
The process works well up to the point where I extract the values from the postCollection.
When I do get the Username and Password values from the postCollection, they either consist of a comma at the beginning of each string variable eg: Username: ",MyUserName" and Password: ",MyPassword" or a collection of what seems to be viewstate usernames and passwords saved by the browser.
What am I doing wrong or what am I missing here, thx in advance