SideBarTemplateを使用してOnItemDataBoundイベントを捕捉する方法については、ASP.Netのウィザードコントロールの外観をカスタマイズして遊んでいます。すべてかなり簡単です。私が今やりたいことは、レンダリングされたLinkButtonのテキストを変更して、現在のステップのためにステップ名に ">>"のような名前を付けることです。ASP.NetウィザードのサイドバーテンプレートのLinkButtonタイトルの設定
ので、SideBarListのための私のItemDataBoundイベントハンドラで、私は次のコードを持っている:
Dim stepCurrent As WizardStep = e.Item.DataItem
Dim linkCurrent As LinkButton = e.Item.FindControl("SideBarButton")
If Not stepCurrent Is Nothing Then
Trace.Write("SideBar", "Current Step = " & stepCurrent.Wizard.ActiveStep.Name)
Trace.Write("Sidebar", "Link Button = " & linkCurrent.Text)
linkCurrent.Enabled = False
If stepCurrent.Wizard.ActiveStepIndex = e.Item.ItemIndex Then
linkCurrent.Style.Add(HtmlTextWriterStyle.Color, "#000000")
linkCurrent.Style.Add(HtmlTextWriterStyle.FontWeight, "bold")
linkCurrent.Text.Insert(0, ">> ")
End If
End If
しかし、私が見つけることであるトレース出力がlunkbuttonテキストの空の文字列を示しているが、スタイルを変更作業。
私は間違った場所にテキストを設定しようとしていますか?
おかげ