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

Wednesday, March 28, 2012

Accordeon wont work - please help a newby

Hello,

I am new to Atlas and trying to use accordeon extension from the toolkit. I have installed the toolkit and AjaxControlExtender, then created a web site with ajax-toolkit template and added accordeon control from toolbox to the Default.aspx

I get a few error messages:

Error 1 Type 'AjaxControlToolkit.Accordion' does not have a public property named 'AccordionPane'. c:\inetpub\wwwroot\eBible-ajax\Default.aspx 13
Error 2 Type 'AjaxControlToolkit.Accordion' does not have a public property named 'AccordionPane'. c:\inetpub\wwwroot\eBible-ajax\Default.aspx 16
Error 3 Content ('</ajaxToolkit:AccordionPane> </ajaxToolkit:AccordionPane>') does not match any properties within a 'AjaxControlToolkit.Accordion', make sure it is well-formed. c:\inetpub\wwwroot\eBible-ajax\Default.aspx 16
Error 4 Accordion1:Type 'AjaxControlToolkit.Accordion' does not have a public property named 'AccordionPane'. c:\inetpub\wwwroot\eBible-ajax\Default.aspx http://localhost:8080/eBible-ajax/

I guess I am missing something, possibly a very simple thing that is well knows to you guys but not yet to me. Below is how the pages' code looks. Thanks for help!

<%@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></head><body> <form id="form1" runat="server"> <asp:ScriptManager ID="ScriptManager1" runat="server" /> <div> <ajaxToolkit:Accordion ID="Accordion1" runat="server" Width="250px"> <ajaxToolkit:AccordionPane ID="AccordionPane1" runat="server" ContentCssClass="" HeaderCssClass=""> </ajaxToolkit:AccordionPane> <ajaxToolkit:AccordionPane ID="AccordionPane2" runat="server" ContentCssClass="" HeaderCssClass=""> </ajaxToolkit:AccordionPane> </ajaxToolkit:Accordion> </div> </form> </body></html>
Hi,


Sorry about that .

We dont see the @.Register tag in your page to register the AjaxControlToolkit process.

Can you add this line after the @.Page tag ?

<%@. Register Assembly="AjaxControlToolkit, Version=1.0.10123.0, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>

nope, doesn't help - same errors

it should be like this i believe

<ajaxToolkit:Accordion>

<Panes>

// panes in here

</Panes>

</ajaxToolkit:Accordion>



Figured this out, too. The Panes tag is not added for some reason when you add panes from properties box (panes -> collection -> add). Weird.

Thanks anyway.


Hi there,

you should check out the introductory video on this site

http://www.asp.net/learn/videos/view.aspx?tabid=63&id=87

cheers!

Accessing variables from OnComplete

Hello guys, we've been trying to convert our web app to Atlas from AJAX.NET and ran into a bit of a problem with the way our AJAX calls are structured.

Take, for example, this hypothetical function:

function getAlbumName(aID)
{
PlanetEye.GTTS.AjaxService.getAlbumName(aID, OnComplete)
}
function OnComplete(result)
{
document.getElementById("albumDiv").innerHTML =result;
}
Now, my question is: Is there a way to access the aID variable from within the OnComplete function? For example, if I want the innerHTML to read something like -"id: "+aID+" name:"+result

Back when we were using AJAX.NET we avoided the call back function all together so that we could just say:albumName =PlanetEye.GTTS.AjaxService.getAlbumName(aID);and continue on with the getAlbumName function, but i dont' think that's possible with Atlas, is it?

Thanks for any help, or pointers in the right direction Smile [:)]

Yep, you can use the userContext parameter which gets passed into the OnComplete callback, there's a few ways to specify the userContext, its probably best for me to just point you at the docs,

http://atlas.asp.net/docs/atlas/doc/services/consuming.aspx#alt

I believe your OnComplete will need to look like this once you update the call:

OnComplete(result, response, userContext)...

And you would just need to pass your aID as your userContext...

Hope that helps,
-Hao


HaoK:

Yep, you can use the userContext parameter which gets passed into the OnComplete callback, there's a few ways to specify the userContext, its probably best for me to just point you at the docs,

http://atlas.asp.net/docs/atlas/doc/services/consuming.aspx#alt

I believe your OnComplete will need to look like this once you update the call:

OnComplete(result, response, userContext)...

And you would just need to pass your aID as your userContext...

Hope that helps,
-Hao

This part motivated me to research a bit more about this in the search for the solution my needs. I was used to AJAX.NET in the way that I were able to get a result without having to write a callback function. For example (pseudo code):

1// Function called from any button2function PerformTasks(controlid, 2ndParam)3{4 // Ajax call5 res = AjaxMethods.GetResults(2ndParam);67 // Do the stuff needed8 document.getElementById(controlid).innerHtml = res.value;910 // Other logic11}

Using new WebMethod logic we need to pass parameters to the OnComplete function. We can do this using one value ou several becauseuserContext can be any JavaScript primitive type, array, or object. So consider this:

1// My example function called from an OnCLick event2function CommentFile(sFilename, drpClientID)3{4var arrUserContext = new Array();5arrUserContext[0] = sFilename;6arrUserContext[1] = drpClientID;78EntitiesService.GetFileNotes(sFilename, OnCommentFile, OnCommentFailure, arrUserContext);91011}1213// The OnComplete function14function OnCommentFile(arg, arrUserContext)15{16var sFilename = arrUserContext[0];17var drpClientID = arrUserContext[1];1819drpTmp = document.getElementById(drpClientID);20drpRevisionValue = drpTmp.options[drpTmp.selectedIndex].value;2122alert(arg);2324// all the logic from here, we can use the return arg and the param(s) from the source function that is triggered from any link, etc.2526}2728// The OnFailure function29function OnCommentFailure()30{31// Empty32}
My problems are solved with this solution.

Accessing values from dynamically created controls

Hi. I'm writing a web application that uses Atlas todynamically create controls in a specific section of a web page. I have 2 update panels. One of them contains a DropDownList. The other one will contain thedynamically created controls. The controls are created in the SelectedIndexChanged event of the DropDownList, and I coded that in the server side. All those controls are arranged in a table server control, which is also created in the SelectedIndexChanged event. The page also has a Button server control that will allow me to start processing the values entered by the user in the created controls. Of course this processing will be done in the server side. This button is not part of either update panel.

Now, the problem is that when I try to get the values of the controls in the Button Click server event, using the table.FindControl() function, I see that the table itself is null, so I cannot access any control value. I think the problem has to do with the fact that the table and its controls are created in the update panel, and for some reason everything created there is not available for my Button Click server event.

How can I solve this scenario?

Thanks,

Julio

Modifying the controls colletion during a postback is generally not a good idea in ASP.NET. Additionally, dynamically added controls will not persist through viewstate so you'll have to re-create and add them to the container on each postback.

Instead of adding/removing controls, I suggest you use the "Visible" property of the control. You can set the control.Visible=false, which will prevent it from rendering down to the client.

Hope this helps,

-Tony


Thanks a lot Tony. The problem is that the user can choose 25 different elements in my combobox, and each element will require to create/show from 1 to 20 new controls on the dynamic section of the page. So if I take your advise and just put all possible controls on the page on design view, hidding or showing them asappropriate, wouldn't it be too much overhead for my page?

Julio


Julio,

Any way you choose is going to require quite a bit of code on your end to determine when to show/hide or create/destroy controls. You are correct in that should you choose to instantiate all controls on the page load, it will indeed add extra overhead.

To acheive the results you are looking for, you'll need to test for which item is selected, and fill the update panel accordingly. The earlier this happens in the page lifecycle the better off you are. The one problem you might encounter is that replacing a control on the fly like this, could cause viewstate errors since the control which saved its viewstate in the previous response, has now been replaced with a completely different control.

We've actually built the behavior you're looking for directly into the Infragistics WebTab. It provides LoadOnDemand behavior though an AJAX mechanism. Using a Tab Interface also speeds up the development since you can separate your content into individual tabs, displaying only the relevant tab. In most cases the performance overhead incurred is well worth the development time saved. Of course, you'd need to make that call based on your own project requirements.

Hope this helps,
-Tony


