Showing posts with label working. Show all posts
Showing posts with label working. Show all posts

Wednesday, March 28, 2012

Atlas, AJAX and InfoPath

I am working on the architecture of a new application based on Sharepoint Forms Libraries and InfoPath. There are several features of Atlas and AJAX that could be benificial in the contruction and interaction of these forms. So the promary question here is, Is there a way to use Atlas and AJAX in an Infopath form?

TIA

Infopath is a rich client, which basicly means that you can do a lot more in infopath than in a web browser. I'm not sure why would you want to use AJAX with infopath, and I highly doubt that you can use it in infopath.

Check out this website for more info on what you can do with infopath forms
http://www.infopathdev.com/


Also to add to that. Atlas can work on ASP.NET v1.1 (Which is what the current Sharepoint version runs on), however it is designed to work better with ASP.NET v2.0. Microsoft Office Sharepoint Server 2007 (MOSS 2007) will run off of ASP.NET v2.0. Also InfoPath won't just be a Client Application/Windows Application any longer... you will the ability to load the Forms created into a browser with most of the same features that would exist in InfoPath. However, MOSS 2007 and InfoPath 2007 won't be release till the end of this year and possible next year in coordination with Vista.

Good luck!

JoeWeb


Thank you for your prompt response. The reason for considering this scenario is primarily for the UpdatePanel and the Autofill objects. I was thinking that these could minimize network traffic. Also, thank you for the URL.

Harry


Thank you. I am anticipating on having SMS push .NET v2 to all of our client machines. The infopath forms will ba carrying v2 code behind and my thought was include AJAX for the data comunication for lists and lookups.

Just a thought.

Atlas With ObjectDataSource

Can any bone send me examples on Formview(datasource=objectdatasource) which has Atlas Updatepanel in it. For me dataBinding not working properly .

any one plese send.

Hi,

You can try this link.

http://quickstarts.asp.net/QuickStartv20/aspnet/doc/ctrlref/data/formview.aspx

Atlas WebPartZones Visible property not working correctly

Hi All,

I have an ASPX page that contains three WebPart Zones. As per therequirements, one of the Zones, say rightZone, needs to be hidden for,say X, role. For this I check the user role in the Page_Load event, andif logged-in user's role is X then I set rightZone's Visible propertyto false. This works fine using ASP.NET 2.0 WebParts.

I wanted to have drag-and-drop in FireFox as well; therefore, I used"Atlas" (March CTP) WebPartManager and WebPartZone to achieve the same.This works fine for all roles except X. That is, when an X type userlogs in, a JavaScript error is displayed. It goes something like this:

Could not find 'rightZone' element.

On further investigation I found out that if set the rightZone isrendered even though its visible property is set to false. I guessthat's the reason for JavaScript error.

Please let me know if this is a bug in "Atlas" or I am doing something wrong.

Thanks.

~Vihar

It's generally not a good idea to set Visible=false on a WebPartZone. The Visible property only controls whether the WebPartZone is rendered, not whether the WebPartZone participates in the WebParts control set. For example, if a WebPartZone has Visible=false, it will still appear in the list of WebPartZones in the CatalogZone and LayoutEditorPart. This will be confusing to users, since they will be able to add or move a WebPart to an invisible WebPartZone.

A better idea is to remove the WebPartZone from the page completely. You would need to do this in the PreInit phase of the lifecycle.

All this aside, you have indeed found a bug in Atlas, and it applies to any server control, not just WebParts. The xml-script for a control is always being rendered, even if the control is not visible. This is a bug because the xml-script for a control usually assumes that the control was actually rendered. We'll work on fixing this for a future release. Thanks.

-Mike
For now you could use a workaround to add the css style with display:none.

Atlas WebParts and Subclassed WebPartManager? PLEASE?

I am working on a portal solution in which I've subclassed theWebPartManager class in order to override the OnAuthorizeWebPart methodto make use of the AuthorizationFilter property within myWebParts. Is there any way I can use the Atlas WebParts with asubclassed WebPartManager?

thanks,

jaredYes, you will need to write a new class that derives from the Atlas WebPartManager, and copy the code from your existing derived WebPartManager. If you plan to support both WebPartManagers, you will probably want to move the common code into a separate class.

-Mike

Monday, March 26, 2012

ATLAS used in UserControl. DropDownList problem

Hi everybody
I just modified my existing well working UserControl to use ATLAS's PopUp control.
The User Control has a Textbox, a calendar and four DropDownLists for Year, Month, Hour and Minute.
When a user clicks into the textbox, calendar with DDL's popup. If user clicks on a date, then the textbox is populated with new date.
But I do have problems when the user clicks on a DropDownList. As soon as the DropDownList opens and mouse is moved on it's items to select a new value, the panel containing Calendar and DDL's disappears.
It looks like the Atlas PopUp Control assumes that the focus was moved outside the control, But in reality the DropDownList is a part of the PopUp control.
How can I fix this?

Thanks in advance
Raja

I have the same problem using the Collapsable Panel with loading controls dynamically in the .aspx Page_Load event. When I Reorder the list, using the ReorderList control, the dynamically loaded controls disappeared.

It sounds like you're running into a general ASP.NET pattern - if you're dynamically adding controls, you'll need to re-add them after a postback as well.


My user control does not contain any dynamic controls and it works very well without ATLAS. I just think that ATLAS assumes the opened DropDownList itema as a new layer and so it thinks that the focus was moved from it's own PopUp panel and simply disappears.

Raja


Hi Raja,

I think your problem has to do with the way thePopupControlExtender handles theblur andfocus events. If you check out the code inPopupControlBehavior.js you'll probably see where things are going wrong. The good news is that we're looking at a better way of doing this and hope to release it in the next drop. For your current scenario though, you could modify the JavaScript code to only hide the popup when something outside it or the textbox is clicked.

Thanks,
Ted


I'm seeing the same problem in HoverExtender. The behavior that I see is that if the Panel's that's loaded is larger and outside of the region of hte target control ... then depending on where you click on the panel, you get diffeerent behaviors.

If I click on the DropDownList and navigate with the keyboard, the panel stays up.
If I click on the DropDownList and click on an item it goes way.

If I change the markup (in my case I'm dynamically generating within a template ... that's another story) to instead use a collection of RadioButtons, the panel is not dismissed.

--

In another panel I've got an embedded controller (the FlashPlayer). I've configured the flash player to not autostart (play=0). The only way to start playing is to click right. Doing so dismisses the hover panel.

Hi pstanhope,

I'm not able to reproduce this problem. Could you post a complete sample the demonstrates it? That would help a lot.

Thanks,
Ted

Atlas UpdatePanel control is not working on a Microsoft CMS (MCMS) site page

Hi all,

I am really puzzled about the Atlas UpdatePanel control not working on a MCMS template page. Can someone please comment on possible fixes, issues related to using this control of MCMS? I am not very familiar with how the control work under the hood. Can someone pinpoint me where to find documentation on the internal workings of this control?

Here is what I have tried so far.

I followed the insertion of the javascript on the page_load event handler post on this linkhttp://blogs.technet.com/stefan_gossner/archive/2006/06/01/431687.aspx?CommentPosted=true#commentmessage

// register a client script that ensures that the action property
// is correct when AJAX tries to do its postback.
string script =
"\n<script type=\"text/javascript\">\n" +
" if (typeof (__CMS_CurrentUrl) != \"undefined\")\n" +
" {\n" +
" __CMS_PostbackForm.action = __CMS_CurrentUrl;\n" +
" }\n" +
"</script>\n";

Page.ClientScript.RegisterStartupScript(this.GetType(), "AdjustActionForAJAX", script);

However, no luck at all.

Here is a description of the behaviour after that Javascript insertion.

