Please help: Trouble with AJAX ModalPopupExtender

B

Bobby Edward

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
 
B

Bobby Edward

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!
 
B

bruce barker

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)
 
B

Bobby Edward

bruce barker said:
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'.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,228
Members
46,816
Latest member
nipsseyhussle

Latest Threads

Top