Hi Tony. You are completely right. I have just found that viewstate error you mention. I have tried to control that error, but I just keep getting errors when adding/removing controls. I would like to try using Infragistics WebTab, as our company has full licenses for the NetAdvantage suite. Could you please show me a small example of how could I achieve this behavior with the WebTab and the LoadOnDemand behavior? Or maybe give me a link to an example? I would reallyappreciate it.

Thanks a lot for your help,

Julio


Hi Julio,

You'll need to getNetAdvantage 2006 Volume 2 if you don't already have it. On the WebTab, set AsyncMode=On, and AsyncOptions.EnableLoadOnDemand=True. Next, using the interactive design surface, simply drag and drop your content into the desired Tab pane. You can even switch between tabs by clicking the desired tab on the design-surface. The WebTab has UpdatePanel-like behavior built directly into it, so postbacks will automatically be turned into AJAX callbacks. The LoadOnDemand behavior will also enable the initial page load to contain only the content for the selected tab, all other tab content will be dynamically retrieved as necessary.

Hope this helps,
-Tony


Hi Tony. It seems likeUltraWebTabAJAX features won't help me. Theasync behavior I'm looking for starts outside the tab control, but not in the tabs itself. My UltraWebTab has 25 tabs inside it. I also have a dropdownlist which is outside my UltraWebTab. Now, without any AJAX behavior, what my page does is that, when you select an element in the dropdownlist I hide all the tabs except for the one that is related to the selected value on the dropdownlist. This of course causes a full roundtrip to the server.

So, what I'd like to happen is that, when I change my selection on the dropdownlist, all the not related tabs just become invisible, but with no roundtrip. I enabled all the async options you mentioned, but I thing they are mostly targeted for the scenarios where the user navigates between tabs, and no with my particular scenario. So I just thought I could solve this by adding an Atlas UpdatePanel and putting the UltraWebTab inside it. I also added a trigger to the panel so that any time the dropdownlist change its value, the updatePanel would update its contents.

Here is the code for my DropDownList:

<table>

<tr>

<tdstyle="width: 3px"valign="top">

<asp:DropDownListID="MyDropDownList"runat="server"AutoPostBack="True"DataSourceID="MyDataSource"DataTextField="Description"DataValueField="Id"></asp:DropDownList><asp:ObjectDataSourceID="MyDataSource"runat="server"SelectMethod="GetMyItems"TypeName="MyProduct.MyClass"></asp:ObjectDataSource></td>

</tr>

</table>

...And this is the code for the UltraWebTab and the UpdatePanel:

<table>

<tr><tdstyle="width: 239px; height: 101%;"valign="top"><atlas:UpdatePanelID="Up1"runat="server"Mode="conditional"><ContentTemplate><igtab:UltraWebTabID="MyUltraWebTab"runat="server"BorderColor="#949878"BorderStyle="Solid"BorderWidth="1px"ThreeDEffect="False"SelectedTab="16"AsyncMode="On"><DefaultTabStyleBackColor="#FEFCFD"Font-Names="Microsoft Sans Serif"Font-Size="8pt"ForeColor="Black"Height="22px"><PaddingTop="2px"/></DefaultTabStyle><Tabs>

<!--Here comes my Tabs and controls -->

</Tabs><RoundedImageFillStyle="LeftMergedWithCenter"HoverImage="[ig_tab_winXP2.gif]"LeftSideWidth="7"NormalImage="[ig_tab_winXP3.gif]"RightSideWidth="6"SelectedImage="[ig_tab_winXP1.gif]"ShiftOfImages="2"/><SelectedTabStyle><PaddingBottom="2px"/></SelectedTabStyle><BorderDetailsColorBottom="90, 120, 160"ColorRight="90, 120, 160"/><AsyncOptionsEnableLoadOnDemand="True"/></igtab:UltraWebTab></ContentTemplate><Triggers><atlas:ControlValueTriggerControlID="MyDropDownList"PropertyName="SelectedValue"/></Triggers></atlas:UpdatePanel></td>

</tr>

But now I'm just getting an "Unknown Error" popup window every time I change my selection in the dropdownlist. It seems like any combination of UltraWebTab and UpdatePanel just does not work. I have already written Atlas apps with my current installation (June CTP) and they work fine until I add an UltraWebTab. All Atlas configurations in the web.config and the script manager are on place, so it should work.

Is there a known compability issue between UltraWebTab and UpdatePanel? If it is, is there any way I could achieve my desired behavior with UltraWebTab async and loadOnDemand options?

Thanks a lot,

Julio


Hi Julio,

You should contact Infragistics Developer Support and provide them the details above. A hotfix was made available on Friday, July 28th which may address this issue.

-Tony

Monday, March 26, 2012

Accessing ASP.NET Session object during calls to Web Service Bridge?

Hi there,

Just getting started with the Web Service Bridge, looking at the MSN search example.

I've built my own Atlas enabled ASP.NET web application and created a .asbx file that points to an external Web Service and I can call methods on the Web Service through the class I derived from BridgeHandler, so all looking good.

Now I want to be able to make my BridgeHandler derived class interact with the ASP.NET Session object to set and retrieve session data from within my ASP.NET web application.

I can't see a way I can get at the Session object once I'm in my BridgeHandler derived class? Is this possible, or is there a way the Session or Context object can be passed as a parameter to my BridgeHandler derived class through the .asbx file?

I notice the MSN example uses the following syntax to pass a value stored in the Web.config as a parameter:

<parameter name="appId" value="% appsettings : MSNWalkthroughAppId %" serverOnly="true" /
Is there simlar syntax for passing the Session object? Are the options for what you can do in between the %% tags documented anywhere?

Thanks,

Mark

Hi Mark,

Right now we don't support an expression for session within %%, but we will consider adding it in the future. You can get access to Session thru HttpContext, which you can access thru HttpContext.Current...

In terms of expressions currently supported:

args: request args
appsettings: config
resultschain: see quickstart on chaining bridges declaratively
querystring: useful if you use HTTP get to make your bridge requests

Hope that helps,
-Hao


Doh, actually it turns out you can't access Session thru HttpContext.Current because we aren't emitting the proper interface on the generated class, so we'll definitely need to enable this in a future release, but at this time you unfortunately don't have any way to get to the session data...


Thanks for the response. I've just install the April release of Atlas and it doesn't appear to be in there yet either. Looks like I'll have to wait and in the meantime keep experimenting with other parts of Atlas.

Don't suppose you can give me any idea roughly when this feature will be included? (a bit hopeful I know :-)

BTW - does the current 'Context' object on the BridgeHandler class do anything useful at this stage? I get an exception 'Accessing context too early, it is null' exception when attempting to use that object.

Cheers,

Mark

Unfortunately this came up too late to get into the April CTP, but most likely we will get it in the next CTP...

You should be able to access the BridgeHandler.Context from within any of the bridge pipeline methods, basically the first thing that BridgeHandler.Invoke does is build the Context, so within the other virtual methods that you override, you should be able to access the BridgeContext, where are you trying to use the Context object?

Hope that helps,
-Hao

Accessing ASP.NET Profile

Hi,

How can I update Profile propertys in my Atlas application? Since I don't use update panels, I call web services to make server requests. I know that I can access the Session by declaring [WebMethod(EnableSession=true)], but can I also enable Profiles there?

Or are there alternatives to web services?

In javascript, you access profile properties using something like:

Sys.Profile.properties["list"] = [1, 2, 3];

And then you want to call:

Sys.Profile.save();

To enable this feature, you do need to have a few things in config defined:

<configSections>
<section name="profileService" type="Microsoft.Web.Configuration.ProfileServiceSection" requirePermission="false" />
</sectionGroup>
</configSections>

<microsoft.web>
<profileService enabled="true" getProperties="*" setProperties="*" />
</microsoft.web>

This will enable atlas access to the Profile object, and let you get and set all properties, note you can lock down which propeties you want get/settable thru atlas using the get/setProperties in the profileService section.

Hope that helps,
-Hao


Thank's a lot. After your reply I searched the atlas docs again and now I have no clue, why I overlooked the profile topic before!Wink [;)]

This feature is so cool!Cool [cool] I love Atlas more everyday...