I try using the ATLAS:UpdatePanel control and it didn't work. The button on my page and the clicked results are wrapped inside the content of the UpdatePanel. In view mode, it still does a postback by refreshing the page. And in author mode, there are more problems. The edit link for the web author console will not show up when it is clicked.

Have anyone tried using the ATLAS:UpdatePanel control with a MCMS site.

The only post I found ishttp://forums.asp.net/thread/1335638.aspx
The person responded the following:

It was a painful lesson, but I was able to see multiple things that CMS did to break ATLAS.

- CMS writes a JScript block intercepts the ATLAS async post sent from the client and throws it on the floor. So, the client never gets the post back off the machine. Turns out using the DefaultConsole control is writing the additional JScript block. Needed for CMS editing of the page.

- When using the cms:RobotMetaTag control in CMS, it will cause the XMLDOM load to fail for ATLAS on the postback because of the '&' characters in a <BASE> tag. Plus there is a <META> with no closing tag. This control can be removed if you don't want to use the CMS feature.

We resorted to placing the ATLAS enabled page in an iFrame of a page that was done in CMS. Seems to work

This is still an issues with 1.0 RC.

Has anyone else been able to get the UpdatePanel to work with MCMS?


Here is what I finally came up with to adjust for the ugly CMS urls that was causing AJAX to reject the post backs from UpdatePanel. This is currently going through test, and I'm not sure if it broken FireFox, but this is what I have to get it work in IE.

// add this Script to handle the confusing between CMS and AJAX
string script = "\n<script type=\"text/javascript\">\n" +
"Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);\n" +
"function EndRequestHandler(sender, args) { \n" +
" if (typeof (__CMS_CurrentUrl) != \"undefined\")\n" +
" {\n" +
" Sys.WebForms.PageRequestManager._instance._form._initialAction = __CMS_CurrentUrl;\n" +
" }\n" +
"}\n" +
"EndRequestHandler(null, null);\n" +
"</script>\n";
Page.ClientScript.RegisterStartupScript(this.GetType(), "AdjustAJAXForCMS", script);


I figured out that this fix is for IE and is not needed for FireFox. Funny how the two browsers deal with this.

So I added a check for IE before I write the script block.


Does anyone have an update on this issue? I'm having the same problem and I was able to narrow it down to the RobotMetaTag object and the BASE tag that it appends.

Any help is appreciated.

Thanks,
Ahmed

atlas updatepanel and web parts

Hello All,

Has anyone gotten the atlas update panel working in a webpart? I have a panel that is within a web zone, that has an updatepanel. The panel houses a Gridview. I cannot seem to get the update panel to work properly. I'm trying to do a sort without doing a post back. If I take the exact same Grid out of the web zone, and place it somewhere else on the page, it works fine. Anyideas?

thanks

Hi,

I've tried to build an example similar to yours and the GridView sorts ok, everything seems to work in my case. Which problems are you experiencing?

Hi, this is a old post, hope you can still get the message.

I still can not find out what April CTP does for updatepanel in webpart. UpdatePanel need to be load befire page initcomplete, but at that stage, the webpart state has not been restored by WebPartManger, so how should they work together?

thansk


I found personalizationBlob is loaded before webpart pageinit, so it looks like the webpart state can be stored earlier so all controls in a webpart can be load in pageinit. It seems an easy solution.

Could anyone point out what is the real problem?


In the current version of Atlas, you cannot place an UpdatePanel inside a WebPart. The only supported combination of WebParts+UpdatePanel is that you place all WebParts controls inside a single UpdatePanel.

-Mike

I have tried the precise scenario of putting a web part zone inside an update panel. In this web part, I add dynamic web part controls (including user controls with GridViews on them). If I add a user control statically, everything seems to work, but once I try to use LoadControl() along with WebPartManager.CreateWebPart() and WebPartManager.AddWebPart(), I have problems with postbacks not happening as they should--especially during the sorting of a GridView.

This seems to be a common theme in discussions, but I have not found any good answers to date. Am I missing something? Or is this something to be addressed in a future release?


