Showing posts with label html. Show all posts
Showing posts with label html. Show all posts

Wednesday, March 28, 2012

UpdateProgress problem with December CTP

Hi, can someone please tell me why the UpdateProgress doesn't apear?

<%@dotnet.itags.org. Page Language="C#" %
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
<script runat="server">
protected void Page_Load(object sender, EventArgs e) {
btn.Click += new EventHandler(btn_Click);
}

void btn_Click(object sender, EventArgs e) {
System.Threading.Thread.Sleep(1000);
}
</script
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<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" EnablePartialRendering="true" runat="server" />
<div>
<asp:UpdatePanel ID="up1" runat="server">
<Triggers>
<asp:AsyncPostBackTrigger EventName="Click" ControlID="btn" />
</Triggers>
<ContentTemplate>
<%= DateTime.Now.ToString() %>
</ContentTemplate>
</asp:UpdatePanel>
<asp:Button ID="btn" runat="server" Text="Button" />
<asp:UpdateProgress ID="progress" runat="server" AssociatedUpdatePanelID="up1">
<ProgressTemplate>
<span>Loading...</span>
</ProgressTemplate>
</asp:UpdateProgress>
</div>
</form>
</body>
</html>

Hey :)

is this a known problem or I'm doing something wrong?


I've readthis post but this is not what I want. I want every update panel on my page to have it's own update progress. Something like this:

<%@. Page Language="C#" %
<script runat="server">

protected void Page_Load(object sender, EventArgs e)
{
btn1.Click += new EventHandler(btn_Click);
btn2.Click += new EventHandler(btn_Click);
}

void btn_Click(object sender, EventArgs e)
{
System.Threading.Thread.Sleep(1000);
}

</script
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">

<asp:ScriptManager ID="ScriptManager1" runat="server" />

<asp:Button ID="btn1" runat="server" Text="Btn1" />

<asp:UpdatePanel ID="up1" runat="server" UpdateMode="Conditional">
<Triggers>
<asp:AsyncPostBackTrigger ControlID="btn1" EventName="Click" />
</Triggers>
<ContentTemplate>
<asp:Panel ID="panel1" runat="server" style="background-color:#ccc;">
<%= DateTime.Now.ToString() %>
</asp:Panel>
</ContentTemplate>
</asp:UpdatePanel
<asp:UpdateProgress ID="uProgress1" AssociatedUpdatePanelID="up1" runat="server">
<ProgressTemplate>
<span>Loading panel 1</span>
</ProgressTemplate>
</asp:UpdateProgress
<br /
<asp:Button ID="btn2" runat="server" Text="Btn2" /
<asp:UpdatePanel ID="up2" runat="server" UpdateMode="Conditional">
<Triggers>
<asp:AsyncPostBackTrigger ControlID="btn2" EventName="Click" />
</Triggers>
<ContentTemplate>
<asp:Panel ID="panel2" runat="server" style="background-color:red;">
<%= DateTime.Now.ToString() %>
</asp:Panel>
</ContentTemplate>
</asp:UpdatePanel
<asp:UpdateProgress ID="uProgress2" AssociatedUpdatePanelID="up2" runat="server">
<ProgressTemplate>
<span>Loading panel 2</span>
</ProgressTemplate>
</asp:UpdateProgress
<div>
</div>
</form>
</body>
</html

How to make this work? And the trigger buttons to be outsite the update panels...

10x


I've just read that :)

You can associate theUpdateProgress control with a singleUpdatePanel control by setting the progress control'sAssociatedUpdatePanelID property. In that case, theUpdateProgress control displays a message only when a postback originates inside the associatedUpdatePanel control.

sorry :)

Monday, March 26, 2012

Updating ContentPlaceHolder using UpdatePanel(like using frames)

Hi guys,

Is there a way to update the whole Content page without master page refreshing it self? like same effect as using frames or iframes in html.

I tried following, just simply placing script manager and wrapping ContentPlaceHolder with UpdatePanel, which didn't work.

Any suggestions?


<%@dotnet.itags.org. Master Language="C#" AutoEventWireup="true" CodeFile="Site.master.cs" Inherits="Site" %>
<html>
<head runat="server">
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager" runat="server"></asp:ScriptManager>
<div id="main"
<div id="titleBar">Title</div>

<div id="siteMenu">
<asp:Menu ID="Menu1" runat="server" SkinID="MenuBar" DataSourceID="SiteMapDataSource1" OnMenuItemClick="Menu1_MenuItemClick">
</asp:Menu>
</div>


<div id="content">

<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate
<asp:contentplaceholder id="contents" runat="server"></asp:contentplaceholder>


</ContentTemplate>
</asp:UpdatePanel>
</div>


<div id="footer">footer</div
</div
<asp:SiteMapDataSource ID="SiteMapDataSource1" runat="server" />
</form>
</body>
</html>



Sorry to say that master pages and AJAX don't work together in that fashion (seehttp://odetocode.com/Blogs/scott/archive/2007/01/03/9682.aspx).

There are lots of ways to refresh the content inside of the page using AJAX, but what you are trying to do requires the browser to load an entirely new page. :/


Thanks Scott.

I won't be wasting any more time trying to figure that one out.

Guess I am back to using good old Iframe.

Cheers

Dosa.

Wednesday, March 21, 2012

URL rewriting not working with ATLAS ( AJAX 1.0 )

Hello All,

I am doing a URL rewrite with help of Scott Mitchell's URL rewrite module. I am redircting all requests from abc.aspx to abc.html. This is working fine for me on normal aspx pages.

But when I am using AJAX v 1.0 on one page. I am not getting the AJAX behavior when page is request by URL rewrite .

Example I have a updatepanel on xyz.aspx. When I access that page bu url http://mysite/xyz.aspx all is working fine. But when I access page by URL http://mysite/xyz.html (for URL rewrite to work ) . AJAX is not working.

Any Ideas ??

Thanks

An ASPX page only works when served through the appropriate ISAPI filter. By changing the filetype, you're actually changing how the server will handle the file. Open IIS, right click your application and choose "Properties" Click on the "Configuration" button under Application Settings section. Add an entry for .html that mirrors the settings found for .aspx. That should force IIS to treat your renamed .html file as an ASPX page.

Hope this helps,

-Tony


Hello Tony,

We are doing that. All extensions are configured to be handled by ASP.NET worker process.

I think I need to check web.config for Ajax web services.

Thanks for reply