Accessing a WebService-Method

Hello, i was migrating from Atlas July-CTP to Beta 2.

Now get an error when i call my webservice from javascript and the message is talking about System.InvalidOepration and authentication failed,

but only when I mark the corresponding method with EnableSession= true. In Atals JulyCTP the same call worked fine. Is there maybe a change in security-model?

Did I forget something or a declarartion is not set right?

Can anybody explain?

Hallo Michael,

can you show us the code of youre WebService definition?

Servus
Klaus


Check to see if your Web service definition has the ScriptService attribute (http://ajax.asp.net/docs/mref/8bb8cdde-6050-e492-e72a-eed2242c213c.aspx).
I believe the CTP version didn't have this attribute.


using System;

using System.IO;

using System.Web;

using System.Collections;

using System.Collections.Generic;

using System.Threading;

using System.Web.Services;

using System.Web.Services.Protocols;

using System.Xml.Serialization;

using System.Web.UI.WebControls;

using Microsoft.Web.Script.Services;

[ScriptService]

[WebService(Namespace ="http://tempuri.org/")]

[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]

publicclass VehicleDataService : System.Web.Services.WebService

{

This Method is accessible, because it's called from Ajax:AutoCompleteExtender

[WebMethod(EnableSession =true)]

publicstring[] GetColors(string prefixText,int count)

{

string[] autoCompleteColors =null;

//Ablauf analog zu oben lediglich für Color statt für Model/Manufacturer

User user = SessionData.User;

if (autoCompleteColors ==null)

{

autoCompleteColors = VehicleDataUtils.GetColorsAsStringList(user);

}

int index =Array.BinarySearch(

autoCompleteColors, prefixText,

newCaseInsensitiveComparer());

if (index <0)

{

index = ~index;

}

int matchingCount;

for (matchingCount =0; matchingCount < count

&& index + matchingCount < autoCompleteColors.Length; matchingCount++)

{

if (!autoCompleteColors[index + matchingCount].StartsWith(

prefixText,StringComparison.CurrentCultureIgnoreCase))

{

break;

}

}

String[] returnValue =newstring[matchingCount];

if (matchingCount >0)

{

Array.Copy(autoCompleteColors, index, returnValue,0, matchingCount);

}

return returnValue;

}

This method is'nt accessible, it's called from pure javascript in a javascript-source file.

///<summary>

/// Setzt den aktuellen Hersteller (Name)

///</summary>

///<param name="input">Name des Herstellers</param>

[ScriptMethod]

[WebMethod(EnableSession =true)]

publicvoid SetActualManufacturer(string input)

{

SessionData.VehiclePageManufacturer = input;

}

}


Hello Michael,

maybe i'm wrong, but for me is VOID in a webservice a "not so god idee". You get absolut no response from this methode. It's not better to create an object with a returnvalue and react to the returnvalue?

It's only a idee.


The web service code seems OK. I don't know exactly how you're invoking the web service.
As you described, probably you don't have an aspx page with service reference configured using this web service. Adding a service reference to your page, makes AJAX download or include in the web page the proxy code (depending on the parameters you provide).
Check the proxy code that your service generates and see if it helps you (you can check that looking athttp://yourserverver/yourService.asmx/js - you just include /js after your web service address).

HTH,

Maíra

Accessibility with Atlas/Ajax

While not specifically an Atlas question it is one that I would like to know and understand a little bit more about. How does Atlas handle Accessibility (Section508) types of issues? What happens with screen readers when the results from an Atlas application update UI elements?Using something like Atlas does not meet accessibility standards. To meet accessibility you can only use javascript to enhance functionality. It cannot be the only source of functionality. You need to write pages assuming that javascript is not available.

There are different levels of accessibility. The strictest levels (which very few applications are able to reach) prohibit javascript entirely. More pragmatic levels authorize the use of javascript. Script can even make a site more accessible for example by providing better keyboard access than is possible using plain HTML. Screen readers actually have few problems with javascript sites as long as they don't unexpectedly pop out things without the user's consent.
Accessibility will be a key goal for Atlas. The current bits are very early and may not show that very clearly, but if you look at the hoverBehavior for example, you'll see a place where Atlas already makes it easier to write accessible sites. If you use the hover behavior, the actions that you attach to the behavior will be triggered if the mouse hovers over the elementor if the focus is transmitted to that element. That means that in one simple operation, you've made the control accessible whereas it would have taken about four HTML events to get the same results without Atlas.


For those of you didn't know who I am: I am the author of the Ajax.NET and Ajax.NET Professional library. The library is doing the same JSON formatting like the Atlas Framework is doing. I think I have it already online since March this year, and the feedback I got was great.
If I look in my weblogs (per month about 20 GB without the AJAX requests) I see that there is very small count of users that are not able to run AJAX (and JavaScript) related web sites. Is your web page viewable in an lynx browser? I think there will be a change in the future. Currently we have a lot of web pages that only display news or product information. Other web sites are working as web applications, more UI elements. Those applications will use AJAX in the future to get the most from the browsers. The users of such applications will have by default installed current browsers. So, I do not see any problem to have web applications running JavaScript.
The more big problem is on Internet Explorer that users can deactivate secure ActiveX controls that are needed to run AJAX web applications. I have written a blog about how to use IFrames instead of the Microsoft.XMLHTPP object:http://weblogs.asp.net/mschwarz/archive/2005/08/24/423495.aspx.
As I heared already here at the PDC the next Internet Explorer will have a built-in object like Firefox or Mozilla browsers have today.


Does this mean Atlas will eventually output correct XHTML 1.0 Transitional or will it still be XML based?
It is good that this will work in a large range of browsers, but verybad if it requires XML on the markup page. I would prefer to see markupthat ;meets W3C specifications. This could easily be done by the use ofthe class property and still retain all the same features as presentlydemonstrated, yet also add a host of additional capabilities, includingaccessibility features.
Our corporate firewall for 65000+ desktops strips all XML content, aswell as defanging all references to ActiveX objects, including XMLHTTPobject.
John Davidson

Interesting idea, John. In the classic tradition of community driven involvement, may I ask you to provide a small snippet of the kind of syntax you have in mind. I think I understand your suggestion but I want to be certain. Seeing a sample of the kind of syntax you would prefer would help a lot. THANKS.
It should be pointed out that an Atlas page that's correctly written is XHTML-compliant and meets W3C specifications. The X in XHTML stands for eXtensible, and the Atlas markup is just an extension that is understood by the Atlas script library.
I am using a Atlas quickstart sample for deomonstration from:
http://atlas.asp.net/quickstart/atlas/samples/data/itemview.aspx
The section of code I have concerns with from that page are:
<script type="text/xml-script">
<page xmlns:script="http://schemas.microsoft.com/xml-script/2005">
<components>
<dataSource id="dataSource" serviceURL="SampleDataService.asmx"/>

<itemView targetElement="detailsView">
<bindings>
<binding dataContext="dataSource" dataPath="data" property="data"/>
<binding dataContext="dataSource" dataPath="isReady" property="enabled"/>
</bindings>
<itemTemplate>
<template layoutElement="detailsTemplate">
<textBox targetElement="nameField">
<bindings>
<binding dataPath="Name" property="text" direction="InOut"/>
</bindings>
</textBox>
<textBox targetElement="descriptionField">
<bindings>
<binding dataPath="Description" property="text" direction="InOut"/>
</bindings>
</textBox>
</template>
</itemTemplate>
</itemView>

<button targetElement="previousButton">
<bindings>
<binding dataContext="detailsView" dataPath="canMovePrevious" property="enabled"/>
</bindings>
<click>
<invokeMethod target="detailsView" method="movePrevious" />
</click>
</button>
.
.
.
</components>
</page>
</script>
The way I would like to see this output is that render elements are defined with the appropriate xhmtl tag that is already defined. Non-render elements would use the <div> tag if they had no additional properties beyond the class name or for single properties and the <input type="hidden" ... /> tag would be used for those non-render elements with additional properties.
<div class="page">
<div class="components">
<input type="hidden" id="dataSource" value="SampleDataService.asmx" />
<div class="itemView" id="detailsView">
<div class="bindings">
<div class="binding">
<input type="hidden" class="dataContext" value="dataSource" />
<input type="hidden" class="dataPath" value="data" />
<input type="hidden" class="property" value="data" />
</div>
<div class="binding">
<input type="hidden" class="dataContext" value="dataSource" />
<input type="hidden" class="dataPath" value="isReady" />
<input type="hidden" class="property" value="enabled" />
</div>
</div>
<div class="itemTemplate">
<div class="textbox">
<input type="text" id="nameField" />
<div class="template" id="detailsTemplate">
<div class="bindings">
<div class="binding">
<input type="hidden" class="dataPath" value="isReady" />
<input type="hidden" class="property" value="enabled" />
<input type="hidden" class="direction" value="InOut" />
</div>
</div>
</div>
</div>
</div>
</div>
</div>

<div class="button">
<input type="submit" class="previousButton" id="previousButton" />
<div class="bindings">
<div class="binding">
<input type="hidden" class="dataContext" value="detailsView" />
<input type="hidden" class="dataPath" value="canMovePrevious" />
<input type="hidden" class="property" value="enabled" />
</div>
<div>
<div class="click">
<div class="invokeMethod">
<input type="hidden" class="target" value="detailsView" />
<input type="hidden" class="method" value="movePrevious" />
</div>
</div>
</div>
.
.
.
</div>
</div>
The above sample syntax should demonstrate that it is possible to cover all elements that you require with Atlas within the standard. Generate this code from within visual Studio would be no more difficult than emitting the XML. The changes to the Atlas XMLDOM parser would also be minimal as all keywords are retained in correct heirarchy and keywords are all found in the class property now rather than as an XML element identifier.
I hope this adequately demonstrates what I was trying to get at.
John Davidson

To be clear the use of xmlns extensions is not conforming with the standard, but is allowed.
From the specification at:http://www.w3.org/TR/xhtml1/#xhtml

3.1.2. Using XHTML with other namespaces

The XHTML namespace may be used with other XML namespaces as per [XMLNS], although such documents are not strictly conforming XHTML 1.0 documents as defined above. Work by W3C is addressing ways to specify conformance for documents involving multiple namespaces.

The W3C document at:http://www.w3.org/TR/xhtml-modularization/xhtml-modularization.html
defines the proper method for using the extensibility features of XHTML. Atlas does not conform to these requirements (yet).
John Davidson


John, can you clarify why you claim its not conforming? Obviously we want to make sure we're not getting in the way of creating valid xhtml documents.

<script> is a standard tag introduced by the scripting module. The contents of script could be anything depending on its type (i.e. content type). If its text/javascript, the expected content is javascript code.

If its text/xml-script, its xml. The content of the script tag isn't dicatated by xhtml I think - its dictated by the type attribute on the script tag.
Note that like the w3c doc says, the <script> tag can in fact be placed in the head section if you choose to do so.


jwd wrote:

The way I would like to see this output is that render elements are defined with the appropriate xhmtl tag that is already defined. Non-render elements would use the <div> tag if they had no additional properties beyond the class name or for single properties and the <input type="hidden" ... /> tag would be used for those non-render elements with additional properties.


First of all, like Nikhil says, the atlas tags should not get in your way to conform to xhtml standards (or any other standard), since the atlas tags are placed inside script tags. If they were part of the actual document (ie. a div containing the atlas tags), then I would certainly understand your concerns.
Secondly, I personally don't like your suggested alternative. You are (mis)using existing xhtml objects (elements/attributes) to describe completely different semantics. Additionally, such an approach could break many applications as well. Using a stylesheet class to define that a div is actually a container for atlas components as opposed to a visual division could break applications that already define styles with names such as "page".
This approach is also kind of limiting. As you can see, you have to be more verbose in several cases. For example, to define a binding you are using several input tags, while Atlas provides a Binding component where you can do the same with just 1 tag and a few attributes.
It is great to suggest alternatives, but I think it is not reasonable to reuse existing tags and 1) limit yourself and 2) change their semantics.