As far as we know, everything should work if *all* your WebParts controls are in a *single* UpdatePanel. The most common mistake is placing some WebParts controls (like the WebPartManager) ouside the UpdatePanel.

Second, please make sure your scenario works on plain ASP.NET 2.0 without Atlas.

If you are still seeing an error that only happens when UpdatePanel is involved, please post the smallest code needed to reproduce the issue. Thanks.

-Mike

Saturday, March 24, 2012

Atlas Tutorials

Hi all .. please tell me where i can find atlas tutorials and training ... i am working on a project for stock market and i have to display alot of information live from database without the round trip to server.
If anyone knows about good bookds tutorials or training please provide me.http://atlas.asp.net/docs/default.aspx

Atlas trigger not quite working

Hi,

I have got a serious problem with triggersnot updating the content of UpdatePanel at appropriate time. Here's thesituation:

The master page holds three fieldset elements -each of those is dragable and resizable (YUI library). Inside each ofthose is an UpdatePanel. Each UpdatePanel holds part of the left sidemenu, so parts are separately draggable around the UI.
Next, thepage that uses this master page further has four (4) more draggablefieldsets with UpdatePanel's inside. Each of these panels holds a partof the final content - drill down. So I need to update each lowerUpdatePanel when the upper one changes. Each of the content panelsactualy holds a WebUserControl (.ascx) and those all inherit from abase control that defines and fires a common event when somethingchanges. This works. I debugged the event firing and it works justfine. The problem is that when i created Triggers and defined thecontrols that fire them and the common event nothing really happens.All those UpdatePanel's have their Mode set to Always so they did getupdated even before i added triggers with a small problem that they gotupdate after two clicks, thous showing what should have been shown oneclick back. Triggers actualy made no diference even dough I thoughtthey would.

If anybody has had the same problem and havesessed it please post your solutions. Should the UpdatePanles havetheir Mode set to Partial in order for triggers to work?

Last time I saw this "one-update-behind rendering" problem (for lack of a better term), it was a bug on my side; I was updating the data too late in the page lifecycle (so the UI had already been rendered).

A simple test to see if you have the same bug would be to take Atlas out of the equation. (Probably setting EnablePartialRendering="false" on your atlas:ScriptManager should be enough.) If the problem is still there when using normal postbacks, then you know that Atlas isn't the problem. On the other hand, if it starts working just like you'd expect (but full page refreshes, of course), then you know it's somehow related to Atlas.

As always, the best way to get help would be to create a really minimal Atlas app that demonstrates the problem and post the full code. That way other people can read through it and even try it on their own.


Hi Steve,

I tested Atlas behavior with creating a test project with one page (no master page). Then i created 2 web user controls (.ascx), added 2 UpdatePanels to the page and within each one I placed one of those user controls. Each user control contains a button which increments its number of clicks and the oposite control displays that number.

This composition works well if i set the UpdatePanels mode to Always - the user controls displays the correct number. If I set the mode to Conditional, the control - as expected - gets updated only when one of its contained controls has coused postback.

Next i tested adding Triggers to each of the UpdatePanels and link the controlId to oposite user control button and event name to click event. And afcourse setting the mode to Conditional. This also works very well.

Then I added events to controls themselfs. When the button within the control is clicked that event gets fired from the button click handler. And the user control event is then used as the target event in the UpdatePanel Trigger. Here is the problem. I am probably doing something wrong with page / user control as you suggested. Funny thing is this is a very simple page (no added code behind) and two very simple user controls. Each of user controls contains a method InnitializeControls() which sets the .Text property of the label. This method is called from Page_Load.

Is there some special way controls have to be written in order for Triggers and the Conditional Mode to work correctly? I would expect that trigger would update the panel after its target has finished initialization or after all other event handlers have finished. At what point are the triggers called? Should this involve any event bubbling?

Anyways, I need UpdatePanels to update based on user control event - the control is contained in another UpdatePanel. The problem can be fixed by explicitly setting the event handler to the publicly defined method in the control that needs to get updated when the event emiter changes. and setting the Mode to Always.

I hope there is a better way because this approach has a lot of overhead. I just don't get it why it works with buttons but not with user control events. Has this anything to do with client side clicks?

Thanks for any suggestions.

Atlas to Ajax 1.0 Upgrade Nightmare

I am trying to upgrade my website from the Atlas release to Ajax 1.0 and can't seem to get it working.

I have removed all references to Atlas from my pages and my Web.Config file. I then added the asp:ScriptManager and asp:UpdatePanel from scratch. However, now no matter what I try I get a full page refresh. Here is a snippet of my code, I'm hoping I just left something out and that someone picks it up:

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

<asp:UpdatePanelID="UpdatePanel1"runat="server">
<ContentTemplate>
<asp:DropDownListID="City"runat="server"SkinID="RegularDropDown"><asp:ListItemValue=""Text="City/Town"/></asp:DropDownList>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTriggerControlID="County"EventName="SelectedIndexChanged"/>
</Triggers>
</asp:UpdatePanel>

Here is a snippet from my Web.Config file:

<pages>

<controls>
<addtagPrefix="asp"namespace="System.Web.UI"assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
</controls>
</pages>
<compilationdebug="true">
<assemblies>
<addassembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<addassembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<addassembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
</assemblies>
</compilation>

Thanks in advance for any help,
Russ

Hi Zero,

Three things worth checking:

1 - Is theAsyncPostBackTrigger ControlID supposed to be 'Country' or 'County'.

2 - Have you tried setting the UpdateMode property of the UpdatePanel?

3 - Have you removed the following line from the top of your page:
<%@.RegisterAssembly="Microsoft.Web.Atlas"Namespace="Microsoft.Web.UI"TagPrefix="atlas" %>

Not sure if these are the source of your problem but can't hurt to try.

Good Luck,
DJH


Hi Russ,

Here is a link which describes the things to do when you are converting from an Atlas project to an Ajax project:

http://ajax.asp.net/documentation/Migration_Guide_CTP_to_RTM.aspx

Hope this helps!

Regards,


Exactly what I needed, thank you for the link to the migration guide.

I just used the new Web.Config file and copied my variables over to it and it seemed to fix the problem.

Thanks again,
Russ

Atlas stopped working when I added a javascript function.

Everything was working perfectly until I added a <script type="text/javascript"> section in the header and added a function. Now Atlas doesn't work any more. The page I created is simply a listbox, button and a label. When the button is pushed items are added to the list box and the label text is changed. With the javascript function in the code, nothing happens when I click the button. It works if the "hasOptions" function is removed. Is this a bug, or am I just doing something wrong?

Here is the aspx code:

<%@dotnet.itags.org. Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %><!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> <script type="text/javascript"> function hasOptions(obj) { if (obj != null && obj.options != null) { return true; } return false; } </script></head><body><form id="form1" runat="server"> <atlas:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="true" /> <br /> <atlas:UpdatePanel ID="TableUpdatePanel" runat="server" Mode="Conditional"> <ContentTemplate> <asp:ListBox ID="listbox" runat="server"> <asp:ListItem Text="Hello"></asp:ListItem> </asp:ListBox> <asp:Button ID="button" runat="server" OnClick="button_Click" Text="Push Me!" /><br /> <asp:Label ID="label" runat="server"></asp:Label> </ContentTemplate> </atlas:UpdatePanel> </form></body></html>

And here is the Code Behind:

using System;using System.Data;using System.Configuration;using System.Web;using System.Web.Security;using System.Web.UI;using System.Web.UI.WebControls;using System.Web.UI.WebControls.WebParts;using System.Web.UI.HtmlControls;public partialclass _Default : System.Web.UI.Page {protected void Page_Load(object sender, EventArgs e) { }protected void button_Click(object sender, EventArgs e) { listbox.Items.Add("Test"); listbox.Items.Add("Test"); listbox.Items.Add("Test"); listbox.Items.Add("Test"); listbox.Items.Add("Test"); label.Text ="This worked!"; }}

Hi,
I recently posted a message regarding your problem.
Try commenting out the IF statement with the && logical and operator,
that should fix your problem, seriously :)

I assume this is caused by a bug in the Atlas framework.
Every response returned from a partial update is treated as an XML document (you can use WebDevHelper to monitor the HTTP traffic and see this) and because '&' is a special xml charachter it confuses the Xml Parser and causes the Partial Rendering to fail.

I'm still waiting for a reply from for my post regarding this issue.

My Post:
http://forums.asp.net/thread/1267658.aspx

Have fun,
Lidor Pergament.

Wednesday, March 21, 2012

Atlas session issue

Hi all ,

i am working of a hospital management system which we desided to develop using atlas frame work. we have created the application main to sections using atlas script call back architecture. we are using scripts to pack the user entered data to the web service and in that web service we are entering the data in to the database.

all this happening with out a post back of the page.

now comes the problem.

we are not being able to handle the user session properties. we came to know that we cant access session variables in web services.

we are in a trap now. how we can manage the session, validity and time out of a user. cose in this method there is no method to handle the time out.

we also want to share some data between pages all along the use session. how can i acheive this.

can any one help in this regard.

Hi,

If I understood your issues corretly then this may give you soluiton.

When you use session in the web service you have to set enable session property to true in the webmethod attribute

Regards,

Techwork


Hi Techwork :)

We are calling the web service functions from java script using atlas frame work, Can i access a particular session like this " setting enable session property to true "

Atlas script not working after partial postback

I have a DetailsView in my page for inserting new data (wich has the "Insert" mode as default) , but it only shows up when the user clics a "new" link (outside the DetailsView). The "new" link and the "cancel" link (this one as a command field inside the DetailsView) are setting the visible property of the DetailsView using an Atlas script:

The link button is declared as follows:

<

asp:LinkButtonID="linkButtonNuevo"runat="server"CausesValidation="False"EnableViewState="False"OnClientClick="javascript:return false">Crear nuevo tipo</asp:LinkButton>

(I'm usingOnClientClick="javascript:return false"to prevent a postBack)

The cancel link (inside the DetailsView command field) is set by this code in the DetailsView DataBound event handler:

link.ID =

"linkButtonCancelarNuevo";

link.Attributes[

"onClick"] ="javascript:return false";

The Atlas Script is:

<control id="ctl00_ContentPlaceHolder1_detailsViewNuevo" cssClass="HiddenElement" />

<hyperLink id="ctl00_ContentPlaceHolder1_linkButtonNuevo">

<click>

<setProperty target="ctl00_ContentPlaceHolder1_detailsViewNuevo" property="cssClass" value="VisibleElement" />

</click>

</hyperLink>

<hyperLink id="ctl00_ContentPlaceHolder1_detailsViewNuevo_linkButtonCancelarNuevo">

<click>

<setProperty target="ctl00_ContentPlaceHolder1_detailsViewNuevo" property="cssClass"value="HiddenElement" />

</click>

</hyperLink>

By the way... I'm using a MasterPage, and this things (the link and the DetailsView) are inside an UpdatePanel.

So, I can keep showing/hiding the detailsView perfectly as long as I want (clicking new / cancel)... However, when I click the insert button in the DetailsView to save the data, it saves the data (calling a server-side method) and makes a partial postBack. After that, the Atlas script does not work anymore!!! I click the new link, but absolutely nothing happens... In fact, this happens after a partial postback caused everywhere else in the page...

I don't know if there is something I'm missing about the script or the UpatePanel and the partial postback... so, can anyone tell me what is happening here?

Thanks for any help

AlexPhi

hello.

well, i'm assuming that you've placed the links inside the updatepanel...in that case, the xml-script will be discarded since those objects will be destroyed (ie, replaced), when the client receives the new html sent from the server. if this is your scenario, then you must introduce the xml-script during all the postbacks (i think that you might have to build an extender that adds this code to the page during all the postbacks).

Atlas Re-Orde List - DataBinding from SQL 2005

I've had no problems working with this control using DataSources declared in the .ASPX page. However, I am having a fun time trying to get this working with DataBinding from our DataBase.

Where I have gotten so far:

List Renders

List Will Re-Order perfectly

List Will Post Back only to the Page_Load event... no other event

I have the event: rlValues_ItemReorder declared and it should be going to that event, but it doesn't.

During postbacks to the server, I check to see how many items the Re-Order list has in it, and it tells me 0. I had the original DataBinding in an if(!IsPostBack) on the page load, and I've changed it so it binds on each page load. I'm not sure which one I need.

Here is the code I am working with:

Item.Fields.FieldList objFieldList;

int intFieldID = 1;

protectedvoid Page_Load(object sender,EventArgs e)

{

objFieldList =newItemManagement.Item.Fields.FieldList(base.GeneralSettings.ConnectionString, intFieldID);

BindData();

}

privatevoid BindData()

{

rlValues.DataSource = objFieldList.ListValues();

rlValues.DataBind();

}

protectedvoid rlValues_ItemReorder(object sender, AtlasControlToolkit.ReorderListItemReorderEventArgs e)

{

thrownewException("The method or operation is not implemented.");

}

protectedvoid btnInsert_Click(object sender,EventArgs e)

{

if (txtValue.Text !="" && txtText.Text !="")

{

objFieldList =new ItemManagement.Item.Fields.FieldList(base.GeneralSettings.ConnectionString, intFieldID);

objFieldList.InsertValue(txtText.Text,Int32.Parse(txtValue.Text));

BindData();

}

}


Here is the .aspx side I'm working with:

<atlas:scriptmanagerid="ScriptManager1"EnablePartialRendering="true"runat="server">

<ErrorTemplate>

<divstyle="padding: 12px; width: 400px; height: 140px; border: #000000 1px solid;

background-color: white; text-align: left">

An error has occurred:<br/>

<spanid="errorMessageLabel"runat="server"></span>

<br/>

<br/>

<inputid="okButton"runat="server"type="button"value="OK"/>

</div>

</ErrorTemplate>

</atlas:scriptmanager>

<divclass="reorderListDemo">

<atlastoolkit:reorderlistid="rlValues"runat="server"

allowreorder="true"draghandlealignment="Left"iteminsertlocation="Beginning"

datakeyfield="FieldListValueID"sortorderfield="Order"Width="90%"OnItemReorder="rlValues_ItemReorder">

<ItemTemplate>

<divclass="itemArea">

<asp:LabelID="lblText"runat="server"Text='<%# Eval("Text")%>'/> |

<asp:LabelID="lblValue"runat="server"Text='<%# Eval("Value")%>'/>

</div>

</ItemTemplate>

<ReorderTemplate>

<asp:PanelID="Panel2"runat="server"CssClass="reorderCue"> </asp:Panel>

</ReorderTemplate>

<DragHandleTemplate>

<divclass="dragHandle"> </div>

</DragHandleTemplate>

</atlastoolkit:reorderlist>

<hr/>

<asp:LabelID="lblOutput"runat="server"/>

<hr/>

Value:<asp:TextBoxID="txtValue"runat="server"/>

<br/>

Text:<asp:TextBoxID="txtText"runat="server"/>

<br/>

<asp:ButtonID="btnInsert"runat="server"Text="Insert"OnClick="btnInsert_Click"/>

</div>

Any help would be awesome.

Thanks.

I believe you need to rebind each time. Without rebinding the list thinks it has zero members, and (using the latest drop from CodePlex) throws exceptions in (as I recall) reorderList.cs ('Item index > count' or something like that). Further code there invokes the Reorder function, so if it bombs out your reorder function never gets called.

The main issue I see with my example is that It never hits the re-order event (if that is what you mean).

The Version I'm using is the newest one from CodePlex... but I have yet to see any errors from the control.


Shawn helped me with this. If I take the Order field out (seeing i'm binding with an IList) it works perect.

Atlas problem with page base class structure

Hi there,

I'm working on a ASP.NET 1.1 application that was converted to 2.0. Instead of using master pages and templates in uses inherited base page classes to ensure consistancy of look, feel and functionality across all the pages.

The base class from which all pages inherit builds the html structure of the page. All that's in aspx page is:

<%@dotnet.itags.org. Page language="c#" Inherits="F360.PresentationTier.Testing.AJAX" CodeFile="AJAX.aspx.cs"%>
<head runat="server" id="headTag" />
CodeBehind is:
public partial class AJAX : BasePageHtmlAndNav

When creating pages the developer can drop in controls into the aspx page but the headers, footers, structure and menus etc are all built by the base page in OnInit

Ok, on to my ATLAS issue:

I've tested a simple updatePanel using a standard WebForm template and it works great. However when I try to add a ScriptManager and UpdatePanel to a page derived from our base class structure described above the updatePanel doesn't update. An asynchronous postback is made and the server-side event is triggered but the contents of the panal doesn't change.

I know it's hard to fathom what's going on here without full details of our base page class structure but if anyone has any ideas I'd appreciate it as I'm very keen to integrate the ATLAS framework in future applications that we'll be developing here.

Many thanks

MatOk, having read some posts on ATLAS problems with Master pages I did some tinkering and found the strangest (to me) of issues. ATLAS works fine with the base class structure outlined in my previous if there are no linked style sheets in the <head> tag. As soon as I add a style sheet (dynamically) to the head tag at runtime (as a LiteralControl) the updatePanel does not refresh. Does anyone have any idea why tis might be?

N.B. It makes no difference what is in the stylesheet. The problem still occur even when the links style sheet is empty.

Thanks

Mat

hello.

well, i'd say that you're generating a non valid xml element, ie, you're probably not closing the html element that is being sent to the browser. you can easilly verify this by using fiddler. what you must know is that, currently, the contents of the head section (if you have it with runat="server") are sent inside an xml message generated by the server in response to a partial postback and they aren't eascaped by using a cdata section. so, it's important to make sure that the contents of the head element are well formed xml elements.

btw, the correct way to identify a stylesheet to the page is to sue the htmllink element:

HtmlLink link = new HtmlLink( );
link.Href = "caminho ate Css file";
link.Attributes.Add( "rel", "stylesheet" );
link.Attributes( "type", "text/css" );
this.Header.AddParsedSubObject( link );


Hi there,

Thanks for the info. You were spot on. One of the style tags wasn't closed and when I corrected that worked... kind of!

The first postback is fine. However on the second postback I get the following error and IE crashes:

Unhandled exception at 0x7dd47bb3 in IEPLORE.EXE: 0xCOOOOOO5:
Access violation reading 0x0000004
Any ideas anyone?

And thanks for the tip regarding stylesheet link. I'll sort that out.

Mat


hello.

can you test that in another browser? it may be a problem with your ie...


Thanks for you're assistance. I got to the bottom of it in the end. I doubt anyone else will have a similar issue but I'll outline it anyway.

The application I'm working on used a CSS unorder list dropdown menu, as descibed here:http://www.tanfa.co.uk/css/examples/menu/tutorial-v.asp

To make the menu work correctly in IE an htc behaviour had to be attached to the body tag in the stylesheet. It was this beahviour that was causing IE to crash when asynchronous calls were being made. (No idea why). When I removed the behavious ATLAS worked fine. I have since changed the very light CSS menu for a third party control and now have both ATLAS functionality and a funky new menu. All good.

Thanks again

Mat


Can you explain better the solution...?
I have exactly the sameproblem... and I use a similar menu fromWebFX and I followed your linkbut I don't understand what's the problem generating the crash muchless the solution proposed...

Thanks
Agapito