So I have a LinkButton called linkButton.
protected LinkButton linkButton;
and inside a loop which gets every directory of a specified directory, I have this:
linkButton = new LinkButton();
linkButton.Text = DirInf.Name;
linkButton.CommandArgument = DirInf.FullName;
linkButton.Command += new CommandEventHandler(linkButton_Command);
Where DirInf is of type DirectoryInfo.
Now when I put:
Response.Redirect("filebrowser.aspx?dir=" + linkButton.CommandArgument);
linkButton = new LinkButton();
inside the function linkButton_Command, linkButton.CommandArgument seems to always be "C:\Windows," which so happens to be the last value linkButton.CommandArgument was assigned.
But I created a new instance of it - but the value still retains...
I'm quite puzzled...