M
matt del vecchio
hello,
For some reason I am having difficulty doing what i thought would be
simple.
i want to loop thru a short list of categories, and for each one
programmatically add new LinkButton control. i think want to be able
to detect which new LinkButton was clicked. so like so:
LinkButton myLKB;
while (myDR.Read()) {
myLKB = new LinkButton();
myLKB.Text = myDR.GetString(1); //category description
myLKB.CommandName = "CategoryID";
myLKB.CommandArgument = myDR.GetString(0); //category id code
myLKB.Command += new CommandEventHandler(this.myLKB_Command);
}
....
private void myLKB_Command(object sender, System.EventArgs e){
Response.Write("in handler!!<br>");
Response.Write(CommandName + ": " + e.CommandArgument);
}
....yet the handler never seems to get called (no response.write is
ever done). i have also tried this w/ a .Click event, since im not
really sure if i should use a .Click or .Command.
any suggestions?
thanks!
matt
For some reason I am having difficulty doing what i thought would be
simple.
i want to loop thru a short list of categories, and for each one
programmatically add new LinkButton control. i think want to be able
to detect which new LinkButton was clicked. so like so:
LinkButton myLKB;
while (myDR.Read()) {
myLKB = new LinkButton();
myLKB.Text = myDR.GetString(1); //category description
myLKB.CommandName = "CategoryID";
myLKB.CommandArgument = myDR.GetString(0); //category id code
myLKB.Command += new CommandEventHandler(this.myLKB_Command);
}
....
private void myLKB_Command(object sender, System.EventArgs e){
Response.Write("in handler!!<br>");
Response.Write(CommandName + ": " + e.CommandArgument);
}
....yet the handler never seems to get called (no response.write is
ever done). i have also tried this w/ a .Click event, since im not
really sure if i should use a .Click or .Command.
any suggestions?
thanks!
matt