CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 1 of 1

Hybrid View

  1. #1
    Join Date
    Jan 2008
    Posts
    47

    AJAX feature not working in existing project

    I statred one asp.net 2.0 project as AJAX ENABLED WEBSITE

    designed some forms all woroked in expected lines.

    now the forms working but without partial updates, means postback controls pressed inside update panel causes the entire page refreshed

    here is the sample code in page (just example)

    Code:
    <%@ 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">
    
    <script runat="server" language="vb" > 
    
    Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
    
    Dim theTime As String = DateTime.Now.ToLongTimeString()
    
    Dim i As Integer
    
    For i = 1 To 2
    
    theTime += "<br/>" + theTime
    
    Next
    
    time1.Text = theTime
    
    time2.Text = theTime
    
    End Sub
    
    </script>
    
    <html xmlns="http://www.w3.org/1999/xhtml" >
    
    <head id="Head1" runat="server">
    
    <title>Basic Update Panel</title>
    
    </head>
    
    <body>
    
    <form id="form1" runat="server">
    
    <div>
    
    <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
    
    <asp:Label runat="server" ID="time1"></asp:Label><br/><br/>
    
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
    
    <ContentTemplate>
    
    <div style="border-style:solid;background-color:gray;">
    
    <asp:Label runat="server" ID="time2"></asp:Label>
    
    <asp:Button ID="Button1" runat="server" Text="Inside Button 1" />
    
    </div><br/>
    
    </ContentTemplate>
    
    </asp:UpdatePanel>
    
    <asp:Button ID="Button2" runat="server" Text="Outside Button" /> 
    
    </form>
    
    </body>
    
    </html>
    but the same code working in a new project in the same machine

    what went wrong with my original project
    Last edited by PeejAvery; September 16th, 2008 at 02:25 PM. Reason: Added code tags.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured