作业地点#1:
// imports
const routes: Routes = [{
path: 'page1',
component: Page1Component
}];
@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule]
})
export class Page1RoutingModule {
public static routes = routes;
}
作业地点#2:
case 1:
TableCell tCell = new TableCell();
if (!strlil_image_1.Contains("blank"))
{
var img = new ImageButton();
img.ID = "imglil_image_" + strlil_image_1.Replace("images/inventory/", String.Empty).Replace(".", "_");
img.AlternateText = "Image " + i.ToString();
img.ImageUrl = strlil_image_1;
img.Width = 40;
img.Height = 40;
img.Click += img_Click;
tCell.Controls.Add(img);
}
else
{
var img = new Image();
img.ID = "imglil_image_" + i.ToString();
img.AlternateText = "Image " + i.ToString();
img.ImageUrl = strlil_image_1;
img.Width = 40;
img.Height = 40;
tCell.Controls.Add(img);
}
tRow1.Cells.Add(tCell);
break;
相关功能:
TableCell tCell = new TableCell();
if (arrList[i].mark_color_group)
{
tCell.Style.Add("border", "1px solid brown");
imgMainPic.ImageUrl = arrList[i].image_name.ToString();
}
var img = new ImageButton();
img.ID = "imglil_color_group_" + arrList[i].color_id;
img.AlternateText = "Image " + arrList[i].color_id;
img.ImageUrl = arrList[i].image_name;
img.Width = 40;
img.Height = 40;
img.Click += img_Click;
tCell.Controls.Add(img);
tRow.Cells.Add(tCell);
当页面最初运行时,ImageButton使用正确的图像绘制光标=手等。单击时,页面循环,Page_Load(子和主)加载,但是,当单步执行代码时,函数为ImageButton未运行。这是我难倒的地方。
帮助!!!
答案 0 :(得分:0)
好像你在
创建了一个图像的本地img else
{
var img = new Image();
img.ID = "imglil_image_" + i.ToString();
img.AlternateText = "Image " + i.ToString();
img.ImageUrl = strlil_image_1;
img.Width = 40;
img.Height = 40;
tCell.Controls.Add(img);
}
tRow1.Cells.Add(tCell);
break;
然后休息?永远不会分配事件。在其他人之前的条件是否真的是真的吗?