0

I have that works fine without Script manager. but if I add script manager that getting an error: sys undefined.

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Block-ui-pageload.aspx.cs" Inherits="Block_ui_pageload" %>

<%@ Register Assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
    Namespace="System.Web.UI" 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 id="Head1" runat="server">
    <title></title>
    <script src="Scripts/jquery-1.3.2.js" type="text/javascript"></script>
    <script src="Scripts/jquery.blockUI.js" type="text/javascript"></script>
</head>
<body>
    <form id="form1" runat="server">
        <div id="divConfirmBox1">
            <asp:GridView ID="gvCategories" runat="server" AutoGenerateColumns="false">
                <Columns>
                    <asp:TemplateField HeaderText="Category Name">
                        <ItemTemplate>
                            <asp:Label ID="lblCategoryName" runat="server" Text='<%# Eval("CategoryName") %>' />
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField>
                        <ItemTemplate>
                            <input type="button" value="Delete" onclick="showDeleteConfirmation('<%# Eval(" CategoryId")=CategoryId") %=% />')" />
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
            </asp:GridView>
            &nbsp;
            <div id="divConfirmBox" style="display:none">
                Are you sure you want to delete this record?
                <input type="button" value="No" />
            </div>
        </div>
    </form>
</body>
</html>

<script language="javascript" type="text/javascript">
    $(function () {
        $('#divConfirmBox1').block({ message: $('#divConfirmBox') });
    });

    $(function () {
        $('#divConfirmBox').click(function (event) {
            $('#divConfirmBox1').unblock();
        });
    });
</script>

initially during the page load . I am blocking the screen(PAge). once the user clicks the button the page is unblocked. is there anything wrong in the Syntax whiling working with Ajax script manager

1
  • 1
    You don't have any Ajax code here. Commented Aug 30, 2009 at 8:05

4 Answers 4

1

You should move the jQuery code into $(document).ready. I suspect you're preventing certain scripts from loading appropriately by running the code inline rather than in .ready. I'm running the same version of jQuery (but not UI block) with ScriptManager in 3.5 right now, no prob.

Sign up to request clarification or add additional context in comments.

Comments

1

AJAX is not a thing - its a bunch of technologies put together to achieve asynchronous communication. Yes, you have some JavaScript coding in there, but none of them actually do anything 'ajaxian' - a good example of something really AJAX-style would be an validation of a (registration) form or something like that. You'd set some oberservers for some fields and validate them whilst the user is still making inputs on other fields...

Comments

0

I think what you're looking for is noConflict. It's been a while since I've used asp.net ajax but if I'm not mistaken, there is a $ function defined.

Comments

0

In the web.config we need to add the follwing code within tag.

then the problem was solved
every thing was working fine

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.