locked
Ajax ConfirmButtonExtender Control disappears on selecting TargetControlID RRS feed

  • Question

  • User2431218 posted

    Hey Friends, I am mess up with unusual problem. I never experienced this problem with 2010.

    On VS 2012 with Ajax 4.5 - ConfirmButtonExtender is giving a problem. When I assign it a TargetControlID on Propert Page, it disappears from Design Page. Not an issue as I updated its properties in a source window by writing hard code.

    Now, the problem is when I run application, it does not work and does not show expected results. To make my point clear, I am writing here a simple code, which seems to be correct.

        <form id="form1" runat="server">
        <div>
            <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
            <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
            <asp:Button ID="Button1" runat="server" Text="Button" />
            <ajaxToolkit:ConfirmButtonExtender ID="ConfirmButtonExtender1" runat="server" ConfirmOnFormSubmit="True" ConfirmText="Are you Sure?" TargetControlID="Button1" ></ajaxToolkit:ConfirmButtonExtender>
        </div>
        </form>



    When I remove TargetControlID property, the control is then visible on design page. Kindly help.

    Tuesday, November 5, 2013 1:34 PM

Answers

  • User-417640953 posted

    Hi,

    Thanks for your response.

    Visual Studio 2012 supports .net framework 4.5. Please make sure your application is using the 4.5 version in Visual Studio 2012 .

    Right click your application =>Properties =>Application =>Target framework.

     

    Thanks.

    Best Regards!

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, November 12, 2013 8:21 PM
  • User555306248 posted

    Hi,

    Using <asp:ToolkitScriptManager instead of <asp:ScriptManager. The details should be like this:

    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="test4.aspx.cs" Inherits="test4" %>
    
    
    <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title></title>
    </head>
    <body>
        <form id="form1" runat="server">
        <div>
            <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
            </asp:ToolkitScriptManager>
            <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
            <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
            <asp:Button ID="Button1" runat="server" Height="26px" OnClick="Button1_Click" Text="Button" />
            <br>
            <asp:ConfirmButtonExtender ID="Button1_ConfirmButtonExtender" runat="server" ConfirmText="Are you sure???"
                Enabled="True" TargetControlID="Button1">
            </asp:ConfirmButtonExtender>
        </div>
        </form>
    </body>
    </html>

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, November 13, 2013 11:05 PM

