The scenario is this. I have a customisable form to which custom buttons can be added to the toolbar using an admin tool. I use this code in the Page_Load to create each button (it's run in a loop) when the page is first loaded. Viewstate is enabled on the toolbar.
Dim newButton As New UltraWebToolbar.TBarButton newButton.Text = cfb.Label newButton.Key = cfb.ControlID Select Case cfb.Type Case CustomFormButtonConfig.ButtonType.CallStoredProc newButton.Images.DefaultImage.Url = "../Icons/16x16/data_gear.gif" newButton.Images.DisabledImage.Url = "../Icons/16x16/data_gear.gif" Case CustomFormButtonConfig.ButtonType.OpenURL newButton.Images.DefaultImage.Url = "../Icons/16x16/earth_view.gif" newButton.Images.DisabledImage.Url = "../Icons/16x16/earth_view.gif" End Select newButton.ToolTip = cfb.ToolTip newButton.Enabled = cfb.IsEnabled(_currentEntry) tbMain.Items.Insert(8 + posCount, newButton)
When the page does a postback the button remains but the image is completely lost and does not display next to the text. This did work in 2006v2 (we are in the process of upgrading to .Net 3.5 and 2008v1).
Does anyone have a workaround or will this be a hotfix job?
Cheers,
Paul
Hi, instead of
Dim newButton As New UltraWebToolbar.TBarButton
try
Dim newButton As tbMain.AddButton( cfb.Label, cfb.ControlId)