Showing posts with label atlas. Show all posts
Showing posts with label atlas. Show all posts

Wednesday, March 28, 2012

Page.IsCallback equivalent

What is the Atlas equivalent to the value returned by Page.IsCallback?

As I understand it, since the call is just an intercepted postback, Page.IsPostBack will be True on an Atlas callback. I don't think there is a way to tell if you're dealing with a "True" PostBack or a callback, but I also don't think the event could be called more than one way, so if you need to check later on in your code how you got to where you are, set a member variable in the event handler.


ScriptManager.GetCurrent(Page).IsInPartialRenderingMode

Thanks folks. I had noticedIsInPartialRenderingMode and found it seems to do the job. I do need a definitive answer as it affects how I create my products. Can anyone of the Atlas team chime in?


hello.

as you can see, i'm not in the atlas team. however, i'd like to confirm Rama's answer. btw, currently, a partial postaback is identified by a header called delta which has its value set to true during a partial postback. during the init event, the scriptmanager control looks for that header, and when it has the value true, it initializes the _inPartialRenderingMode field which is used to "feed" the result of the IsInPartialRenderingMode property.

Page.Redirect From Control Event Using Atlas

I am a newbie in atlas..just a couple of hour of experience.

I've managed to create a simple project with sucess, and all works well. But, in a certain event of an treeview control, the "SelectedNodeChanged", i need to redirect the page to another URL. The Page.Redirect runs it the server, but the page doesn't do the postback. How can i force the postback, in a certain event?

Thank you very much.

Well...i found out that the Page.Redirect in Atlas doesn't work very well.

I've got this solution, it's not the best way to do this, but it works,

Page.ClientScript.RegisterStartupScript(this.GetType(),"redirect",@."window.location.href='default.aspx';",true)

PageMethods

Hi,

I ama developing web application using ASP.NET, and I use atlas framework in my app. I have a problem with using PageMethods, I want to return value which came from page to another javascript but I can not,

Normal Page Method usage

function sayHelloFromPage() {

PageMethods.HelloWorld('Mehmet',onComplete);

}

function onComplete(result) {

}

what I wantto make it

functioncallSayHelloFromPage() {

var Result = sayHelloFromPage();

}

function sayHelloFromPage() {

PageMethods.HelloWorld('Mehmet',onComplete);

}

function onComplete(result) {

return result;

}

Hi

PageMethods.HelloWorld('Mehmet',onComplete);

The above call happens asynchronously, which means the call is send to the server and the client does not wait for the call to complete; therefore, you don't see the results immediately instead you have to get the results in the onComplete event, which is fired when the call completes.

Whatever you want to do with the results, e.g. change an HTML element, you have to do it in the onComplete function.

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

Paging gridview inside ATLAS tabcontrol

Hi, I have a dynamicly generated gridview control, inside a dynamically generated tab control. I am having trouble paging the gridview. I get a viewstate corrupted error message at the moment. My page setup is something like this:

Inside the page object, I have an update panel.

Inside the update panel, I have a tab container.

Inside the tab container, I have a number of tabs decided dynamically on page load. There will always be one tab, which doesnt contain a gridview, but there can be other tabs, each containing just a single control, a pageable gridview.

I suspect the fix involves wrapping the gridview in another update panel, which is inside the tab object itself, and triggering the update event for the panel when it needs to page.

Can anyone give me some advice, let me know if I am along the right lines?


Many thanks, Andrew Jones

please take alook at this:

http://forums.asp.net/p/1108841/1703584.aspx

Paging in GridView gets Object Expected Error

I have a grid in an update panel that gets databound at runtime (to index server results). I have implemented paging and it works without atlas. As soon as I place that grid in update panel, paging stops working. All I get is a javascript error saying "line 1 :Object Requiered".

I have tried debugging it but on paging, it doesn't event get to the server.

thanks

Hi Biren,

Have you tried this with the April CTP of Atlas that was released earlier this week?

If it's still a problem, can you please provide some more details on your scenario so that we can investigate?

Thanks,

Eilon


I have done it and it works for me. Object required is a pretty generic error just as the "Object reference not set to an..." in .Net. It could be because of wrong syntax in javascript or html that you might have on the page.

If you don't mind pasting the code on the forum please do so we can look at it.


Just tried it and same error.

here is the code:

<%@. Page Language="VB" AutoEventWireup="false" CodeFile="Index.aspx.vb" Inherits="Index" %>

<!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>Search</title>
<link href="http://links.10026.com/?link=Style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<atlas:ScriptManager EnablePartialRendering="true" ID="atlas1" runat="server" EnableViewState="true" />
<form id="frm1" runat="server">

<atlas:UpdateProgress ID="up11" runat="server" >
<ProgressTemplate >
<table>
<tr>
<th style="color:red">Please wait while your serach results are calculated...</th>
</tr>
<tr>
<td>
<img src="http://pics.10026.com/?src=images/spinner.gif" /></td>
</tr>
</table>

