I am very new to Ajax and unfortunately I was kind of thrown right into the middle of it. My predecessor created a webpage using Atlas and never finished it before he left and now I need to convert it to Ajax and get it finished. I am in the process of converting it but I have come across this one section of code that I cannot seem to figure out the conversion.
PublicSub SetConfirm(ByVal buttonAs LinkButton,ByVal TextAsString,ByVal ConfirmExtenderAs AtlasControlToolkit.ConfirmButtonExtender)ConfirmExtender.TargetProperties.Clear()
Dim propAsNew AtlasControlToolkit.ConfirmButtonPropertiesprop.ConfirmText = Text
prop.TargetControlID = button.ID
ConfirmExtender.TargetProperties.Add(prop)
EndSub
If I change AtlasControlToolkit.ConfirmButtonExtender to AjaxControlToolkit.ConfirmButtonExtender like VS2005 recomends it underlines ConfirmExtender.TargetProperties in blue as well asAtlasControlToolkit.ConfirmButtonProperties. I expectedAtlasControlToolkit.ConfirmButtonProperties to be underlined but the suggested alternates don't match. I get the following options:
AjaxControlToolkit.ConfirmButtonExtenderAjaxControlToolkit.AnimationScripts
AjaxControlToolkit.ToggleButtonExtender
I would assume the first one but it when I go to fix ConfirmExtender.TargetProperties it does give me any thing even remotely close to TargetProperties.
PublicSub SetConfirm(ByVal buttonAs LinkButton,ByVal TextAsString,ByVal ConfirmExtenderAs AjaxControlToolkit.ConfirmButtonExtender)
ConfirmExtender.TargetProperties.Clear()
Dim propAsNewAjaxControlToolkit.ConfirmButtonExtenderprop.ConfirmText = Text
prop.TargetControlID = button.ID
ConfirmExtender.TargetProperties.Add(prop)
EndSub
It might be the way it is being used in the *.ascx page. Here is the code:<asp:ImageID="Image7"runat="server"ImageUrl="~/Images/optionbullet_Lightblue-gray.gif"/>
<asp:LinkButtonID="LBtnDelete"runat="server"Text="Delete"/>
<cc1:ConfirmButtonExtenderID="LbtnDeleteExtender"runat="server"/>
Thanks in advance for the help.
Hi, check this link how to configure AJAX in web.config
http://ajax.asp.net/docs/ConfiguringASPNETAJAX.aspx
You want to set the TargetControlID and ConfirmText properties. You can set that in the markup, e.g:
<cc1:ConfirmButtonExtender ID="LbtnDeleteExtender" runat="server"
TargetControlID="LBtnDelete" ConfirmText="..." />
or in code:
LbtnDeleteExterder.TargetControlID = LBtnDelete.ID;
LbtnDeleteExtenderConfirmText = "...";
Have you configure your application for AJAX..
Post it on forum, if solved your problem.
Hi,
as Scott suggested, you should set the TargetControlID and ConfirmText properties on the Extender instance. You have to get rid of TargetControlProperties instances.
Back to the "Atlas" times, a single Extender instance could be bound to multiple server controls. To do that, you had to declare multiple TargetControlProperties instances as children of the Extender instance. Each TargetControlProperties had the purpose of configuring the Extender functionality for a given server control.
Now, an Extender is associated to only one server control. Therefore, all the configuration job is done in the Extender instance. The TargetControlID property specifies the ID of the extended server control.
No comments:
Post a Comment