views:

149

answers:

4

hi i have that works finw without Script manager. but if i add script manager that getting an erroe: sys udefined.

<%@ 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"&gt;



<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") %>')" />
    </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>

. intially during the page load . i am blocking the screen(PAge). once the user clicks the button the page is unblocked. is there anythng wrong in the Syantax whiling working with Ajax script manager

A: 

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.

Andy Gaskell
+1  A: 

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.

andrewbadera
+1  A: 

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...

Gnark
A: 

hi

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

then the problem was solved
every thing was working fine

prince23