All replies

  • User-417640953 posted

    Hi ashmanmalhotra,

    Thank you for posting to asp.net forum.

    According to your description and code, I can reproduce the scenes.

    This is a feature of visual studio 2012. In my mind, the ConfirmButtonExtender is used for button or link controls.

    We can set its property TargetControlID to assign the living control. Think that, if we assign the target control. It is need not to show

    ConfirmButtonExtender in the design page.

    http://www.asp.net/ajaxLibrary/AjaxControlToolkitSampleSite/ConfirmButton/ConfirmButton.aspx

     

    Hope this helps. Thanks.

    Best Regards!

     

     

    Thursday, November 7, 2013 12:58 AM
  • User1432699632 posted

    Hello,

    You should go through this link, I think it will help you.

    http://www.asp.net/ajaxLibrary/AjaxControlToolkitSampleSite/ConfirmButton/ConfirmButton.aspx

    Thanks.

    Regards

    Neeraj Purohit

    Thursday, November 7, 2013 1:06 AM
  • User2431218 posted

    Dear Neeraj,

    Thank you for writing reply to my query.

    I know how to use Ajax ConfirmButtonExtender Control and I have been using it with previous versions like 2005, 2008 and infact 2010 without any error. This time, I am facing very unusual error, which you probably did not understand in my query.

    What I asked is that I am now moved to VS2012 and installed recent Ajax Toolkit (for VS 2012 - 4.5) and it is giving strange issues while using some of the Ajax controls. On of them is ConfirmButtonExtender. When I assign TargetControlID to the ConfirmButtonExtender (e.g. TargetControlID="Button1"), the control disappear from Design Page but I can see it in Code Page. No Problem, if it disappears from Design Page but It should do what is expected from it. It does not perform Confirm Action during the program execution. It does not show confirm window.

    When I got fed up after working for an hours to solve this issue (as I was using this feature with my application), I removed Ajax 4.5 version and used the older DLL, which worked perfectly fine for me. However, the control get disappeared from Design on assiging TargetID but it works perfectly fine when WebPage is executed.

    I hope that I elaborated it very good understandable piece.

    Regards,

    Ashman.

    Thursday, November 7, 2013 3:04 AM
  • User2431218 posted

    Dear Friend,

    Thank you for writing reply to my query.

    I know how to use Ajax ConfirmButtonExtender Control and I have been using it with previous versions like 2005, 2008 and infact 2010 without any error. This time, I am facing very unusual error, which you probably did not understand in my query.

    What I asked is that I am now moved to VS2012 and installed recent Ajax Toolkit (for VS 2012 - 4.5) and it is giving strange issues while using some of the Ajax controls. On of them is ConfirmButtonExtender. When I assign TargetControlID to the ConfirmButtonExtender (e.g. TargetControlID="Button1"), the control disappear from Design Page but I can see it in Code Page. No Problem, if it disappears from Design Page but It should do what is expected from it. It does not perform Confirm Action during the program execution. It does not show confirm window.

    When I got fed up after working for an hours to solve this issue (as I was using this feature with my application), I removed Ajax 4.5 version and used the older DLL, which worked perfectly fine for me. However, the control get disappeared from Design on assiging TargetID but it works perfectly fine when WebPage is executed.

    I hope that I elaborated it very good understandable piece.

    Regards,

    Ashman.

    Thursday, November 7, 2013 3:05 AM
  • User-417640953 posted

    When I assign TargetControlID to the ConfirmButtonExtender (e.g. TargetControlID="Button1"), the control disappear from Design Page but I can see it in Code Page. No Problem, if it disappears from Design Page but It should do what is expected from it. It does not perform Confirm Action during the program execution. It does not show confirm window.

    Hi,

    Thanks for your response.

    # For the ConfirmButtonExtender control disappear when assigned TargetControlID , it is normal in visual studio 2012 design page.

    # For using AJAX Control Toolkit .NET 4.5, it is works perfectly with .net 4.5 application. Please make sure your application version is 4.5.

    http://ajaxcontroltoolkit.codeplex.com/releases/view/112805

    Thanks.

     

    Best Regards!

    Thursday, November 7, 2013 8:12 PM
  • User2431218 posted

    I am using correct versions. As I said already that I am using Visual Studio 2012 (which is 4.5) along with Ajax 4.5 compatible version(latest), where is the point of mistmatch.

    I also added that I have tried using 4.0 Ajax as well but did not helped me. Now, I am using Ajax version which was introduced for .Net 2.0 and it is working fine.

    Monday, November 11, 2013 12:17 PM
  • User-417640953 posted

    Hi,

    Thanks for your response.

    Visual Studio 2012 supports .net framework 4.5. Please make sure your application is using the 4.5 version in Visual Studio 2012 .

    Right click your application =>Properties =>Application =>Target framework.

     

    Thanks.

    Best Regards!

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, November 12, 2013 8:21 PM
  • User555306248 posted

    Hi,

    Using <asp:ToolkitScriptManager instead of <asp:ScriptManager. The details should be like this:

    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="test4.aspx.cs" Inherits="test4" %>
    
    
    <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title></title>
    </head>
    <body>
        <form id="form1" runat="server">
        <div>
            <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
            </asp:ToolkitScriptManager>
            <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
            <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
            <asp:Button ID="Button1" runat="server" Height="26px" OnClick="Button1_Click" Text="Button" />
            <br>
            <asp:ConfirmButtonExtender ID="Button1_ConfirmButtonExtender" runat="server" ConfirmText="Are you sure???"
                Enabled="True" TargetControlID="Button1">
            </asp:ConfirmButtonExtender>
        </div>
        </form>
    </body>
    </html>

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, November 13, 2013 11:05 PM