Accessibility and Atlas

This Atlas stuff looks interesting and will make my job a whole lot easier if I can avoid fiddling with pesky Javacript!

But, my absolute priority is Accessibility. All my sites must be Accessible, which includes the content management side, and I prefer to be AAA standard.

My question is: As ATLAS is run inside ASP.NET 2.0, can I assume that I will get XHTML 1.0 Strict output? Also, is the ATLAS model accessible? ie. if JavaScript does not exist, is the user-interface still usable using alternative means (I don't mind implementing complex techniques like drag-n-drop in an alternative manner, though) and what if the user agent does not understand CSS, or uses a different CSS media, such as "mobile", "tv" or "embossed"?We're still working on accessibility. The controls are built to comply with accessibility norms by default. If there is no javascript at all, you're responsible for building your own alternative representation, Atlas can't help you as it entirely relies on Javascript. About CSS, I don't understand what the problem is: Atlas is very neutral as far as CSS is concerned so it's exactly as if you were using plain HTML.
Thanks for your response.

By "We're still working on it", do you mean it will be accessible in the final release?

Also, as regards CSS, I am not quite ready to implement richer controls in my project and have so far held off downloading anything. I didn't know the "richness" of the controls. So far so good, though.
Yes, we're very committed to accessibility and it will improve from release to release until the final one.

Access to Path denied message appears on install

Hi,

While trying to install Atlas, I get the following message - Access to the path 'C:/Program Files/Common Files/Pumatech Shared/Transaction Manager/ComponentData/TraceLogs' is denied. What do I need to do here?

Thanks,
James

Hello. I do not have much to add other than I am experiencing thesame problem. I downloaded the installer today (4 April2006). My system is Windows XP Professional, SP 2 and I havelocal admin rights to the machine.
It seems like your Blackberry synchronization application is conflicting with the install. I have no idea why but I suspect that there is something really wrong with your system. Atlas itself knows nothing of this Pumatech folder.

I am not sure why the setup will reference the Pumatech Shared folder since it should be not be related. Can you check a couple things:

- Since it was access denial error, can you check if your current user account has the access permission to the folders through the security tab of the Properties dialog of the folders?

- From some internet search results, it looks Pumatech Shared folder might be created by Pumatech Intellisync, Blackberry Desktop Software or some PDA desktop sync software. I am just curious that if you have any of such software installed on your machine. If possible, would you be able to try Atlas setup on a machine that does not have any of such software installed?

Thanks,
Frank


I do have Blackberry Desktop sync software amd the exe I use to sync upis not loaded in memory. In other words it only syncs when I tellit to, manually. I also checked Windows Services and the Sys TrayRegistry settings (HKLM\Software\Microsoft\Windows\CurrentVersion\Run)and I do not see any suspicious exe/processes either.

Oddly enough, despite having local admin rights, when I try to look atthe Pumatech Shared folder's settings it gives me a permission deniederror!

I am really at a loss, too why the the Atlas setup would want to reference the Pumatech Shared folder. A
clean reboot and then reinstall does not help either.

At this time I do not have another machine to test the install. The only consollation I have is that I am not the only one with thisvery strange problem.

Thanks guys for the replies. Any more ideas?
One more thing, if I unckeck "Install Atlas Visual Studio ProjectTemplate" from the setup. It completes successfully (other thaninstalling the template, of course).

Originally, I thought the problem may be due to having an apostrophe inmy name (o'reilly), since the templates directory is located underc:\documents & settings\o'reilly\visual studio 2005\......, etc.

Today, I copied the contents of C:\Documents andSettings\o'reilly\My Documents\Visual Studio 2005 and pasted it toC:\Dev. I then went through the Visual Studio 2005 optionsettings and changed every pertinent setting I could to point toc:\dev\Visual Studio 2005\...

So at this point I am really grasping at straws as to why this installer is not working properly.
"I am not sure why the setup will reference the Pumatech Shared folder since it should be not be related. "

Not only does theWindows Installer Component(msiexec.exe) references this folder, it accesses alot of other foldersthat are unrleated to access. This is alarmingly so when viewingthe installer activity using sysinternal's FileMon utility.

I also had the same problem. I uninstalled the Blackberry Desktop app with Add Remove programs and this did not remove the \Pumatech Shared\ directory. So I uninstalled the Yahoo calendar sync desktop app I installed that this did not remove it. I went into the \Pumatech Shared\ directory and ran all the uninstall.exe's within the subdirectories. When I attempted to delete the directory, I hit a permission problem. I tried again to access the \Trace Logs\ directory and got a message that I could not change permissions, but could take control of the directory. So I did. I had right clicked, clicked Properties and clicked Security tab and change the owner from null to me. Then I gave myself full control of the \Trace Logs\ directory. I had repeat this process for the two xml files contained with in. Once I did that, I could delete the entire Pumatech directory. With this in the trash, I was able to install Atlas including the template. I haven't seen that I have caused any more problems by doing such a brute force uninstall, but I just finished doing this a few minutes ago. My system hasn't crashed yet and I don't forsee that this would cause any problems, so I'm feeling pretty confident. I'll see what happens next. :) Hope this helps. Dean

The setup is searching through C:\Program Files\Common Files to look for VSContentInstaller.exe to launch the VSI installation. There might be some problem when it cannot access some folder under the directory. I will investigate further and see exactly what happens under this condition. Please stay tuned.

Thanks for providing all the info, it has been really helpful to narrow down the area of the problem.
Frank


By the way, as mentioned by "Life of Riley" above, a workaround is that you uncheck "Install Atlas Visual Studio Project Template" during setup. Once setup is done, you go to "C:\Program Files\Microsoft ASP.NET\Atlas\v2.0.50727" and open ASPNETAtlas.vsi. This should install the Atlas template properly.

Just an update on this, the above issue of access denied to an unrelated folder has been fixed and the next release of Atlas will not have the same issue.

Thanks,
Frank

Access Textbox Inside an Atlas CollapsiblePanel

Hello all, I have this code

<%

@dotnet.itags.org.RegisterSrc="~/Controls/CollapsibleContent.ascx"TagPrefix="collapsible"TagName="CollapsibleContent" %>

<collapsible:CollapsibleContentID="generalPanel"IsCollapsed="false"runat="server">
<Title>Datos Generales del Documento</Title>
<Content>
<tablewidth="100%"border="0"cellspacing="0">
<tr>
<tdstyle="text-align: left; width:15%">
<asp:LabelID="lblFormItem1"runat="server"Text="Titulo"></asp:Label>
</td>
<tdstyle="text-align: left; width:25%">
<asp:TextBoxID="txtFormItem1"runat="server"MaxLength="50"Width="85%"Enabled="false"></asp:TextBox>
<asp:RequiredFieldValidatorID="RequiredFieldValidator3"runat="server"ControlToValidate="txtFormItem1"ErrorMessage="this is a required field, can't be null"ValidationGroup="Page">*</asp:RequiredFieldValidator>
</td>
</tr>
</table>
</Content>
</collapsible:CollapsibleContent>

I'm trying to access the value of the textbox but when I build my solution, the debuger send that the txtFormItem1 doesn't exist, I have tried to do this

TextBox txt1 = (TextBox)this.Page.FindControl("txtFormItem1");
if (txt1 !=null)
{
txt1.Enabled = !txt1.Enabled;
}

Can anyone help me please. Thanks.

Try

generalPanel.FindControl("txtFormItem1");


I haven't tryed to reproduce your issue but feel questions:

Why are you using FindControl if you haven't instantiated the control dynamicly? just access txtFormItem1.Text...

if it doesn't work, download the latest release from codeplex... an issue about blank textboxes was resolved...

Hope helped...

Regards,

Felipe Oquendo
MCAD


sburke_msft:

Try

generalPanel.FindControl("txtFormItem1");

it would work too...

Access SiteMap via Web Service

This is not strictly an Atlas question, but it seems that someone here is most likely to be able to help.

To build an Atlas enabled menu control, I'd like to be able to get access to my sites SiteMap data via a web service. And ideally, I'd like to be able to access data from custom SiteMapProviders in this way.

Is this possible?

Thanks

Ok, so I don't know what I was doing wrong, but I was under the impression that I couldn't get to the SiteMap from the context of a web service. I was wrong.Smile

Access Session in WebMethod

I am trying to access the Session from an ATLAS WebMethod. My session is always equal to null. I am calling the method from javascript. How do I access the session?

[WebMethod]

publicbool DoStuff()

{

if (Session["Data"] !=null)

{

}

Thanks

You need to use [WebMethod(true)] to enable the session from that web method.

Access custom server classes from Javascript

I am in the process of migrating my VS2005/Atlas app to VS2008/ASP.Net AJAX.

In the old app I could instantiate custom c# classes on the server from within javascript.

An example would be var myObj = new MM.Test();

In the new app this no longer works and throws the 'object expected' exception.

Any ideas what I need to do in order to get this to work?

You have to mark your Webservice/WebMethod with the GenerateScriptType attribute which will include the server side types that you need to create in the client. for the above you have to add the following:

[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[ScriptService]
[GenerateScriptType(typeof(MM.Test))]
public class MyService
{
.........................
.........................
}


Thanks for that.

Should intellisense sense then work on the members of this class?

Also, my usage is more complex than that. I have a class named Contract that has a generic collection as one of its members. You don't seem to be able to use GenerateScriptType with generic collections so how do I access the collection and its members (specifically the add method.which worked fine using VS2005/Atlas)?

public class Contract
{
public Contract();
public PeriodCollection Periods { get; set; }

}

public class PeriodCollection : Collection<Period>
{
public PeriodCollection();
public string Year { get; set; }
}


I think the intellisens should work if you are working in VS2008.

You do not have to worry about the Collection, it will be convertet to JS Array no matter it is Generic or Regular Collection.

In that case you should add more than one GenerateScriptType in your Web Service or WebMethod.

[GenerateScriptType(typeof(class1))]
[GenerateScriptType(typeof(class2))]
[GenerateScriptType(typeof(class3))]
public class MyService{
}

Hope this will help .and mark it as answer if it solves your issue.

Access credentials are not being loaded when use Atlas functionality

Facing this bizzare issue of access denied when use Atlas funcationality. I am using UpdatePanel in two .ascx controls that searches a list(list is on one .ascx and search button is on the 2nd .ascx).Everything works fine(i.e performs search in an Atlas way - no whol page refresh) but it generates an error on the browser that says..

A run time error has occured..

Line: 86762781

Error: Object expected.

When i see the log file at c:/windows/system32/Logfiles/ W3SVC1.. i see

That request is using 127.0.0.1 as the credentials instead of my own credential string.

This is the case if i use Atlas UpdatePanel otherwise it works fine.

Any clue in this regards, do i have to do something in terms of security to get it working?

Copied this Microsoft.Web.Atlas.dll over to my machine and issue went away.

Access controls added dinamically?

Hi:
I trying to access to controls in updatepanel that I createddinamically before with atlas too, and I allways get the error that thecontrol does not exist.
Is there any way to do this?
Thanks so much.Do you have some sample source you can post? In which event handler are you trying to access the controls?
I was tried this with the code in the examples section. With SimpleList1_edit.aspx exactly.
I add a new textbox and a new button to panel3 when I click button ,and it works perfect, but when I click the new button and go to thecode for the code onclick then the findcontrol never finds the controlin the panel. I tried with find in the whole page and only in the panel and never works. This is the code:

<%@. Page Language="C#" %>

<%@. Import Namespace="System.Data" %>
<%@. Import Namespace="System.Data.SqlClient" %>

<script runat="server">

protected void Page_Load(object sender, EventArgs e)
{
TimerMessage.Text = DateTime.Now.ToLongTimeString();
if (!IsPostBack)
{
ViewState["CurrentTab"] = "0";
}
}


protected void AddnewBtn_click2(object sender, EventArgs e)
{
TextBox txtbox = (TextBox)FindControl("newtxtbox");
idlbl.Text = txtbox.Text;
panel3.Update();
}
protected void AddnewBtn_click(object sender, EventArgs e)
{


TextBox txtbox = new TextBox();
txtbox.ID = "newtxtbox";
Button btn = new Button();
btn.ID = "newbtn";
btn.OnClientClick = "AddnewBtn_click2";
panel3.Controls.Add(txtbox);
panel3.Controls.Add(btn);
btn.Text = "Read new textbox value";
panel3.Update();

}
protected string FormatPriority(int priority)
{
switch (priority)
{
case 1:
return "Low";
case 2:
return "Medium";
default:
return "High";
}
}

protected string FormatDone(bool isDone)
{
return isDone == true ? "Yes" : "No";
}

protected void Done_CheckedChanged(object sender, EventArgs e)
{
CheckBox cbx = (CheckBox)sender;
GridViewRow row = (GridViewRow)cbx.NamingContainer;
using (SqlConnection cn =newSqlConnection(ConfigurationManager.ConnectionStrings["SimpleListsConnectionString"].ConnectionString))
{
cn.Open();
SqlCommand cmd = new SqlCommand(
"UPDATE Lists SET IsComplete = @.IsComplete WHERE ListId = @.ListId",cn);
cmd.Parameters.Add("IsComplete", cbx.Checked);
cmd.Parameters.Add("ListId", ListGrid.DataKeys[row.RowIndex].Value);
cmd.ExecuteNonQuery();
}
ListGrid.DataBind();
}

protected void Select_Command(object sender, CommandEventArgs e)
{
ListDataSource.SelectParameters["IsComplete"].DefaultValue =
e.CommandArgument.ToString();
if (e.CommandName == "show")
SearchText.Text = "";
ViewState["CurrentTab"] = e.CommandArgument;
panel2.Update();
}

protected void Page_PreRender(object sender, EventArgs e)
{
int i = int.Parse(ViewState["CurrentTab"].ToString());
ActiveButton.CssClass = i == 0 ? "activeTab" : "tab";
CompletedButton.CssClass = i == 1 ? "activeTab" : "tab";
AllButton.CssClass = i == -1 ? "activeTab" : "tab";
SearchTab.Attributes["class"] = i == -2 ? "activeTab" : "tab";
}
protected void Page_ErrorHandler(object sender, PageErrorEventArgs e)
{
e.ErrorMessage = "Exception at " + DateTime.Now.ToString() +
"; Error Message: " + e.Error.Message;
}

</script>

<!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">
<link href="http://links.10026.com/?link=StyleSheet.css" rel="stylesheet" type="text/css" />
<title>Partial Rendering</title>


</head>
<body>
<form id="f1" runat="server">
<atlas:ScriptManagerID="ScriptManager1" EnablePartialRendering="true"OnPageError="Page_ErrorHandler" runat="server">
<ErrorTemplate>
<div style="width: 450px; height: 300px; padding: 10px; border:solid 3px black; background: #ffd; text-align: left;">
<h1>Server Error</h1>
<p>An unhandled exception with the following message has occuredon the server:</p>
<p><span id="errorMessageLabel"runat="server"></span></p>
<p><input id="okButton" type="button" value="OK"runat="server"/></p>
</div>
</ErrorTemplate>
</atlas:ScriptManager>
<atlas:UpdateProgress runat="server" id="updateProgress1">
<ProgressTemplate>
<div style="width: 450px; height:300px;position:absolute; padding: 10px; border: solid 3px black;background: #ffd; text-align: left;">
<img src="http://pics.10026.com/?src=Progress.gif" /> Contacting Server...
<button id="abortButton">Stop</button>
</div>
</ProgressTemplate>
</atlas:UpdateProgress>
<div>
<div id="top">

</div>
<div class="ContentContainer">
<div id="header">
<div id="ServerMessage">
<span class="controlLabel">Server Time:</span>
<asp:Label ID="TimerMessage" runat="server">n/a</asp:Label><asp:Button ID="UpdateTimerMessageBtn" Text="Update" runat="server"/>
</div>
<span class="title"><a href="http://links.10026.com/?link=Default.aspx">SimpleList</a> > Standard Server Page</span>
</div>
<div class="tabs">

<atlas:UpdatePanel ID="panel1" runat="serveR" Mode="Conditional">
<ContentTemplate>
<span class="controlLabel">Show:</span>
<asp:LinkButton ID="ActiveButton" Text="Active" CommandName="show"CommandArgument="0" OnCommand="Select_Command" runat="server" />
<asp:LinkButton ID="CompletedButton" Text="Completed"CommandName="show" CommandArgument="1" OnCommand="Select_Command"runat="server" />
<asp:LinkButton ID="AllButton" Text="All" CommandName="show"CommandArgument="-1" OnCommand="Select_Command" runat="server" />
<span class="controlLabel leftSpace">Search:</span>
<span id="SearchTab" runat="server">
<asp:TextBox ID="SearchText" CssClass="filterdropdown" Width="150px"runat="server" />
<asp:Button ID="SearchBtn" CssClass="topButtons" Text=" >> "
CommandName="search" CommandArgument="-2" OnCommand="Select_Command"runat="server" />
</span>
</ContentTemplate>
</atlas:UpdatePanel>
<!-- Add a closing UpdatePanel tag below here. -->
</div>
<div id="list">

<atlas:UpdatePanel ID="panel2" runat="server" Mode="Conditional">
<ContentTemplate>
<asp:GridView ID="ListGrid" BorderWidth="0px"AutoGenerateColumns="False" DataKeyNames="ListId"
DataSourceID="ListDataSource" AllowPaging="True" AllowSorting="True"EnableViewState="False"
GridLines="None" runat="server">
<Columns>
<asp:TemplateField ShowHeader="False">
<EditItemTemplate>
<asp:LinkButton ID="LinkButton1" runat="server"CausesValidation="True" CommandName="Update"
Text="Update"></asp:LinkButton>
<asp:LinkButton ID="LinkButton2" runat="server"CausesValidation="False" CommandName="Cancel"
Text="Cancel"></asp:LinkButton>
</EditItemTemplate>
<ItemTemplate>
<asp:LinkButton ID="LinkButton1" runat="server"CausesValidation="False" CommandName="Edit"
Text="Edit"></asp:LinkButton>
<asp:LinkButton ID="DeleteBtn" runat="server"CausesValidation="False" CommandName="Delete"
Text="Delete"></asp:LinkButton>
</ItemTemplate>
<ControlStyle CssClass="buttons" />
<HeaderStyle CssClass="commands" />
</asp:TemplateField>
<asp:BoundField DataField="Name" HeaderText="List"SortExpression="Name">
<ControlStyle CssClass="name_edit" />
<ItemStyle CssClass="name" />
<HeaderStyle CssClass="name" />
</asp:BoundField>
<asp:TemplateField HeaderText="Priority"SortExpression="Priority">
<EditItemTemplate>
<asp:DropDownList ID="DropDownList1" Width="75"SelectedValue='<%# Bind("Priority") %>'
runat="server">
<asp:ListItem Text="High" Value="3" />
<asp:ListItem Text="Medium" Value="2" />
<asp:ListItem Text="Low" Value="1" />
</asp:DropDownList>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="pri" Text='<%# FormatPriority((int)Eval("Priority")) %>' runat="server" />
</ItemTemplate>
<ItemStyle CssClass="priority" />
<HeaderStyle CssClass="priority" />
</asp:TemplateField>
<asp:BoundField DataField="DateCreated"DataFormatString="{0:MM/dd/yyyy}" HtmlEncode="False"
HeaderText="Started" ReadOnly="True" SortExpression="DateCreated">
<ItemStyle CssClass="started" />
<HeaderStyle CssClass="started" />
</asp:BoundField>
<asp:TemplateField HeaderText="Completed"SortExpression="IsComplete">
<EditItemTemplate>
<asp:CheckBox ID="CheckBox1" runat="server" Checked='<%#Bind("IsComplete") %>' />
</EditItemTemplate>
<ItemStyle CssClass="iscomplete" />
<HeaderStyle CssClass="iscomplete" />
<ItemTemplate>
<asp:Label ID="Done" Text='<%# FormatDone((bool)Eval("IsComplete")) %>' runat="server" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
<EmptyDataTemplate>
<span id="Empty">No lists</span>
</EmptyDataTemplate>
</asp:GridView>
</ContentTemplate>
<Triggers>
<atlas:ControlEventTrigger ControlID="AddListBtn" EventName="Click"/>
</Triggers>
</atlas:UpdatePanel>
<!-- Add a closing UpdatePanel tag below here. -->
</div>
<div id="AddNew">

<atlas:UpdatePanel ID="panel3" Mode="Conditional" runat="server">
<ContentTemplate>
<span>Add New List:</span>
<asp:TextBox ID="AddItemTxt" CssClass="newitem"runat="server"></asp:TextBox>
<asp:Button ID="AddnewBtn" runat="server" OnClick="AddnewBtn_Click"Text="Add" />
</ContentTemplate>
<Triggers>
<atlas:ControlEventTrigger ControlID="AddnewBtn" EventName="Click"/>
</Triggers>
</atlas:UpdatePanel>

</div>


</div>
</div>

<asp:SqlDataSourceID="ListDataSource" runat="server" ConnectionString="<%$ConnectionStrings:SimpleListsConnectionString %>"
SelectCommand="SELECT ListId, Name, Priority, IsComplete, DateCreated
FROM Lists
WHERE (@.IsComplete = -1)
OR (@.IsComplete in (0, 1) AND IsComplete = @.IsComplete)
OR (@.IsComplete = -2 AND Name LIKE '%' + @.SearchText + '%')"
UpdateCommand="UPDATE Lists
SET Name=@.Name, IsComplete=@.IsComplete, Priority=@.Priority
WHERE ListId = @.ListId"
DeleteCommand="DELETE FROM Lists WHERE ListId = @.ListId">
<SelectParameters>
<asp:Parameter Name="IsComplete" Type="Int32" DefaultValue="0" />
<asp:ControlParameter Name="SearchText" Type="string"ControlID="SearchText"
PropertyName="Text" ConvertEmptyStringToNull="false" />
</SelectParameters>
</asp:SqlDataSource>

</form>
<hr />
</body>
</html
Thanks for the help.

I've been wondering about this as well. I'd really, really like the ability to do this. I came up with a short test page to validate the issue outside of my site.

The code for the test page is below. Run this, click "Add Control" and a label will be added to the placeholder control. Click "Refresh" and watch the label control vanish. You can also validate in the debugger that the label control added to the placeholder has disappeared (that is, it's not in the controls collection at Page_Load time()).

Is there something obvious I'm overlooking?

--

<%@. Page Language="C#" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"><script runat="server"> protected void Page_Load(object sender, EventArgs e) { } protected void Add_OnCommand(object sender, CommandEventArgs e) { Label lab = new Label(); lab.Text = "Dynamically added label"; TestPlaceHolder.Controls.Add(lab); } protected void Refresh_OnCommand(object sender, CommandEventArgs e) { }</script><html xmlns="http://www.w3.org/1999/xhtml"><head runat="server"> <title>Dynamically added control test</title></head><body> <form id="form1" runat="server"> <atlas:ScriptManager ID="ScriptManager1" runat="server" /> <atlas:UpdatePanel ID="TestPanel" runat="server"> <ContentTemplate> <asp:PlaceHolder ID="TestPlaceHolder" runat="server"></asp:PlaceHolder> <asp:Button ID="TestAddButton" runat="server" Text="Add Control" OnCommand="Add_OnCommand" /> <asp:Button ID="Refresh" runat="server" Text="Refresh" OnCommand="Refresh_OnCommand" /> </ContentTemplate> </atlas:UpdatePanel> </form></body></html>

^^^ Nevermind. My example didn't state the case correctly. I went back and fixed it and found everything was fine with values updating on dynamic controls.

The problem was in my site with an off-by-one error in control names. With the names corrected, everything is fine.

Saturday, March 24, 2012

about:blank SSL warning in Sys.UI.PopupBehavior.show()

While using Atlas on an SSL-secured site, PopupBehavior.show() causes IE 7 to display an SSL warning. This happens because IE does not consider "about:blank" a secure site. This probably affects IE 6 as well, though I haven't tried it.

The offending code is in the vicinity of line #8679 in the Atlas debug javascript file WebResource.axd (I think I have the most recent version):

if ((Sys.Runtime.get_hostType() == Sys.HostType.InternetExplorer) && !window.opera) {
var childFrame = elt._hideWindowedElementsIFrame;
if (!childFrame) {
childFrame = document.createElement("iframe");
childFrame.src = "about:blank";
...

This problem was manifesting itself when trying to show a PopupControl in the Atlas control toolkit, but the problem's with the Atlas core javascript, not the control toolkit.

As a workaround (since fortunately we can compile the control toolkit from sources), I changed the showPopup method in PopupControlBehavior.js to temporarily impersonate Opera and thus avoid the if-statement shown above:

window.opera = true;
_popupBehavior.show();
window.opera = false;

There's also another time about:blank appears in the Atlas core javascript, in Sys.Net.IFrameExecutor.executeRequestInternal. I'm guessing it might cause a similar problem when running on a SSL secured site, though I haven't run into problems with it yet.

Hi - I have the same problem and since this is still not fixed, i will also

try tocorrect the .js file myself and then compile the microsoft.web.atlas.dll again,

can you give me some advice on that - did it work ?

Thanks


That change did work for me.

However, Internet Explorer 7 Beta 3 has apparently been corrected so that it doesn't display a security warning when accessing about:blank from a SSL-secured webpage. (I still get a warning using the PopupControl in IE7 Beta 2 though.) What browser version are you using?


Hi, thanks for the quick answer,i have to use IE 6.0, since this is the company standard,what i don't know is: how to compile the atlas dll,is the sourcecode free available ?I have seen the .js files, but they are somehow compiledinto the dll's right ? How can i change the javascript ?Thanks

That's right, the Atlas core .js files are compiled into the DLL, so it's hard to change the code there. That's why I suggest changing the source code inside the PopupControl -- it's part of the AtlasControlToolkit, for which source code is provided here:

http://www.codeplex.com/Wiki/View.aspx?ProjectName=AtlasControlToolkit

Just download the latest release, make the change to PopupControlBehavior.js as described above, and recompile. Then copy the resulting AtlasControlToolkit.dll and Microsoft.AtlasControlExtender.dll into your project ... and if all goes well, there shouldn't be any more security warnings.


To clarify, the reason I posted this thread here and not in the AtlasControlToolkit forum is that the real problem is with the Atlas core UI code. (Well, one could argue that the real problem is with IE6, but it's already released, so tough luck...) It seems like the Atlas core code should be cleaned up to not use about:blank.


Use the following in your aspx pages
<atlas:ScriptManager runat="server" ID="ScriptManager1">
<Scripts>
<atlas:ScriptReference Path="~/ScriptLibrary/Debug/Atlas.js" />
<atlas:ScriptReference Path="~/ScriptLibrary/Debug/AtlasRuntime.js" />
</Scripts>
</atlas:ScriptManager>

In Atlas.js & AtlasRuntime.js just replace about:blank with javascript:'' and you are done.
If still getting error you can write tosharma_nishant@.satyam.com

About WebService Bridge

I'm a beginner of atlas.These days I'm learning WebService mashup in atlas. I don't know how to begin.

Is there some material of mashup in dot net for beginners? Thanks

I found this great for learning Ajaxhttp://ajax.asp.net/docs/
But I can't find document about mashup in the docs

http://ajaxian.com/archives/secure-ajax-mashups-with-the-tag

do a search on Google for mashups ajax microsoft...

Hopefully that helps

about new atlass document

I found that the new atlas's document(http://atlas.asp.net/docs/Default.aspx) had used atlas's updatepanel.
Where to download the new atlas's document's source code?

You can download the latest Atlas CTP drop from this URL:http://atlas.asp.net/default.aspx?tabid=47&subtabid=471

Hope this helps,

Scott


thanks for your reply.
I had download it .But I can't find new atlas document's source code files.(I had old document's source code.)
How to get it?

I'm not sure what you mean by "old document's source code". Can you explain more? What document are you referring to?

Thanks,

Scott

about Atlas

Hello:

I'm new in Atlas, and I need help to understand :)

My scenario is that I have one gridview (vsnet 2005) and a button. When I click button, I call remote web service (http:outerIP/myservice.asmx) that returns data used for gridview's datasource.

I have seen examples for calling from javascript to web service, but I don't understand proccess.

1- I add the web reference to my vs2005 (with atlas template) project.

2- I modify this code that template created in aspx.

<asp:ScriptManagerrunat="server"ID="scriptManagerId"><Scripts><asp:ScriptReferencePath="CallWebServiceMethods.js"/><-----</Scripts><Services><asp:ServiceReferencePath="http://OUTERIP/webservices/MyService.asmx"InlineScript="false"/></Services></asp:ScriptManager>

my ask are:

    this .js file "CallWebServiceMethods.js"... how is generated? is it a copy of real web service?Must I make this .js?Is not intelllisense in javascript for calling webservice methods?If i call webservice method from client side in javascript... how can I to send to grid this received datasource?

Thanks a lot and regards!

For your four questions, I'd like to share my ideas with you for reference.
1.The Services collection allows you to wire up web services that can be consumed via client side script. The ScriptManager will generate proxy JavaScript scripts that allow the developer to use similar syntax on the client as is used on the server. The supported bits will not support calls to Windows Communication Foundation (WCF) services, however, this functionality will be added to the non-supported CTP builds in the future.
The AJAX Extension includes an HttpHandler that is used to generate the proxy scripts and handle JSON serialization called Microsoft.Web.Script.Services.ScriptHandlerFactory. Internally the HttpHandler routes .asmx calls that require JSON serialization to the AJAX networking stack.Calls to .asmx that don't use the special syntax (http://.../foo.asmx/js/methodname) are routed to the original ASP.NET 2.0 .asmx handler. Note that this means if a developer created a custom .asmx handler, when AJAX web services are enabled on a site the ScriptHandlerFactory will instead always fall back to System.Web.Services.Protocols.WebServiceHandlerFactory. There is no capability to chain the AJAX handler to a custom .asmx handler.
You wire up the web services to the <ScriptManager> by adding a ServiceReference to the Script Manager. The following demonstrates how to add a service reference to foo.asmx. You can also do this by accessing the Services collection in the Property pane of the IDE.
<asp:ScriptManager runat="server" ID="scriptManager">
<Services>
<asp:ServiceReference Path="~/.../foo.asmx" />
</Services>
</asp:ScriptManager
This will result in javascript objects being instantiated in the browser which are proxy objects for corresponding .NET classes in foo.asmx. The proxy objects are used
a)To make asynchronous requests in JavaScript to the asmx web methods
b)To create and initialize instances of proxies of server data types. This allows developers to pass complex objects as parameters as well as handling complex objects in the response.

ServiceReference Properties
You add a ServiceReference control to the <Services> section for each web service you need to access via JavaScript. The reference drives the process of requesting the proxy script on the client. The proxy script is covered later in this lesson. The ServiceReference control has two properties: InlineScript and Path.
InlineScript - The InlineScript attribute on the ServiceReference tag determines whether the script for generating the Javascript proxies is included within the page, or is downloaded as a separate script resource. The default value is false.

<asp:ServiceReference Path="~/.../foo.asmx" InlineScript="true" /
When InlineScript is set to false (or is absent) then the proxy generation script is obtained by a separate request to http://.../foo.asmx/js which is handled by the AJAX HttpHandler. Since the script can be cached in the browser, this option is preferable when multiple asmx pages use the same service reference.

When InlineScript is set to true the proxy generation script is included as an inline script block within the page. This can improve performance by reducing the number of network requests, particularly if there are many service references within the page and other pages do not reference the same services.

Path: The Path property specifies the URL for accessing the web service. The ServiceReference tag can only be used for local services (i.e. services within the same domain). Local services can be addressed by a relative, app-relative, domain-relative or absolute path. For domain-relative or absolute paths it is up to the developer to ensure that the path does correspond to the same domain, and so will actually work. The proxy generation code will initialize the path property to the corresponding domain-relative path.

This means that if you enter have the following:
<asp:ServiceReference InlineScript="true" Path="http://mydomain.com/Parts.asmx" /
The proxy script will be requested using the full URL:
http://mydomain.com/Parts.asmx/js

However the path in the proxy script will call the webservice using the virtual path of /Parts.asmx.

If you specify InLineScript="true", you have to either use a virtual or relative path. You can also use the ~/ syntax to have ASP.NET build the app relative path for you. You will get the following error message if InLineScript="true" and the Path is pointing to a different domain than the ASPX page was requested from:

The path "http://test.com/TestServices/WebService.asmx" is not supported. When InlineScript=true, the path should be a relative path pointing to the same web application as the current page.

Path to external services
For external use of services, using a ServiceReference with an absolute URL will fail, as specified above. It is recommend that developers do the following:
?Download the script, using http://mydomain.com/Parts.asmx/js
?Open the .js file and set the correct value of the path property. If the web service class is called "WebService" and the site is http://test.com, you would do the following:

Change: WebService.set_path("/TestServices/WebService.asmx");
To: WebService.set_path("http://test.com/TestServices/WebService.asmx");

?Reference the script in the <ScriptManager>
<asp:ScriptManager ID="MyManager" runat="server">
<Scripts>
<asp:ScriptReference Path="WebServiceDifferentURL.js" />
</Scripts>
</asp:ScriptManager
If you choose to do this, users will get the following message when they click the button letting the user know that they are sending a request to a different site:

Simple Demo
Proxy generation script
When the service request tag does not specify InlineScript = "true", a separate HTTP request is made to the asmx to download the proxy script. This is done using a special URL request syntax as mentioned previously.

http://.../foo.asmx/js

This request returns the proxy generation scripts that instantiate the specific JavaScript proxy objects for foo.asmx. This is done to allow developers to write JavaScript code using namespaces and classes which are not inherently available in JavaScript. This also abstracts the serialization of complex types from the developer. The content type of the returned proxy script is set to "application/x-javascript".

Proxy objects graph corresponding to namespace
The proxy generation script will create a Web Service proxy object corresponding to any Web Service class in foo.asmx that has a server attribute [ScriptService] and contains one or more methods marked with the [WebMethod] attribute.

[Microsoft.Web.Script.Services.ScriptService]
public class PeopleServices : System.Web.Services.WebService {
}
2.No.This is not necessary to call a web service through javascript,which only provides a method to consume web service from the client side.You can call a web service method according to the traditional way.
3.There are a lot of Ajax controls which can consume web service and have ServicePath and Servicemethod properties to specify a web service.This is intellisense.But it is not .js file.
4.Calling Web Services in JavaScript
Now that we've talked about setting up the ScriptManager and how the proxy functionality works, let's take a look at how developers will leverage this technology. We'll look at passing both simple and complex data type and handling errors. During the demos, we'll take a look at the network traffic being passed to and from the server.

"Fire and Forget" Invocation
If the web service class on the server includes a web method that does not return data, you can call the web service without having to handle a response. This is the simplest web method call that can be made from the client. For example, your application has the following web method:

[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[Microsoft.Web.Script.Services.ScriptService]
public class Parts : System.Web.Services.WebService
{
[WebMethod]
public void NoReturn()
{
//do work here
System.Threading.Thread.Sleep(2000);
}
}

The following JavaScript can be used to invoke that web method

function RunWebService()
{
Parts.NoReturn();
}

If the webservice is in a custom namespace, you would need to fully
qualify the call to the webservice. For example, if the WebService
has a namespace of MyCustomNameSpace.WebServices, the above JavaScript
becomes:

function RunWebService()
{
MyCustomNameSpace.WebServices.Parts.NoReturn();
}

If you want to get the dataset which is returned by?a?web?service,you?can?call?it?according?to?the?traditional?way?and?bind?it?to?asp:GridView.
If?you?would?like?to?consume?some?web?service?methods?through?javascript?from?the?client?side,try?to?use?Ajax?control?toolkit?which?are?useful?for?you.?

Wish the above can help you.

great answer. thanks and regards!

aborting postback

hi guys,

Just wondering how do i or is it even possible to abort a postback when using atlas. The reason why i am asking is that i have some text fields that require validation before a async postback is performed. If the validation fails then i would like to cancel or abort the async postback and alert the user.

any syntax or code snippets would be great

thanks

hello.

maybe something like this: $object("_PageRequestManager").abortPostBack();