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

Wednesday, March 28, 2012

very basic question about the atlas samples

I went thru the instructions exactly (well almost...the create new item for the webservice in VS2005 is incorrect in the tutorial, it should be Create new website)

http://atlas.asp.net/docs/Walkthroughs/GetStarted/Basic.aspx

But i keep getting aError: Samples is undefined

I tried this in an attempt to fix it..but it failed too (this URL i put in the Start URL in the webservice)..I wasnt sure

<atlas:servicereferencepath="http://localhost:1169/AtlasWebService/HelloWorldService.asmx"/>

What dumb thing am i missing?

Thanks!

What do you get when you go tohttp://localhost:1169/AtlasWebService/HelloWorldService.asmx/js

Executing:

http://localhost:1169/AtlasWebService/HelloWorldService.asmx/js

Gives:

Server Error in '/AtlasWebService' Application.


Request format is unrecognized for URL unexpectedly ending in '/js'.


That is why you are getting the 'undefined Samples' javascript error. Atlas will generate the javascript objects for your webservice if you have it configured correctly. Using /js after your webservice is a good way to test if this is working.

I would recommend taking the following steps to debug this issue:

1) Double check that you are using the April CTP of Atlas. You may want to uninstall your current version and re-install the version found by going to http://atlas.asp.net/ and clicking the 'Download' button.

2) When you create your website, make sure the template you select is called _"Atlas" Web Site_. This template will give you a web.config to start from that has the appropriate configuration settings to enable generation of javascript for your web service.

3) Follow the steps in the walkthrough to create the web service. Note that the instructions are correct. Make sure you right-click on the web project (not the solution) and select 'Add New Item'. Web Service will be one of the options.

4) Test your web service by setting it as the start page and pressing F5. You should get the standard web service test page - click on the web service and make sure it works. If it does, then add '/js' to the path and see if Atlas generates javascript.

5) Follow the steps in the walkthrough to create the test page.

My guess is that your problem is caused by a configuration error. By following the steps above, you should discover what was causing the problem.
Regards,
Kyle

I'm going to assume you are using one of the wallkthroughs like this one,"Walkthrough: Creating a Basic ASP.NET 'Atlas' Web Application"

I ran into this same problem you did and the fix went like this:

When i created the new "Atlas Website", i right clicked on the root and chose "Add New", then "WebService", and put "HelloWorldService.asmx"

This did two things:
- Created "HelloWorldService.asmx" in the root of the directory
- Created "HelloWorldServer.vb" in the App_Code directory

I had then copied and pasted the code right from the sample walkthrough into the VB file....

But here was the catch, and the cause of the problem:
- The sample has "Namespace Samples.Atlas" or something the like wrapped around its classes

- Well, back on the asmx, it had put:
<%@. WebService Language="VB" CodeBehind="~/App_Code/HelloWorldService.vb" Class="HelloWorldService" %>

- And since we had just changed the classes namespace since we copied and pasted from the code on the walkthrough, we broke the link between the two, hence the "Samples in undefined" error

So my fix was to change the asmx file to say

<%@. WebService Language="VB" CodeBehind="~/App_Code/HelloWorldService.vb" Class="Samples.Atlas.HelloWorldService" %>

Problem = solved


Thanks Kyle, it was my error that i didnt read the docs closely enough...i had passed by the right click on the atlas website, and created a asp.net webservice thru the right click new webservice on the solution.

I assume that i can do the latter, later, by manually copying the relevant config entries for Atlas into the non-Atlas asp.net web.config...

thanks again

Very simple example... with masterpage!

I create a really simple example using atlas on a masterpage.

Ihave this code:

<

cc1:ScriptManagerID="ScriptManager1"runat="server"EnablePartialRendering="true"></cc1:ScriptManager><cc1:UpdatePanelID="up2"runat="server"><ContentTemplate><asp:Labelid="lbl1"runat="server"Text="Label"></asp:Label><BR/><asp:LinkButtonid="LinkButton1"runat="server"OnClick="LinkButton1_Click">LinkButton</asp:LinkButton></ContentTemplate>

