Showing posts with label existing. Show all posts
Showing posts with label existing. Show all posts

Wednesday, March 28, 2012

PageMethods dont regenerate on file change?

If I define a new page method or change an existing page method I have to restart my dev asp.net server to see the change in the generated javascript (page prototype)? anyone else having this problem?

thanks

Hi,

Without any valuable information, it is hard to say where the problem lies on.

Please provide any more information,eg. any code of this.

Thanks!


Hi Craigw,

It seems like a cache issue rather than a IIS issue. So I suggest you to save your web.config file without any modifications and have a test. If it works, we can confirm it.

Also you can delete all the cache file or do the following steps. open the IE -->Tools-->Internet Options-->General Dialog-->Browswer History-->Settings-->select "Every time I visit the webpage".

I hope this help. If it doesn't work, please feel free to let me know with more information.

Best regards,

Jonathan


This problem has been quite annoying for some time. Can you please confirm if it has been identified and whether a fix will be available?

It happens on the server (Win 2003 R2) as well as on developer PCs (Cassini). Restarting the web server does the trick as well as re-saving web.config. It's quite easy to reproduce (and yes, I have enbaled PageMethods in the ScriptService tag...)

Saturday, March 24, 2012

Paging a GridView with CSS Friendly Adapters causes a total postback with AJAX Beta1

Hello,

I have upgraded an existing project (Atlas CTP) to the Atlas Beta1 and encountered a problem with a GridView inside an UpdatePanel. I am using theCSS Friendly ASP.NET 2.0 Control Adapters for the GridView and paging the results causes a total postback instead of partial. Here's my code:

<%@dotnet.itags.org. Page Language="C#" AutoEventWireup="true" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><script runat="server"> private System.Collections.Generic.List<string> GetList() { System.Collections.Generic.List<string> list = new System.Collections.Generic.List<string>(); for (int i = 0; i < 100; i++) { list.Add("item " + i.ToString()); } return list; } protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { ResultsGrid.DataSource = GetList(); ResultsGrid.DataBind(); } } protected void ResultsGrid_PageIndexChanging(object sender, GridViewPageEventArgs e) { ResultsGrid.PageIndex = e.NewPageIndex; ResultsGrid.DataSource = GetList(); ResultsGrid.DataBind(); }</script><html xmlns="http://www.w3.org/1999/xhtml" ><head id="Head1" runat="server"> <title>Untitled Page</title></head><body> <form id="form1" runat="server"> <asp:ScriptManager ID="ScriptManager1" runat="server" /> <div> <asp:UpdatePanel ID="Updaty" runat="server"> <ContentTemplate> <asp:GridView id="ResultsGrid" runat="server" PageSize="10" AllowPaging="true" OnPageIndexChanging="ResultsGrid_PageIndexChanging" /> </ContentTemplate> </asp:UpdatePanel> </div> </form></body></html>

Using the Atlas CTP the same code caused a partial postback when paging the GridView. Any ideas?

Regards,
Darin

One way around this is to add a trigger to the UpdatePanel for the PageIndexChanging event.

<Triggers>
<asp:AsyncPostBackTrigger ControlID="ResultsGrid" EventName="PageIndexChanging" />
</Triggers>

I tried this and it seem to then update the panel incrementally as expected.


I posted a fix here...http://forums.asp.net/thread/1442598.aspx