Help getting VWD to recognize AJAX controls

Last post 10-16-2009 2:59 PM by rogerbacon. 6 replies.

Sort Posts:

  • Help getting VWD to recognize AJAX controls

    09-23-2009, 11:31 PM
    • Member
      447 point Member
    • cyoung311
    • Member since 06-26-2007, 11:36 PM
    • Sunny Phoenix, Arizona, USA
    • Posts 153

    This note also posted in AJAX Control Toolkit...

    After much hassling and reloading AJAX and VWD 2005 Express, I'm back to having everything loaded correctly...I thought.  I'm trying to build an example from a book and the .cs has the following code for a ConfirmButtonExtender example:

     

    protected void gvItemsOnRowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                ((ConfirmButtonExtender)e.Row.FindControl("ConfirmButtonExtender2")).TargetID =
                    ((LinkButton)e.Row.FindControl("btnDelete")).ID;
            }
        }

    When I build the page I get an error in VWD saying:

    'ConfirmButtonExtender' does not contain a definition for 'TargetID'

    If I go to the .aspx page and go into source view I can add the 'TargetID' field from Intellisense but I can't address that field from the .cs page.  I'm assuming there is a config issue with VWD.  How do I fix this?

    Thanks in advance

    -Chuck

    Nullum gratuitum prandium
  • Re: Help getting VWD to recognize AJAX controls

    09-24-2009, 12:53 AM
    • Contributor
      5,626 point Contributor
    • b471code3
    • Member since 02-27-2007, 5:44 PM
    • SE Minnesota
    • Posts 1,154

    TargetId is not a property of the ConfirmButtonExtender, it should be TargetControlId. 

    View Brenden Kehren's LinkedIn profileView my profile
    Remember to mark as answer if this post answered your question or solved your problem.
  • Re: Help getting VWD to recognize AJAX controls

    09-24-2009, 1:23 AM
    • Member
      447 point Member
    • cyoung311
    • Member since 06-26-2007, 11:36 PM
    • Sunny Phoenix, Arizona, USA
    • Posts 153

    OK, I changed it to TargetControlID (stupid me) but now I get the message:

    'ConfirmButtonExtender' does not contain a definition for 'TargetControlID'

    What now?

    -Chuck

    Nullum gratuitum prandium
  • Re: Help getting VWD to recognize AJAX controls

    09-24-2009, 1:47 AM
    Answer
    • Participant
      1,402 point Participant
    • prashkumar22
    • Member since 03-31-2008, 4:01 AM
    • Chicago, IL
    • Posts 223

    I think you need to access it with the namespace, like

    ((AjaxControlToolkit.ConfirmButtonExtender)e.Row.FindControl("ConfirmButton")).TargetControlID=.........

    Then intellisense should show TargetControlID when you put a period(.)

    Prashant
  • Re: Help getting VWD to recognize AJAX controls

    09-24-2009, 9:06 AM
    • Member
      447 point Member
    • cyoung311
    • Member since 06-26-2007, 11:36 PM
    • Sunny Phoenix, Arizona, USA
    • Posts 153

    OK, that did the trick but why does intellisense offer that parameter as an option when I'm in the .aspx page but it does not recognize it as a parameter in the .aspx.cs page?

    Riddle me that one!

    -Chuck

    Nullum gratuitum prandium
  • Re: Help getting VWD to recognize AJAX controls

    09-24-2009, 3:19 PM
    • Contributor
      5,626 point Contributor
    • b471code3
    • Member since 02-27-2007, 5:44 PM
    • SE Minnesota
    • Posts 1,154

    Typically if you were going to use another namespace you would put a using or Includes statement at the top of your page or declare the full namespace like was shown above.  Intellisense must have been wrong. 

    View Brenden Kehren's LinkedIn profileView my profile
    Remember to mark as answer if this post answered your question or solved your problem.
  • Re: Help getting VWD to recognize AJAX controls

    10-16-2009, 2:59 PM
    • Member
      2 point Member
    • rogerbacon
    • Member since 10-16-2009, 2:55 PM
    • Miami
    • Posts 1

     

    Thank you! I had the same problem from the same book. In my case though intellisense was not popping up anything. I'm using VS 2008.

Page 1 of 1 (7 items)