</cc1:UpdatePanel>

and this:

protectedvoid LinkButton1_Click(object sender,EventArgs e)

{

lbl1.Text =

"egege";

}

the problem is that the event is raised, lbl1.Text became "egege", but the text of the label on the page it is still the same...

what can be wrong?

Can you supply a bit more code and perhaps explain how the cc1 namespace prefix got placed in front of your atlas controls?

<cc1:ScriptManager......

Instead of

<atlas:ScriptManager....

Etc.

I'm not saying that's the problem, but I'm unfamiliar with how that prefix got there.


hello.

btw, you should also start by using fiddler to see the msg that the client is receiving from the server...is there any forbidden xml chars on the head section?


Eureka!

The problem was that there was a<script language="Javascript"> block on the head of my masterpage.

I canceled it and everythigs works!

Can anybody tell me why?


hello.

well, currently, atlas packages the content of the head element in the msg that is sent from the server in response to a partial postback. since it doesn't escape those elements (say, by using a cdata section), you can't have any forbidden xml chars there (and it's really easy to get one of those inside a javascript script - for instance, this would make your document not well formed: for( ; i < 10; i++ ))

in the current version of atlas, when the returned xml document isn't well formed, the client platform discards it without giving any feedback.

View PDF in ATLAS?

In my existing 1.1 app, I have a datagrid with a column that, when clicked, displays a pdf file. In trying to convert it to 2.0 with Atlas, the pdf will not display, no error, but no display either. The data for the pdf is stored in SQL as binary data. I have listed the code below. If anyone could shed some light onto the issue, I'd greatly appreciate it.

If dr.Read Then
Dim byData(dr.GetBytes(0, 0, Nothing, 0, Integer.MaxValue) - 1) As Byte
dr.GetBytes(0, 0, byData, 0, byData.Length)
Response.ClearContent()
Response.ClearHeaders()
Response.Buffer = True
Response.AddHeader("Content-Disposition", "inline;filename=" & strFileName)
Response.AddHeader("Accept-Header", byData.Length)
Response.ContentType = strContentType
Response.BinaryWrite(byData)
Response.Flush()
Response.Close()
End If

Again, any feedback would be appreciated.

Thanks.

I ended up diong the postback in a different page.

What you will need to do is have a link in your datagrid to another page (ie viewattachment.aspx?filename=filename) and then create a non ajax windows form page called viewattachment.aspx

In the viewattachment.aspx page_load method you can then place your response code as you mentioned above

I have written an example of thishere.
Clinton

ViewState and Atlas

Hi

I encountered a problem involving viewstate and PageMethods (web methods in an aspx page).

I was submitting some control values, only one control on the page is designed as a <asp:listbox />, the rest of the controls are generic HTML. While Atlas.js constructed the proxy to the PageMethod and the arguments (Web.Net.PageMethodRequest) the Atlas.js javascript does some sort of check on the page controls, in which viewstate is a hidden input, adding it to a dictionary (refer line 3495 in Atlas.js)

Some sort of exception is generated but no information is available to determine the source. The code behind to the PageMethod didn't get hit in debug mode and it wasn't until I inspected the request/response in Fiddler that I came across a message indicating a corrupted viewstate.

After disabling viewstate on the <asp:listbox> the request got through to my [WebMethod] in the code-behind.

There is a problem with PageMethods and viewstate, or have I missed something.

Craig

An update for those who might be encountering the same problem with altas (Jan-06 CTP) and ViewState.

As mentioned in my previous post, in the file Atlas.js on line 3495, a procedure adds to the variable bodyDictionary all 'submittable' HTML element e.g <input /> this includes <input type="hidden" /> which means that<inputid="__VIEWSTATE" /> is added to the bodyDictionary variable.

Next in the procedure, is a call Web.Net.WebRequest.createQueryString(bodyDictionary, ...);

This is where IMHO the viewstate corruption is occuring between the client service calls to the server. In my case, I make a call to a [WebMethod] which is contained in an aspx page. So my client function is something like this:

functionfoo() {
PageMethod.GetFoo('hello');
}

My aspx.cs [WebMethod] is like the following:

[WebMethod]
public string GetFoo(string text) {
return text+=" get foo";
}

My page wrapes a user control in an<atlas:UpdatePanel>the user control contains an<asp:Repeater>control.

Has anyone experienced this, or am I the lucky one? To avoid the error 500, I removed the check for HTML elements with a type of hidden. But I'm not sure if this is a good thing...

Craig

PS: I can post the stack trace for those who might be interested.


Further, using PageMethod seems to faciliate the viewstate corruption. for kicks I moved the [WebMethod] from the aspx page into an ASMX file, reversed my Atlas.js script hack and the viewstate problem has gone. I hope the PageManager is a little more robust in the rtm.


Hi,

I'm not able to reproduce the behavior that you described. Could you post the stack trace and also the relevant page code?

Hi Garbin

Stack Trace
[FormatException: Invalid length for a Base-64 char array.]
System.Convert.FromBase64String(String s) +0
System.Web.UI.ObjectStateFormatter.Deserialize(String inputString) +72
System.Web.UI.ObjectStateFormatter.System.Web.UI.IStateFormatter.Deserialize(String serializedState) +4
System.Web.UI.ClientScriptManager.EnsureEventValidationFieldLoaded() +172

[ViewStateException: Invalid viewstate.
Client IP: 127.0.0.1
Port: 3520
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)
ViewState: /wEWCAKbhpuAAgLEtM6pBgLN/7aVCAKe4MuSDQLL7+H/CgLL7 3/CgKs5ZucDgLNoqBMLo1Lj5/N S5y dQM87L I5JMzQ=
Referer:http://localhost/Unsd/COC/ExchangeRateView.aspx?countryCode=36
Path: /Unsd/COC/ExchangeRateView.aspx]

[HttpException (0x80004005): The state information is invalid for this page and might be corrupted.]
System.Web.UI.ViewStateException.ThrowError(Exception inner, String persistedState, String errorPageMessage, Boolean macValidationError) +116
System.Web.UI.ClientScriptManager.EnsureEventValidationFieldLoaded() +209
System.Web.UI.ClientScriptManager.ValidateEvent(String uniqueId, String argument) +67
System.Web.UI.Control.ValidateEvent(String uniqueID, String eventArgument) +106
System.Web.UI.WebControls.TextBox.LoadPostData(String postDataKey, NameValueCollection postCollection) +31
System.Web.UI.WebControls.TextBox.System.Web.UI.IPostBackDataHandler.LoadPostData(String postDataKey, NameValueCollection postCollection) +11
System.Web.UI.Page.ProcessPostData(NameValueCollection postData, Boolean fBeforeLoad) +408
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +6953
System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +154
System.Web.UI.Page.ProcessRequest() +86
System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) +18
System.Web.UI.Page.ProcessRequest(HttpContext context) +49
ASP.exchangerateview_aspx.ProcessRequest(HttpContext context) in c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\unsd_coc\bdef81f1\ee1d3cb5\App_Web_ytigk7vl.8.cs:0
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +154
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +64

Page Code (aspx.cs)
[WebMethod]
publicExchangeRate GetExchangeRate(int countryCode,int year) {
returnCountryManager.Instance.GetExchangeRate(countryCode,
newint[] { year });
}

Page Code (aspx - javascript)
function GetExchangeRate(countryCode, year) {
// Call the server.
PageMethods.GetExchangeRate(countryCode, year, RequestCallback);
}

function RequestCallback(exchangeRate) {
// Bind the result to the controls.
document.getElementById("ctl00_contentPlaceholder_textboxYear").value = exchangeRate.Year;
document.getElementById("ctl00_contentPlaceholder_textboxIMF").value = exchangeRate.IMF;
document.getElementById("ctl00_contentPlaceholder_textboxUNOP").value = exchangeRate.UNOP;
document.getElementById("ctl00_contentPlaceholder_textboxOther1").value = exchangeRate.Other1;
document.getElementById("ctl00_contentPlaceholder_textboxOther2").value = exchangeRate.Other2;
document.getElementById("ctl00_contentPlaceholder_textboxNote").value = exchangeRate.Note;
}

Page Code (aspx - html)
<!-- Exchange Rate Control -->
<atlas:UpdatePanelID="updatePanelExRate"runat="server"Mode="Conditional">
<ContentTemplate>
<unsd:ExchangeRateControlid="exchangeRateControl"runat="server"/>
</ContentTemplate>
<Triggers>
<atlas:ControlEventTriggerControlID="buttonSave"EventName="Click"/>
</Triggers>
</atlas:UpdatePanel>

The ExchangeRate control is populated in the Page_Load event of the aspx Page by passing an array to a property accessor in the control, the array provides is the data source to a repeater. The ItemTemplate in the repeater contains a link to invoke the GetExchangeRate javascript in the page (above).

Hope this helps.

Craig


I don't know if its the same issue or not, but viewstate corruption is rampant in the QuickStart tutorials... There were several times where I ran 3 or 4 different "run this" tutorials in a row only to have the viewstate corruption error message appear on me. Sometimes it was fixed with a refresh of the page, sometimes it never went away.
hi Guys...
even i got the same problem when i put my [webmethod] in code behind.i tried removing type=hidden from atlas.js line 3495 and it is working.please let me know for the solution as we just can not remove any thing from coreatlas files even though doing the same results in expected output.

thanks
Jaideep

I tried a few things, but was not able to repro. Could you give this a try with the March CTP to see if it still happens?

thanks,
David


I have a similar problem with teh session state.

I have narrowed it down to a web user control that raises an event.

The code behind that implements the event sets the session var and then does a redirects.

on the redirect page the session state is blown away. cant figure out why

steps to reproduce

- create a web user control (define an event and raise it)

- create a page and place the wuc on it (trap for the wuc event and set a session var and do a redirect to 2nd page

- in 2nd page Page_load check the session state

viewstate serialization and atlas

Just testing a little popup calendar user control making use of Atlas. I notice that when I serialize the viewstate unusually (I have a 'StorePage' class that stores the viewstate in the db, keyed on a GUID in a hidden field on the page), the atlas calendar popup fails.

Can I work around this? Do my Atlas pages need to be decended directly from the Page class, or is my GUID-keyed technique flawed?

The calendar uses an updatepanel.

Thanks,

John

Hi John,

Can you explain exactly what doesn't work? Are you registering the hidden field by using ClientScript.RegisterHiddenField?

All pages no matter what will derive from Page, and Atlas doesn't care if there are other intermediate classes in the way (almost all pages have intermediate classes anyway due to code-behind files).

I can't think of any specific reason why this wouldn't work off the top of my head.

Thanks,

Eilon

Virtual Earth Question

Has anyone used the new build of Atlas to display the Virtual Earth control? I am unable to make it work. All I get is the copyright message from microsoft and the background image but not the maps

Any help would be great!!

<components>
<virtualEarthMap id="map" latitude="43.644755000"longitude="-79.392211000" zoomLevel="10" />
</components
that works :)

but looking to see if the Dashboard can be displayed:

params.showDashboard = false;
_map = new Msn.VE.MapControl(this.element, params);

Why is the Dashboard default to not show and theres no way of passingin the parameter or changing the JS ourselves since it is packaged intothe DLL now...

What alternatives can we do in using VE Control in Atlas and customizing the properties?

Monday, March 26, 2012

virtualEarthMap

Hi!

