Please help: Trouble with AJAX ModalPopupExtender

Discussion in 'ASP .Net' started by Bobby Edward, Oct 8, 2008.

  1. Bobby Edward

    Bobby Edward Guest

    I had a simple admin form for "Categories"...

    Details View: To INSERT new Category
    Grid View: To View, Edit and Delete all Categories

    I decided to put the INSERT Details View inside of a ModalPopupExtender.

    PROBLEM 1:
    Dragging a ModalPopupExtender control to my webform gives me a gray box in
    Design View:
    Error Creating Control - ModalPopupExtender1
    Unknown server tag 'ajaxToolkit:ModalPopupExtender'.

    Any idea why? I registered it at the top of the page (by the way this page
    is referencing a master page):
    <%@ Page Title="" Language="VB" MasterPageFile="~/membersonly/member.master"
    AutoEventWireup="false"
    CodeFile="managefaqs.aspx.vb" Inherits="admin_managefaqs" %>
    <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit"
    TagPrefix="ajaxToolkit" %>

    PROBLEM 2:
    The pop up actually comes up. But, when I type in a new category and hit
    "insert" on the detailsview I get this error:
    "Databinding methods such as Eval(), XPath(), and Bind() can only be used in
    the context of a databound control."

    It's for this line:
    <InsertItemTemplate>
    <asp:DropDownList ID="DropDownList1" runat="server"
    DataSourceID="odsCategories"
    DataTextField="Category" DataValueField="CategoryId"
    SelectedValue='<%# Bind("FaqCategoryId") %>'>
    </asp:DropDownList>
    </InsertItemTemplate>

    Any idea why? It used to work before I tried putting it in a modal...

    QUESTION 3
    Any idea how I can refresh the datagrid on the main form after I insert a
    new category with the ajax modal?

    Thanks
     
    Bobby Edward, Oct 8, 2008
    #1
    1. Advertising

  2. Bobby Edward

    Bobby Edward Guest

    I figured out the issues... I'll post it to help others...

    > PROBLEM 1:
    > Dragging a ModalPopupExtender control to my webform gives me a gray box in
    > Design View:
    > Error Creating Control - ModalPopupExtender1
    > Unknown server tag 'ajaxToolkit:ModalPopupExtender'.
    >
    > Any idea why? I registered it at the top of the page (by the way this
    > page is referencing a master page):


    I took the Script Manager OUT OF the Master Page and put it in the page
    itself. This fixed the problem.

    > PROBLEM 2:
    > The pop up actually comes up. But, when I type in a new category and hit
    > "insert" on the detailsview I get this error:
    > "Databinding methods such as Eval(), XPath(), and Bind() can only be used
    > in the context of a databound control."
    >


    This was a problem that was not related to the modal control. DUH! :(

    > QUESTION 3
    > Any idea how I can refresh the datagrid on the main form after I insert a
    > new category with the ajax modal?


    It seems to refresh it automatically. This stuff is awesome!
     
    Bobby Edward, Oct 8, 2008
    #2
    1. Advertising

  3. Bobby Edward

    bruce barker Guest

    you don't need to move the script manger out of the master. there is a script
    manager proxy you can add in the content page if you need a reference to the
    master pages.

    -- bruce (sqlwork.com)


    "Bobby Edward" wrote:

    > I figured out the issues... I'll post it to help others...
    >
    > > PROBLEM 1:
    > > Dragging a ModalPopupExtender control to my webform gives me a gray box in
    > > Design View:
    > > Error Creating Control - ModalPopupExtender1
    > > Unknown server tag 'ajaxToolkit:ModalPopupExtender'.
    > >
    > > Any idea why? I registered it at the top of the page (by the way this
    > > page is referencing a master page):

    >
    > I took the Script Manager OUT OF the Master Page and put it in the page
    > itself. This fixed the problem.
    >
    > > PROBLEM 2:
    > > The pop up actually comes up. But, when I type in a new category and hit
    > > "insert" on the detailsview I get this error:
    > > "Databinding methods such as Eval(), XPath(), and Bind() can only be used
    > > in the context of a databound control."
    > >

    >
    > This was a problem that was not related to the modal control. DUH! :(
    >
    > > QUESTION 3
    > > Any idea how I can refresh the datagrid on the main form after I insert a
    > > new category with the ajax modal?

    >
    > It seems to refresh it automatically. This stuff is awesome!
    >
    >
    >
     
    bruce barker, Oct 8, 2008
    #3
  4. Bobby Edward

    Bobby Edward Guest

    "bruce barker" <> wrote in message
    news:...
    > you don't need to move the script manger out of the master. there is a
    > script
    > manager proxy you can add in the content page if you need a reference to
    > the
    > master pages.
    >
    > -- bruce (sqlwork.com)
    >


    When I did that it fixed the problem. But it later came back. Any idea
    why?

    Dragging a ModalPopupExtender control to my webform gives me a gray box in
    Design View:
    Error Creating Control - ModalPopupExtender1
    Unknown server tag 'ajaxToolkit:ModalPopupExtender'.
     
    Bobby Edward, Oct 8, 2008
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. xeroxero
    Replies:
    0
    Views:
    782
    xeroxero
    Dec 7, 2006
  2. Replies:
    1
    Views:
    1,685
    Bruce Barker
    Jan 8, 2007
  3. jondack
    Replies:
    0
    Views:
    2,135
    jondack
    Nov 11, 2010
  4. Replies:
    1
    Views:
    5,020
  5. Heron
    Replies:
    0
    Views:
    3,856
    Heron
    May 3, 2008
Loading...

Share This Page