</ProgressTemplate>
</atlas:UpdateProgress>
<atlas:UpdatePanel ID="up1" Mode="conditional" runat="server" >
<ContentTemplate >



<table>
<tr>
<th>A word or phrase in the file: </th><td><asp:TextBox ID="txtsearch" runat="server" /></td>
</tr>
<tr>
<th>All or part of filename: </th><td><asp:TextBox ID="txtfilename" runat="server" /></td>
</tr>
<tr>
<th>When was it modified?:</th>
<td>
<asp:DropDownList ID="lstDuration" runat="server">
<asp:ListItem Text="Don't remember" Value="0" />
<asp:ListItem Text="Within the last week" Value="7" />
<asp:ListItem Text="Past Month" Value="30" />
<asp:ListItem Text="Within the past year" Value="365" />
</asp:DropDownList>
</td>
</tr>
<tr>
<td colspan="2"><asp:Button ID="btnSubmit" runat="server" Text="Search" /></td>
</tr>
</table>

<asp:GridView ID="grdResults" runat="server" CellPadding="4" ForeColor="#333333"
GridLines="None" AllowSorting="True" AllowPaging="True" PageSize="2" AutoGenerateColumns="False">
<Columns>
<asp:TemplateField HeaderText="Document Information">
<ItemTemplate>
<p>
<a href="http://links.10026.com/?link=<%# DataBinder.Eval(Container, "DataItem.path")%>">
<%# DataBinder.Eval(Container, "DataItem.Path")%>
</a>
<br />
<i>Last modified:
<%# DataBinder.Eval(Container, "DataItem.Write")%>
</i>
<br />
</p>
</ItemTemplate>
</asp:TemplateField>
</Columns>
<FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
<RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
<EditRowStyle BackColor="#999999" />
<SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
<PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
<HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
<AlternatingRowStyle BackColor="White" ForeColor="#284775" />
</asp:GridView>

</ContentTemplate>

</atlas:UpdatePanel>
</form>
</body>
</html>

Code behind:

Partial Class Index
Inherits System.Web.UI.Page

Protected Sub btnSubmit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSubmit.Click


' Bind DataGrid to the DataSet. DataGrid is the ID for the
' DataGrid control in the HTML section.
Dim source As New DataView(createDS.Tables(0))
grdResults.DataSource = source
grdResults.DataBind()

End Sub
Private Function createDS() As DataSet
Dim cnnOledb As New OleDb.OleDbConnection
Dim strQuery As String

Dim critstr As String = "(contains(filename,'.doc OR .xls OR .ppt OR .asp OR .aspx OR .txt'))"

If txtsearch.Text.Length <> 0 Then
critstr += " AND (contains(contents,'" + condition(txtsearch.Text) + "'))"
End If


strQuery = "Select DocTitle,Filename,VPath,Rank,Characterization,Write,path from SCOPE() where " + critstr + " order by write desc"

Dim connString As String = "Provider=MSIDXS;Data Source='o drive'"

Dim cn As New System.Data.OleDb.OleDbConnection(connString)
Dim cmd As New System.Data.OleDb.OleDbDataAdapter(strQuery, cn)
Dim objDS As New DataSet

cmd.Fill(objDS)

Return objDS
End Function

Function condition(ByVal srchstr As String) As String
Dim arr As String() = srchstr.Split(" ")
For i As Integer = 0 To arr.Length - 1
Dim str1 As String = arr(i)
If str1 <> "AND" And str1 <> "OR" And str1 <> "NOT" Then
arr(i) = "\" + str1 + "\"
End If
Next
Return String.Join(" AND ", arr)
End Function


Sub grdResults_PageIndexChanging(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewPageEventArgs) Handles grdResults.PageIndexChanging
grdResults.PageIndex = e.NewPageIndex
Dim source As New DataView(createDS.Tables(0))
grdResults.DataSource = source
grdResults.DataBind()

End Sub
End Class


Hi again,

I tried this out and I'm getting the same error. This turns out to be a known bug in the April CTP of Atlas. To work around it, add this code to your Page's Load event handler:

Page.ClientScript.GetPostBackEventReference(this, String.Empty);

Thanks,

Eilon


that works. Thank you. btw ATLAS ROCKS!!

Appears to be an issue in the June CTP too... and if it wasn't for this post, I'd still have the issue.

Thanks guys


Correct, this was not fixed in the June CTP. For now the one line workaround should still be sufficient.

Thanks,

Eilon


In the case of nested UserControls, does this workaround apply? If so, where should the workaround go?

I have a page which contains a UserControl, which in turn contains another UserControl, which contains a GridView wrapped in an UpdatePanel. I tried adding this line to the page's Page_Load and the UserControl's Page_Load, but I get the same generic error:

Line: 10846
Char: 17
Error: Object required
FYI, the offending line appears to be the second one pasted below:

function destroyTree(element, markupContext) {

if (element.nodeType == 1) {


Any ideas?

slp004, can you please give more details as to what you're trying to do? It sounds like other people on this thread have this scenario working so I'm curious what's going on here.

Thanks,
Eilon


I was never able to figure out exactly what the problem was, but by breaking the page up into a number of smaller pages sharing a single master page it started working again. There were just way too many UserControls inside GridView inside FormView inside UserControls inside View areas inside show/hide panels... you get the idea.

I have exactly the same problem - in the same line

 function destroyTree(element, markupContext) {if (element.nodeType == 1) {

My page have three or four levels of nested user controls inside the update panel. The curious thing is the page with the same controls has worked before some change I did - now I am trying to figure it out.


Wow, I figured out the issue.

The error was caused because I have another updatepanel in this page - inside a user control, included in master page. The user control has Visible=false. This scenario causes the error. When I set the user control visibility to true, the error goes off.

The solution is setting the updatepanel (that is inside the user control) mode to Conditional. This solves the problem even if the user control is invisible.

HTH.


I had the same problem and I set all the update panels to conditional and it worked.

Paging inside popup

First of all, congratulations for the good job done so far with atlas control toolkit.

Going strict, i have this on my code:

<UpdatePanel>
<page stuf... grids, buttons, etc... />
<Panel (for modal popup)>
<textbox to receive result from popup />
<button to involke popup />
</Panel (for modal popup>
<Panel (for popup)>
<GridView with paging />
</Panel (for popup)>
<UpdatePanel
everything is working just perfectly, but when page changes and DataBind is involked page reloads and go out of modal mode.

Paging is working... if i browse into the textbox that involkes the popup, the grid inside is in new page.

I've browsed this forum for answers but haven't found so far...

Regards

Any ideas? cause i got none :)

Regards,

Felipe Oquendo
MCAD


I'll try to be more specific.

if i have a gridview inside a popup and this popup inside a modal popup, can i use paging for gridview? cause when i do it, the whole page reloads and modal state goes off...

Regards,

Felipe Oquendo
MCAD


I think it is because the elements inside the update panel is refreshing. I would try changing the position of the update panel like so:

<asp:panel id="modalpopup" runat="server">

<atlas:updatepanel id="p1" runat="server">

<your grid here>

<your paging controls here>

</atlas:updatepanel>

</asp:panel>

You have the update panel wrapping everything, including the popup panel, if I'm not mistaken. Only wrap what needs updating via postback (like the gridview and the buttons)

You can even break out your paging buttons into their own update panels and use trigger on the gridview update panel.


I just posted that i didn't have a solution in another thread but BANG! it worked...

I'll need to study the engine i guess... the development is not yet that transparent and the concepts are not well defined...

Painting and mouse events in asp .net

Hello

I want to make a control like paint in windows by using Atlas. So I must to handle the mouse events in asp .net and can use Atlas. Do you have any knowledge or document about this? I could not find enough information until now. And for painting,is there any control or property in Atlas and AtlasControlToolkit

You'd be better off using Macromedia Flash for something like that.
Is not there any solution by using .NET?
Not really usingASP .NET, which is designed for web applications. What you want to achieve sounds far more suited to a stand-alone Windows forms application. You could use the .NET framework for that. I think you need to realise that web applications, that run on a remote server and support many clients via a browser, differ greatly from Windows client programs, that run on a location machine. The only way you can capture mouse events in ANY web application, written in any language, is via JavaScript or using browser-plugins (like Flash or ActiveX controls). Javascript, however, runs on the client and cannot easily talk back to the server were your .NET application is running. You can perhaps look at Ajax, but this would probably be too advanced, I think.

Hello,Thank you.

Is not there any solution by using Atlas. And what do you think about transfering sound. For example for a chat program which is prepared by asp .net, users can communicate by voice not only keyboards. Can you help me about

Panel in div with rounded corners grows beyond div height when using RoundedCorners

I had originally posted this in the Atlas forum by mistake. Sorry for the double post.

I am just learning CSS so forgive me if this is something simple but I have a div that has a height of 50px. If I add a panel to that div and set it's height to 100% without the rounded corner extender it fills the div as you would expect. When I add the rounded corner extender to the panel it grows to 142px. If I remove the RoundedCornerExtender it displays correctly.

Any idea what is causing this?

Here is some sample code:

<

headrunat="server"><title>Panel expanding beyond div height.</title>

</

head>

<

atlas:ScriptManagerID="ScriptManager1"runat="server">

</

atlas:ScriptManager>

<

body><formid="form1"runat="server"><divid="Wrapper"style="vertical-align: top; width: 750px;"><divid="Header"style="vertical-align: top; background-color: White; padding: 4px;

height: 50px; width: 100%;">

<asp:PanelID="pnlHeader"runat="server"BackColor="Blue"ForeColor="White"Height="100%"HorizontalAlign="Center"Width="100%">This should only be 50px high.</asp:Panel></div><divid="Content"></div><divid="Footer"></div></div></form>

<cc1:RoundedCornersExtenderID="RoundedCornersExtender1"runat="server">

<cc1:RoundedCornersPropertiesTargetControlID="pnlHeader"Color="Blue"Radius="7"/>

</cc1:RoundedCornersExtender>

</

body>It's the Height="100%" on pnlHeader that's confusing things. If you can change that to Height="50", the results seem to be what you want.

Thanks for the thought. But wouldn't the height setting on the Header limit it to 50px? I have found a workaround by creating a cssClass for the panel and setting the height there and not using the Height=100% within the control.

My original use of the 100% within the control was working until the July CTP. Again thanks for the assistance. Something must have changed in the July CTP that caused this to happen.

Wednesday, March 21, 2012

Parameters passing with ClickBehavour

I have read Wilco's post: http://www.wilcob.com/Wilco/Atlas/DeclarativelyInvokingJavaScript.aspx#comments

But still cannot pass a parameter to a function call.

<scriptlanguage="javascript"type="text/javascript">
functoin MyHandler(sender, args) {
var dc = sender.get_dataContext();
var descr = dc.getProperty("Description");
alert(descr);
}
</script>

[...]

<atlas:Button ...>
<ClickHandler="MyHandler"/>
</atlas:Button
is the example, on the page, but I dont get how I can get bind for example an ID to be passed to my function.

Thanks all :)

Hi,

you are using the function as an event handler (for the click event) thus it's normal that you cannot pass parameters to it; only the object that raises the event (the Button instance in this case) should pass parameter to event handlers.

What you could do is retrieve the ID parameter in the event handler. Which are your requirements?
Thanks for your reply :)

I have a datasource retrieved from the web service and is binding it toa list. For each row of the list, there is a "link" where the user canclick on to call the JS function passing in the ID that hopefully canbe binded to.

For example:

Data Source:

Name || ID

Joe Doe || 0
Garbin || 1

And the list will be outputtied as:

<a href="http://links.10026.com/?link=#" onclick=functiontoCall( 0 )> Joe Doe </a>
<a href="http://links.10026.com/?link=#" onclick=functiontoCall( 1 )> Garbin </a
Something similar to the above is what I am trying to do.

Thanks :)

Parser Error Message: Could not load file or assembly Microsoft.Web.Atlas or one of its de

hi all,

I have a not so nice error that I can't solve. I use asp .net 2.0 and Atlas. The site works in dev but not on my server...

I hope someone can help me out.

Regards
Stijn

Parser Error

Description:An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.

Parser Error Message:Could not load file or assembly 'Microsoft.Web.Atlas' or one of its dependencies. The system cannot find the file specified.

Source Error:

Line 1: <%@dotnet.itags.org. Page Language="C#" MasterPageFile="MasterPage.master" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" Title="Untitled Page" %>
Line 2: <%@dotnet.itags.org. Register Assembly="Microsoft.Web.Atlas" Namespace="Microsoft.Web.UI" TagPrefix="cc2" %>
Line 3: <%@dotnet.itags.org. Register Assembly="AtlasControlToolkit" Namespace="AtlasControlToolkit" TagPrefix="cc1" %>
Line 4:


Source File:/issue/default.aspx Line:2

Nobody? Do I need to give some additional info? This problem really holds up my development so please help meout here.


hello.

well, i guess that you must see if ASP.NET 2.0 is installed in IIS and if the vdir you've created there is configured to use it...


ASP .Net 2.0 is installed and the site also uses the 2.0 version. The error is about ATLAS so I think I have a configuration problem there? I use windows 2003 server.

Hello,

I have the same identically problem.

When I run my application on local web server don't have any problem, but when I transfer my aplication on remote server(Aruba) I have the problem:

Could not load file or assembly 'AtlasControlToolkit' or one of its dependencies. The system cannot find the file specified

Line 1:<%@. Page Language="C#" AutoEventWireup="true" CodeFile="Erbario.aspx.cs" Inherits="_Default" %>Line 2: Line 3:<%@. Register Assembly="AtlasControlToolkit" Namespace="AtlasControlToolkit" TagPrefix="cc1" %>Line 4:<%@. Register TagPrefix="test" Namespace="Test" %>Line 5:

Have you resolved the problem?

Help me please


MarcoLF:

I have the same identically problem.

Hi!

We are getting the same exception on our production server. Did you find out what causes it?

Thank you in advance.

partial postback doing full postback - bug in ATLAS ?

theres no rhyme or reason, but my partial postback button often does full postbacks and then reverts to partial postbacks for no apparent reason...

I can't find anything on this and was suggested that this is a bug in the current release of ATLAS. Does anyone have any idea on this ?

I'm bashing my head trying to figure this one out ..


Thanks very much

mike123

hello.

well, that is strange. do you have a simple demo page that reproduces this?


I'm sorry I don't have one at this time ... =[ I could get it online if you think its crucial to see it to help diagnose

any ideas ?

thanks very much


well, we have to see the server side code to help you diagnoise. an online sample doesn't give us that.


The actual code doesnt really show too much but here it is anyways

I'm really lost on where to go from here. Anyone have any ideas ? I was so psyched about using ATLAS but it's pretty frustrating not being able to get past this point.

Thanks again,

mike123

<formid="form1"runat="server">

<asp:TextBoxId="textbox1"runat="server"/>

<atlas:ScriptManagerID="ScriptManager1"runat="server"EnablePartialRendering="true"/>

<divstyle="background-color: Yellow; float: left; width: 100px;">

<asp:LabelID="FullPostBackLabel"runat="server"/><br/>

<asp:ButtonID="FullPostBackButton"runat="server"text="Full Post Back"OnClick="FullPostBackButton_OnClick"/>

</div>

<atlas:UpdatePanelrunat="server"ID="UpdatePanel1"Mode="Conditional">

<ContentTemplate>

<divstyle="background-color: Lime; width: 100px;">

<asp:LabelID="PartialPostBackLabel"runat="server"/><br/>

<asp:ButtonID="PartialPostBackButton"runat="server"text="Partial Post Back"OnClick="PartialPostBackButton_OnClick"/>

</div>

</ContentTemplate>

</atlas:UpdatePanel>

<atlas:UpdateProgressID="UpdateProgress1"runat="server">

<ProgressTemplate>

Please wait... </ProgressTemplate>

</atlas:UpdateProgress>

</form>

PublicSub FullPostBackButton_OnClick(ByVal senderAsObject,ByVal eAs EventArgs)

FullPostBackLabel.Text = DateTime.Now.ToString()

EndSub

PublicSub PartialPostBackButton_OnClick(ByVal senderAsObject,ByVal eAs EventArgs)

PartialPostBackLabel.Text = DateTime.Now.ToString() &"Partial"

EndSub


hello.

this is weird. i tried running your page in an empty atlas site and it worked without anyproblems...have you tried running this page in a site created through the atlas template?


No I haven't as this is a pretty large web application that needs to have atlas running on it. I don't think theres a problem with the code either, something to do with integration but no idea where to start. I've tried things such as removing flash from the page and javascript ads.... Still no luck ....

Any ideas?

Thanks very much

mike123


I had a similar problem then I found that it was related to custom javascript code that was calling __dopostback


I had a smiliar problem too. I found that It didnt like my hidden input.

<input type="hidden" name="action" ID="action" value="" />

Once i deleted that everything was fine!


I found out that when removing the following line

<xhtmlConformance mode="Legacy"/>

from web.config , UpdatePanels work like they should

this did not occur in Atlas CTPs, but in AJAX final release...

Partial rendering issue with AJAX

I have following code working fine with ATLAS with partial rendering in IE and Firefox. But after I move the app to AJAX beta 1.0, it causes the the whole page rendering with Firefox 2.0 but it works fine with IE 6.x.

function setID(myID)
{
opid = document.getElementById ('<%=txtMyID.ClientID%>');
opid.value=myID;
document.getElementById('<%=ibtnMyButton.ClientID%>').click();
}

The page looks like:

<asp:UpdatePanel ID="UpdatePanel1" RenderMode="Inline" UpdateMode="Conditional" runat="Server">
<ContentTemplate>

<asp:UpdatePanel ID="UpdatePanel2" RenderMode="Inline" UpdateMode="Conditional" runat="Server">
<ContentTemplate>

<asp:TextBox ID="txtMyID" runat="server" ></asp:TextBox>

<asp:ImageButton ID="ibtnMyButton" runat="server" ImageUrl="../Images/go.gif"></asp:ImageButton>
........

</ContentTemplate>
</asp:UpdatePanel>

</ContentTemplate>
</asp:UpdatePanel>

How to solve this issue?

Try to change your codes as the following.
<asp:UpdatePanel ID="UpdatePanel1" RenderMode="Inline"ChildrenAsTriggers="false" UpdateMode="Conditional" runat="Server">
<ContentTemplate>
<asp:UpdatePanel ID="UpdatePanel2" RenderMode="Inline"ChildrenAsTriggers="false" UpdateMode="Conditional" runat="Server">
<ContentTemplate>
<asp:TextBox ID="txtMyID" runat="server" ></asp:TextBox>
<asp:ImageButton ID="ibtnMyButton" runat="server" ImageUrl="../Images/go.gif"></asp:ImageButton>
........
</ContentTemplate>
</asp:UpdatePanel>
</ContentTemplate>
</asp:UpdatePanel>
Wish the above can help you.
Thank you, Jasson, It works.

Partial Rendering and Javascript

Hello Again,
I would like to point out an additional bug regarding my previous post (rendering JavaScript while using Atlas Partial Rendering);

1. Dynamically rendered script which returns to the client Atlas framework after performing a partial update isn't evaluated.
The simplest case could be a javascriptalert(msg)not being called if rendered dynamically usingPage.ClientScript.RegisterClientScript(...).
This apparently simple bug causesmanyproblems with in-house and commecial WebControls that must render Javascript in order to function.

2. An additional question. I noticed that OnPreRender is called on an UpdatePanel even if it wasn't updated (while using Condition update-mode, of course). Should it be so ?

Thanks Again,
Waiting for a response,
Lidor Pergament.

My Previous Post (unanswered yet)

"Hello,

After a week of Atlas Partial Rendering integration experiments with my team's WebApplication,
I would like to note out a few bugs and problematic issues.
(The main effort is on replacing our existing complex Client-Server MVC model and Client-Server Context-Sensitive UI model with simple server-side models, using Partial Rendering)

1. Dynamically registered / Static Javascript which contains "&&" operators or<!-- --> Xml comment tags, Larger Than, Smaller Than<> operators causes the Partial Rendering to fail (without any notification).
I assume this is because the partial rendering response is returned as an XML document and these characters are special Xml entities, which cause the Xml parser to treat them specially.
Maybe you could wrap all the Dynamically registered script (Page.ClientScript.RegisterXXXScript) with aCDATA element like with the content returned from the Update Panels ?

2. The previous issue also occurs when trying to render a <style href= type=stylesheet /> or <?XML Import=...> element dynamically.

2. Javascript syntax errors also cause the Partial Rendering to fail without any notification.
I noticed the bug when i accidently rendered anIF statement without a code block and curly brackets.

3. The DHTML event ondocumentready and similar document/body level events aren't fired when using partial rendering. This causes some issues with Controls that depend on these events to initialize.

4. Calling Update() on an UpdatePanel manually works only before the OnLoadComplete event.
Calling Update during the OnLoadComplete raises an Exception but strangely calling Update() from a later event, such as OnPreRender doesn't raise an Exception at all.

5. Is it possible to Create and Register UpdatePanels dynamically from Code-Behind? i tried to use ScriptManager.RegisterUpdatePanel but strangely this caused the partial rendering to fail.

6. The HttpContext.Current.Request isn't accesible during Partial Rendering.

Thanks,

Lidor Pergament."

>>Dynamically rendered script which returns to the client Atlas >>framework after performing a partial update isn't evaluated.
>>The simplest case could be a javascriptalert(msg)not being called if >>rendered dynamically usingPage.ClientScript.RegisterClientScript>(...).

which browser are u using? This trouble was with firefox but not with IE and also, it has been resolved with april CTP.


Actually, I'm using Internet Explorer.
I'll check the April CTP.

Regarding the Dynamically registerd javascript i noticed, today, in the Atlas.js script file that dynamically registered scriptsare treated, BUT the XPath used to search for script elements in the response xml is

"/rendering/script/[@.type='text/javascript']"

meaning if i had a script registered with out the type attribute in the script element, <script> code... </script> it would be ignored and wouldn't be evaluated.

I replaced all my script elements to match <script type='text/javascript'> and surpringly the scripts seemed to work... wooof what a relieve.

Was this resolved in the April CTP ?

Lidor.


i always put type attribute in script tag. I dont think this was the problem which was solved in april ctp. I thought its some thing different. Anyways.. Its good that u have come out of trouble.
I definitely agree that there is some problem with Javascript an UpdatePanels with partial rendering. Refer to http://forums.asp.net/thread/1271593.aspx.

I've also seen that partial rendering stopped working when you include certain javascript source files. In the following code sample:

<%@. Page Language="C#" AutoEventWireup="true" CodeFile="Default4.aspx.cs" Inherits="Default4" %><%@. Register Assembly="AtlasControlToolkit" Namespace="AtlasControlToolkit" TagPrefix="atlasToolkit" %><!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 runat="server"> <title>Geo-Spacial Asset Management</title> <link href="css/StyleSheet.css" rel="stylesheet" type="text/css" /> <link rel="stylesheet" type="text/css" href="css/DragNDropMasterPanel.css"> <link href="css/submodal.css" rel="stylesheet" type="text/css" /> <link href="http://dev.virtualearth.net/standard/v2/MapControl.css" type="text/css" rel="stylesheet" /> <style type="text/css" media="screen"><!-- .Compass { width: 54px; height: 54px; background: url(images/compass.gif); margin: 0px; cursor: pointer; } .ZoomBar { position: relative; background: url(images/bar.gif); width: 103px; height: 20px; margin: 2px; overflow: hidden; } .ZoomBar_slider { position: absolute; background: url(images/slider.gif); width: 7px; height: 20px; overflow: hidden; display: block; } .Dashboard { position:absolute; border:1px solid #cbcbcb; background-color:black; filter:alpha(opacity:90); opacity:0.9; z-index:100; padding:2px; overflow:visible; font-family:Verdana,sans-serif; font-size:7.5pt; } --> </style> <![if !IE]><script src="http://local.live.com/JS/AtlasCompat.js"></script><![endif]> <script src="scripts/submodalsource.js" type="text/javascript"></script></head><body> <form id="form1" runat="server"> <atlas:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="true"> <ErrorTemplate> <h1>Error</h1> </ErrorTemplate> </atlas:ScriptManager> <a onclick="AddLocation();">AddNew</a> <a onclick="OnFinishAddLocation(null);">Refresh</a> <atlas:UpdatePanel ID="pnl0" runat="server" Mode="conditional" > <ContentTemplate> <asp:Button ID="btnRefresh" runat="Server" OnClick="OnGridRefresh" Text="refresh" style="width:0px;height:0px"/> </ContentTemplate> </atlas:UpdatePanel> <atlas:UpdatePanel ID="pnl" runat="server" > <ContentTemplate> <asp:GridView ID="GridView1" runat="server" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" DataSourceID="SqlDataSource1" DataKeyNames="AssetLocationID" > <Columns> <asp:TemplateField> <ItemTemplate> <asp:Panel CssClass="popupMenu" ID="PopupMenu" runat="server"> <div style="border:1px outset white">  <a href="#" onclick='EditLocation(<%# Eval("AssetLocationID")%>);'>Edit</a>  <br />  <asp:LinkButton ID="LinkButton2" runat="server" CommandName="Delete" Text="Delete"></asp:LinkButton>  </div> </asp:Panel> <asp:Panel ID="Panel9" runat="server" Width="100%"> <table width="100%"> <tr> <td ><asp:Label Font-Bold="true" ID="Label1" runat="server" Text='<%# Bind("LocationRegion")%>'></asp:Label></td> </tr> </table> </asp:Panel> <atlasToolkit:HoverMenuExtender ID="hme2" runat="Server"> <atlasToolkit:HoverMenuProperties HoverCssClass="popupHover" PopupControlID="PopupMenu" PopupPosition="right" TargetControlID="Panel9" PopDelay="25"/> </atlasToolkit:HoverMenuExtender> </ItemTemplate> </asp:TemplateField> </Columns> </asp:GridView> <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:assetsConnectionString%>" DeleteCommand="DELETE FROM TBL_LOCATION WHERE (AssetLocationID = @.AssetLocationID)" SelectCommand="SELECT * FROM TBL_LOCATION" SelectCommandType="Text"> <DeleteParameters> <asp:Parameter Name="AssetLocationID" /> </DeleteParameters> </asp:SqlDataSource> </ContentTemplate> <Triggers> <atlas:ControlEventTrigger ControlID="btnRefresh" EventName="Click" /> </Triggers> </atlas:UpdatePanel>  <input id="Text1" type="text" /> </form> <script type="text/javascript">function EditLocation(locId){ var url = "dialogs/editlocations.aspx?LocationID=" + locId + "&Action=edit"; showPopWin(url, 400, 250, OnFinishAddLocation);} function OnFinishAddLocation(result){ form1.btnRefresh.click();}function AddLocation(){ var center_latitude = "-110.0902902"; var center_longitude = "78.0891821"; var zoom_level = "12"; var url = "dialogs/editlocations.aspx?LocationID=-1&Action=insert&Latitude=" + center_latitude + "&Longitude=" + center_longitude + "&ZoomLevel=" + zoom_level; showPopWin(url, 400, 200, OnFinishAddLocation);} </script> </body></html>
Partial rendering doesn not work- the gridview is not updated when you click the btnRefresh button. IF I remove
 <![if !IE]><script src="http://local.live.com/JS/AtlasCompat.js"></script><![endif]
It will start working. If I re-insert the src, it stops. I'm not sure if the developers read these two forums often enough. The developers in the Tookkit forum is much more active, it seems. I started a web site, and now I've halted development because of these unknown issues.
If you're doing a straight Atlas example, all works well, but once you start adding additional scripts, and integrate with other stuff,
there seems to be some issues--side effects--that break things.

Just a note-I'm using the April CTP. I know it is still a work in progress, but without feedback from the devs,
I'm not sure if it will be fixed at all.


One more thing to note, if I inserted an UpdateProgress, I can see it execute each time, but for some reason , the gridview doesn't update when that source is included.

include that script , which is causing the error and call UpdatePanel.Update() in server side code to see if it helps you.

BTW, what kinda website u r working on? Just curious. I am also working on a web site and had a few problems wid atlas as well.


HiShahzadAhmed, thanks. I'm integrating the Atlas UI and MS Virtual Earth control to create an app that manages/monitor/control spacially dispersed assets in an organization with multiple sites. My expertise is in web based visualization and control of plant assets (accross a wide range of industries), and I thought VE & Atlas would provide some "new" and dynamic ways to interact with the assets--over and beyond what I've used in the past. The intent is to create a prototype and see how it goes...These types of sites are always not exposed to the web, because of the sensitive information it contains (to the organization), so it is not something I can "show off" when I'm doneSad [:(]

What's your site about, if you don't mind me asking?

Just tried UpdatePanel's Update() method, but with no change in the results.

hmm... can u make sure if its postingback to the server , using debugging.

I have developing a Team managment system which features hour tracking , task list and some other stuff. It s currently in beta testing mode. I will show it to u, when it gets live. We have used atlas and library at script.aculo.us to cope with the challenges. Script aculo provides some good drag drop funcationality, without writting much of the code.


It is posting back. If I set a break point, I can break to the DataBind() call just fine.

its strange really. Cant say any thing about it.


Ok, from various comments in this and other posts, it seems that if you have characters that are not xml friendly (or has special meaning to xml), then these can stop the xml parsing in the page--which stops rendering to the client. Also, searching on the web, it seems if you have script blocks, if you put them into javascript source files and call these through script includes with the src property set to the path, it will escape these kinds of characters. I've tried encapsulating the code blocks in CDATA sections and this doesn't seem to work. The include worked.

Partial rendering requires a browser that supports W3C DOM Level 1.0.

We have open a new web page using atlas in some parts.

Yesterday, I have check event log of the live site www.rusgelin.net

I saw hundreds of errors.

THe exception is "Partial rendering requires a browser that supports W3C DOM Level 1.0. ".

I might create my own browser detection logic in the atlas so if browser does not support atlas, I can easly disable script manager and replace new controls with old controls.

but this solution is not feasible solution. Please explain why does the error occur?

Sahin

I saw the same error, though I use Ajax beta 1.0. if this can't be sloved, I guess i have to turn off the Ajax beta, coz all the search engine spider can't index my web site.
hello.

well, that happens because?currently?the?client?side?features?need?a?browser?with?those?caracteristics?to?correctly?render?the?pages.?getting?those?warnings?means?that?you had several?browsers?not?compatible?with?dom?level?1?loading?the?pages.
all the error message are generated by spiders from like google , yahoo... why i concern this is if those spider can not access my site correctly, then my web site can not be indexed by those search engines, that will be a big problem.

.Net 2.0 is actually fairly good at detecting browsers / bots - so you can place some logic in your base page code that checks for the bot and disables the partialrendering...following is a simple code snippett -

If (HttpContext.Current.Request.Browser.Crawler == true)

{

<control logic to over-ride displaying of content (either allow or disallow)

}

else

{

(do the normal thing)

}


oh and if you haven't read this - it gives alot more detail...on the scm / enabling detecting etc...

Sorry, but that does nothing to address this problem -- the error is coming from UpdatePanel.

-MT


With Beta2 you can if the browser supports partial rendering declaring this in the page that contains the ScriptManager:


Protected Sub Page_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Init
If ScriptManager1.SupportsPartialRendering = True Then
ScriptManager1.EnablePartialRendering = True
Else
ScriptManager1.EnablePartialRendering = False
End If
End Sub

Cheers,
Juan


Will this cut out this error??

-- My system is throwing 100's these errors a day -- and I haven't even launched teh site!


Will this cut out this error??

-- My system is throwing 100's these errors a day -- and I haven't even launched the site!


Yes, it will... just try it...

After adding that piece of code to the PageInit Method, use whatever error tracking tool you are using to check that it's not throwing errors anymore


Hi,

Why dont you try with Beta2 , this is a new release of ASP.NET AJAX,

and you can also get the informatin about how to convert ATLAS to Beta2 inhttp://ajax.asp.net/default.aspx

Pradeep Kumar Bura


I was using up to now the Beta1 and encountering the raised exception for all search engine. Does the default settings of the Beta2 solve this problem directly, or do we need some extra settings to change or tweak?

Thanks in advance,
Joannès


I have the same question as Joannes and want to bring this thread back to the top of the list so someone might answer from MSFT.

Will/is theEnablePartialRendering property smart enough to set itself to false if the client browser does not support partial rendering?
Or will we have to performscriptManager1.EnablePartialRendering = scriptManager1.SupportsPartialRendering; on every page that uses a script manager?


hello.

well, currently, you have to do that :(