Can anybody tell something about the magical disappear of AtlasUIMap.js andvirtualEarthMap control in version RC1? With older verisons of Atlas (int time of Microsoft.Web.Atlas.dll, april CTP maybe) it worked fine. But the RC1 unfortunately does not know anything about it :(. Does RC1 have any wrapper for Microsoft Virtual Earth, or in RC1 we only have pure VE SDK, and AJAX gives us no support for mapping?

Thx

Yes there is not support for Virtual earth in currently in ASP.NET Ajax. But the VE SDK is pretty good and well structured so you can use it wothout the need of a wrapper.

Visible attribute on Atlas controls

Hi,

This small piece of code doesn't work in the current Atlas CTP:

<div>

<atlas:ScriptManagerID="ScriptManager1"runat="server"EnablePartialRendering="True">

</atlas:ScriptManager>

</div>

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

<ProgressTemplate>

Contacting server...

<br/>

<br/>

<inputid="abortButton"runat="server"type="button"value="Abort Request"/>

</ProgressTemplate>

</atlas:UpdateProgress>

The controls that implement the IScriptObject (UpdateProgress,…) use to override the RenderScript method in order to write xml/script output. The problem arrives when visible="false" for this control; then the control itself doesn't render, but it does the xml/script, what provokes a javascript error. This behavior is by design? Am I correct? Then, how could I override this behavior (and avoid this problem)? One solution could be to unregister the control in the script manager, but there is no ScriptManager.UnregisterControl (control).

Thanks

Fran

Anybody there??

style="display:none;"


Type 'Microsoft.Web.UI.UpdateProgress' does not have a public property named 'Style'

I think it would be great to have a nice Style or CssClass property, but there is nothing like that at the moment.

but that gave me another idea: a div surrounding the updateprogress, and apply the style to the div. it is not really a nice solution, but it works.

thanks

Fran

Visual Studio 2005 Add-in for Atlas

Will there be a Visual Studio 2005 Add-in for Atlas that will provide intellisense and add the Atlas controls to the toolbox?
When will it be available?
Regards,
John

You can add the controls to your toolbox, right-click,... but you will not have any design view support, as I can remember.


There is already some design view support, but it will get much better as we advance.

Visual Studio doesnt recognize(see) ATLAS from LAN!

When I try to open a website from server(LAN) I get following error within VS 2005:

Error 1 Element 'ScriptManager' is not a known element. This can occur if there is a compilation error in the Web site. ...

but the site works properly anyway... This error just annoys me, I can't see any Intellisence code for atlas components...

I have installed VS on server and installed Atlas components there too. VS shows Atlas tags properly when I launch VS from server, but doesn't do that when I try to open the same project from another computer.

The other computer has installed VS 2005 too...

Can anyone answer how to solve this?

hello.

i think this has been reported here...if i'm not mistaken, it only works without any problems when you open a local project.

Visual Studio not giving me Atlas option

Hello all, I have installed all of the Ajax stuff (located here:http://ajax.asp.net/Default.aspx) but when I open up Visual Studio and go to New Website I do not see option for Atlas. Anyone know why this does not show up? Thanks, Victor Gaudioso

Hi,

Support for AJAX (the new name for ASP.Net ATLAS), is included in SP1(came out last month), for VS 2005 (and I believe the Express edition too). If you have an older version of VS, I'm not sure what you'll need to do. Good luck. BRN..

VS 2005 & Atlas Problem

I recently had to reinstall my OS. I reinstalled VS 2005 & Atlas April CTP, however when I try and use VS.net to edit the refrences or components sections (shown below) the smart logic for all the methods & functions dosent work.Has anyone else had this problem?

<scripttype="text/xml-script">

<page xmlns:script=

"http://schemas.microsoft.com/xml-script/2005">

<references>

</references>

<components>

</components>

</page>

</script>Hi,

there's no intellisense support at the moment for the Atlas declarative script.

VS 2005/MS Ajax Beta Application no longer runs on Live server but does in Dev. Help!

I have just migrated from Atlas to MS Ajax Beta and after a lot of hassle to get the application working I decided to publish to our test web server. When I go to the URL for our test server all I get is a blank page but the IE progress bar (the bar at the bottom that show the page loading status) just flickers like crazy. It works fine on my dev machine but as soon as I publish it, no joy!

I really need some help on this as I don't really have a clue and I don't really fancy having to roll back to Atlas just to get this to work live.

Cheers,

FF

Ignore me, I'm stupid!!

I hadn't checked if the extensions were installed on the server!! DOH!!!


hello.

well, you must install ajax extensions on the live server and configure your site to use asp.net 2.0. have you done that already?

VS Editor does not recognize Atlas tags

This is what I have in web.config:

<controls>

<addtagPrefix="asp"namespace="Microsoft.Web.UI"assembly="Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>

<addtagPrefix="asp"namespace="Microsoft.Web.UI.Controls"assembly="Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>

<addtagPrefix="asp"namespace="Microsoft.Web.Preview.UI"assembly="Microsoft.Web.Preview"/>

<addtagPrefix="asp"namespace="Microsoft.Web.Preview.UI.Controls"assembly="Microsoft.Web.Preview"/>

</controls>

This is my aspx page:

<asp:ScriptManagerID="ScriptManager1"EnablePartialRendering="true"runat="Server">

</asp:ScriptManager>

This is the error I am getting in VS:

Error 1 Element 'ScriptManager' is not a known element. This can occur if there is a compilation error in the Web site. C:\Documents and Settings\RAFAL\My Documents\development\RFMain\ImportData\MainSite\Auctions.aspx 53 10 http://localhost/ekit/

Oh, I have figured this out. It was coming from master page. This line was creating problem:

<style>

.row {

background-color:white;

}

.rowSelected {

background-color:gray;

}

</style>


hi

could you (or anyone else) explain what you changed to make this work? What was the couse of your problem?

I have the same problem but I don't understand your fixit post and I can't see how that relates to what I have here.

cheers

A


hi.

I have a similar problem here.If my page has a master page then I can't get to see the ajax tags in the content page. If the page doesn't have a master page then i can see the ajax tags.

I can't understand how your fix works - would you (or anyonw) be able to explain why it solves the problem?

cheers

A


Seems like if there is any syntax problem on the page or the master page, that is when it is happening. Not sure how to find that original syntax problem. Maybe somebody else can recommend... Try to check manually for all HTML/ASP tags, make sure all is correct, that is what I can recommend now. Do it for the page and master as well as those are joined together later...

walkthrough problems

I have just completed my first Atlas Walkthrough using Visual Web Developer 2005 Express Edition . I choseWalkthrough: Creating a Basic ASP.NET 'Atlas' Web Application.There were a few places where I floundered.

I accidently copied both the [Visual Basic] and [C#] code fragments. Perhaps there could be a sentence dividing them.

I didn't find the following instruction very clear:

"Add a new ASP.NET page to your project and name it AtlasScript.aspx.

Note Be sure that you clear thePlace code in separate file check box. For this walkthrough, you must create a single-file ASP.NET Web page."

Compare it with the earlier precise instructions:

"In Solution Explorer, right-click the name of the site, and then clickAdd New Item.

In theAdd New Item dialog box, underVisual Studio installed templates, selectWeb Service.

Name the file HelloWorldService.asmx and clear thePlace code in separate file check box.

Select the language you want to use.

ClickAdd."

At the end, I was unsure how to run theAtlasScript.aspx page. Through trial-and-error I right-clicked the AtlasScript.asx in Solution Explorer and chose "View in Browser".

Then the script wouldn't work. There were two problems.

The first I solved by changing the functionDateTime.Now toDate.Now. This needs to be changed in the walkthrough instructions.

The other problem was that you cannot pressEnter on the keyboard, you have to click theSearch button. It is almost subconsciously-automatic to press Enter, so it would be better if it was enabled.

I have not completed my first Atlas Walkthrough using Visual Studio 2005. My experiences are similar to yours with the difference that I get stopped at the error message: Validation (XHTML 1.0 Transitional): Element 'title'occurs too few times. Error occurs in AtlasScript.aspx line 7 containing <head id="Head1" runat="server">. Any idea?

asalisse

Saturday, March 24, 2012

Want to use context menu with atlas

Hello,

I want to use this context menu sample (http://msdn.microsoft.com/msdnmag/issues/05/02/CuttingEdge/) within atlas.

I dont understand why i get an unknown error when i use it in an update panel.

Can anyone help me ?

thanks a lot

When I get this error in an UpdatePanel, comment out the UpdatePanel lines so I'm just left with the Content and then run it. I'll see a server-side exception then.

<%--<atlas:UpdatePanel runat="server" id="up_test" Mode="Conditional" RenderMode="inline">
<ContentTemplate>--%>
<cc1:ContextMenu />
<%--</ContentTemplate>
</atlas:UpdatePanel>--%>


Hello,

you must have a config error because for me it works

Thanks

Wanting to programmatically turn UpdatePanel on and off

I'd like to have a checkbox on my page thet lets me turn the atlas feature on and off. (just as if I had removed the <atlas:UpdatePanel> tags from my web page. Is there some way to do that?

Hi Peter,

I believe you should be able to just turn the partialpagerendering property to false on the scriptmanager control. This will then disable partial page updates.

Hope this helps,

Scott

Warning: Unable to update auto-refresh reference microsoft.web.atlas.dll

We are 2 developers working on a web application and we started to use ASP.Net Ajax (Atlas). We added the the toolkit and asp.net ajax to the toolbox in visual studio 2005 and we added the 2 dlls to our bin directory in the project. Everytime we move the project from one machine to the other we recieve the following warnings

Warning: Unable to update auto-refresh reference 'microsoft.web.atlas.dll'. Can not find assembly 'D:\ZPrograms3\DotNetFrameworkEnhancements\AspNetAjax (Atlas)\AtlasControlToolkit\SampleWebSite\Bin\Microsoft.Web.Atlas.dll'.

Warning: Unable to update auto-refresh reference 'atlascontroltoolkit.dll'. Can not find assembly 'D:\ZPrograms3\DotNetFrameworkEnhancements\AspNetAjax (Atlas)\AtlasControlToolkit\SampleWebSite\Bin\AtlasControlToolkit.dll'.

Should we put the ASP.Net stuff in a folder on the C: drive in a ASP.Net folder on both machines. What I don;t understand is why we have to do that if we have the dlls in our bin folder in the project. Can anyone clarify?

Newbie

hello

i think this is nothing to worry about. the problem is that VS is trying to get a new dll when you compile and when you've moved the project to another machine, you've just lost that reference (probably you don't have the toolkit on the other machine or it's placed in a different folder). so this shouldn't take your sleep :D


But what is the solution?

Set a new reference?

Watermark and Atlas Client Side Code issue

If I connect a textbox to a watermark control and write client side code like
obj = new Sys.UI.TextBox($('<%=textbox1.ClientID%>'));

it will report Assertion Failed error even if I set ID property for watermark control.

Myabe it is a bug of Atlas.

You're missing a getElementByID. The following works for me:

function foo() {
obj = new Sys.UI.TextBox(document.getElementById('<%= TextBox1.ClientID %>'));
alert(obj);
}
foo();


Hi David, Thanks for your help.
After changing
obj = new Sys.UI.TextBox('<%= TextBox1.ClientID %>');
to
obj = new Sys.UI.TextBox(document.getElementById('<%= TextBox1.ClientID %>'));

I still get same Assertion Failed error.

With my case, this textbox1 is inside an UpdatePanel. In this Updatepanel, I have a button with some ASP.NET code. when Clicking on this button, it only cause partial rendering.

The javascript here only get a string from a popup window. After the code
obj = new Sys.UI.TextBox('<%= TextBox1.ClientID %>');
is executed, and then click on the button inside the Updatepanel, the error came out.

But if code
obj = new Sys.UI.TextBox('<%= TextBox1.ClientID %>');
never executed, everything is OK.

I think the issue here is that the wrapper for hte textbox has already been created, that's why you're getting the assert (for future issues, please paste in the test of the assertion as well, it's usually helpful).

try this code instead:

obj = $object('<%= TextBox1.ClientID %>');


Is there any way to disable the Watermark? I'm getting an assertion error following a postback when I've set the Watermark's target textbox's visible property to false. The error message is:

Assertion Failed: Could not find an HTML element with ID "ctl00_CH_NewFeedTextBox" for control of type "Sys.UI.TextBox".

My code is just a click handler that is setting the visible property of the textbox to false. I'd be happy to set the Enabled property of the Watermark to false as well... if it had such a property.


When you set the Visible property to false, the control isn't rendered at all to the client. Thus, there is no ctl00_CH_NewFeedTextBox control in your client-side page. try NewFeedTextVox.style.display="none" to hide it. This will make it render to the page, but not be visible in the browser.
Hi sburke_msft, If I change the code to
obj = $object('<%= TextBox1.ClientID %>');
then it will report error obj is null.

Here question is I want to use Atlas code and make things simply. If I do not use Atlas code here, just use javascript directly, no this problem.
It means watermark combine orginal javascript, no this problem.

I certainly *could* do that and get past this error, but the point is that the extenders are supposed to add functionality to other controls without requiring me to change how I'm using those controls. Since it is perfectly normal for developers to set the Visible property to false for TextBox controls (and since this is more efficient in terms of rendering time and bandwidth, etc.), the better solution would be to fix the Extender so that it can detect whether the Control it is associated with is Visible, and if not, disable itself. Or, barring that, expose an Enabled property that I can manually set to false when I disable/invisible the control it is targeting.


Agreed. However to be overly blunt, before a fix comes out, you have only ( as far as I know, correct me if wrong ) 2 options: write your own extender, or use the display property.

This has come up several times. As pointed out here, Visible=false means that the control isn't rendered, so there's no way the client side code can handle it.

We've talked about possible solutions, but none of them are automagic and still reasonable:

1) We could flip the visible bit and add display:none via the extender - this could expose security issues by rendering code that wasn't intended to be

2) We could throw an exception - this means you still need to make this change to your HTML

3) We could do nothing - this makes it pretty hard to debug and people waste time trying to figure out why X isn't working.

So at the end of the day, yes, you need to make a markup change here. Our goal with extenders is to allow you to do as much as possible without modifying the original page but there are many, many scenarios when this just simply isn't possible.

Hope that helps.


In my scenario, the request I would have is that the extender expose an Enabled property (or Visible, but since most of them aren't really visible to begin with, Enabled is more intuitive). If I *know* that I'm writing some code that is going to take the target of the extender away, then that gives me the developer to option of turning off the extender in that same chunk of code. Meanwhile, everything else works as before.

I know I'm going to have to write code for this situation to work out. That's ok - that's not my point. What I'm going for is the best implementation for the Extender controls.

The question is, would I rather

A) Write some CSS code to hide my textbox when I have years of experience, best practices, and thousands of lines of code showing me that to do this I set Visible to False.

or

B) Modify the control that I've just added to the page, the one that I'm already having to touch anyway, the one that is bombing out, and the one that has as one of its core advantages the lack of necessity to touch its target control.

My vote is B. The code for this should be simple -- wrap the control's inner workings in a big if(this.Enabled) statement.

Thanks - I hope that clearly makes my point/recommendation.


I guess my underlying question, which I'll make explicit here, is:

Whynot have an Enabled property on Extender controls to enable/disable their behavior?


Actually this has been solved - I forgot that we did make a change here. Make sure you have a new Toolkit build.

If the target control isn't Visible, we simply don't emit the hookup, so nothing happens. Once it becomes visible, we'll generate the hookup and it'll start working.

Watermark issue

Hi all,

I just installed Atlas and tried to make a text box with watermark. I select new Atlas website, add a textbox and a TextBoxWatermarkExtender. When I go to properties of the textbox and click the + before TextBoxWatermarkExtender nothing happenes. The + disapears and I don't get the css and text option. I use Visual Studio 2005 and have no IIS installed. Someone has had this issue before?

Regards,

Stijn

Nobody had this before? This seems to be a bug...
The problem and its resolution are discussed in this thread:http://forums.asp.net/thread/1359451.aspx