Showing posts with label application. Show all posts
Showing posts with label application. Show all posts

Wednesday, March 28, 2012

Accessing Web Services that are external to my application.

Is it possible to use the <atlas:servicereference> to set a path to a web service that doesn't exist within the same application as the consuming aspx file?

All the samples and examples show the <atlas:servicereference path="" /> containing the path to an asmx file located within the same application as the consuming aspx file. How would I set a reference tohttp://somedomain/someapp/someservice.asmx ?

This can't easily be done because XmlHttp (the browser component used to make requests) disallow requests to other domain for security reasons. Note that youcan make requests to Atlas services in other apps, as long as they're in the samedomain. e.g. foo.mydomain.com can use bar.mydomain.com.

In the next build of Atlas (around march), we will allow a limited form of cross domain method calls to Atlas services (without using XmlHttp).


Thanks. I can just reference the external web services from with the one local to my application.
Yes, doing this is what we call 'bridging', and we will also have addition support for this is a later build. In the meantime, do whatever gets you going! :-)

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

Accessing same application on two different machines.

Hi All,

I have one situation I want some focus and answers to this. Please help me in this.

The situation is like this, There is one web application installed on two different machines.

Suppose if one machine is shutdown for maintaince, thne the user accessing the application

should be redirected to the second machine.


I am not very clear whether this will work. Its just a suggestion

A third machine has to be there to monitor the status of two machines and based on availability the request has to be redirected.


yes that is right, the user is accessing the application from third machine. I want to know how to redirect the user depending on the condition mentioned in post.

Hello,

There are very smart guys/girls, and solved your solution for a long times ago.

You can setup Web Farm, server clustering, free to use on the Windows Server Environment.

reference:

http://www.microsoft.com/technet/prodtechnol/windows2000serv/technologies/iis/deploy/confeat/webclust.mspx

Hope this solve your problem.

Accessing Master page control from child page

Hi,

In my application I have implemented a customized error control, which gets visible on any error raised.

Issue is, in one of the page where we have implemnted Update Panel, and onClick of a button I wants to raise a error on the control in Master page.

The Page object has a Master property that will reference the properties of the master page. Note that you will need to apply the MasterType directive to your page or use the Page.MasterPageFile property to reference the master page properties.

hi,

You can retrieve the master page controls by using this.masterPage property.

Hope this helps


Hi,

In all my other pages I am able to access the properties of master page, but not able to access the property for the page where Update panel is implemented.


hello.

in my opinion, this is what you should do:

1. create an interface which has the properties/methods you want to access.

2. change the master so that it implements the interface. if you want to get a property from q control, don't forget to call ensurechildcontrols() beforeaccessing the control on the property code

3. on your page, start by getting a reference to the master and see if it implements the required interface. if it does, then just cast the master reference to the interface and use it to access the properties/methods you need.

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 AJAX.NET app as part of ASP application

I have written a ASP.NET appliacation named IIC with AJAX features for filling the GridView without refreshing the page when user filters data by using dropdowns and checkboxes. The application is working fine when I run it indepently as follows:

http://localhost/IIC/default.aspx

But this application needs to be the part of our existing ASP application called "Aspapp". So I moved my AJAX enabled ASP.NET application folder as sub folder to ASP application and accessing the page using the following URL:

http://localhost/Aspapp/IIC/default.aspx

Now everything works fine, but except the AJAX. The page refreshes when I fill the GridView.

I copied AjaxControlToolkit.dll and other ASP.NET application related dlls to the bin folder of "Aspapp/bin" application and also "Aspapp/IIC/bin" folder.

I have checked the IIS settings, so that the application is configured to run using .NET 2.0 framework.

My questions are:

1. Am I missing any other assemblies related to AJAX to be copied?

2. Am I copying the assemblies to the right folder?

3. Am I missing any IIS configuration?

Please help.

In IIS make the create a IIC virtual directory. This will cause IIC to run as an independent application and should allow the AJAX to work.


Thanks aquillin.

I fixed the problem. I noticed a javascript error "'Sys' is undefined" is thrown on my ASP.NET page in the ASP application. Then I did research on this error and found a usefull link on the net http://weblogs.asp.net/chrisri/archive/2007/02/02/demystifying-sys-is-undefined.aspx and came to know that its the problem in the web.config file.

I supposed to add the AJAX specific entries to the web.config file. But the new issue was the ASP.NET application works indepently and I didn't made any changes to it while copying it as a sub folder for ASP application. After little research on the ASP applicatoin I found that there is another web.config directly under the /AspApp folder. So copied the <System.web.extensions> and other AJAX specific configurations to /Aspapp/web.config from /Aspapp/IIC/web.config and everything started working fine.

Accessibility

When people talk about Accessibility, I think of Section 508 and allowing
blind/disabled people to use an application. I put this small test of Atlas
together for a blind friend of mine to test. It is at
http://216.187.235.116/atlassection508test/. It seems that the applications
runs find and he is able to see/hear the content using JAWS
(www.freedomscientific.com). So, the question is, what's the cause of the
accessibility discussion with Atlas? What are the issues? I hear
discussion but not statement of the issues.

Wally

--
Wallace B. McClure
"The Harder I Work, the Luckier I Get."
Listen to "The ASP.NET Podcast" at http://www.aspnetpodcast.com/
Database Award: http://url123.com/vc3er
Microsoft MVP - Visual Developer ASP/ASP.NET
AspInsider
"AJAX for ASP.NET" Coming Soon!
ADO.NET Book: http://url123.com/vc2bu
865-693-3004
118 Durwood Rd.
Knoxville, TN 37922
http://www.scalabledevelopment.com/
Blog: http://weblogs.asp.net/wallym/Oops, I missed Bertrand's post on the subject. Thanks.

Wally

wrote in message news:1155492@.66.129.67.202...
> When people talk about Accessibility, I think of Section 508 and allowing
> blind/disabled people to use an application. I put this small test of
> Atlas
> together for a blind friend of mine to test. It is at
> http://216.187.235.116/atlassection508test/. It seems that the
> applications
> runs find and he is able to see/hear the content using JAWS
> (www.freedomscientific.com). So, the question is, what's the cause of the
> accessibility discussion with Atlas? What are the issues? I hear
> discussion but not statement of the issues.
>
> Wally
>
> --
> Wallace B. McClure
> "The Harder I Work, the Luckier I Get."
> Listen to "The ASP.NET Podcast" at http://www.aspnetpodcast.com/
> Database Award: http://url123.com/vc3er
> Microsoft MVP - Visual Developer ASP/ASP.NET
> AspInsider
> "AJAX for ASP.NET" Coming Soon!
> ADO.NET Book: http://url123.com/vc2bu
> 865-693-3004
> 118 Durwood Rd.
> Knoxville, TN 37922
> http://www.scalabledevelopment.com/
> Blog: http://weblogs.asp.net/wallym/
>

Access not running webservice methods with only wsdl file

Hello!

I'm new to web services. I'm using Visual Studio 2005, I'm developing a web app (c#). This application will use a java web service (hosted by tomcat) on the local machine. This webservice need some config to run, but on my developer machine i cannot make this configs.
My question: I cannot run the webservice, so I cannot add it to my "Web references", so I cannot insert the function calls into my code. BUT I have a wsdl file. So, is there any way to add a web reference to my code with this wsdl? (It will not work, but i can build my project)

Many thx

Hi,

Thank you for you post!

Here:

#Web Services Integrationhttp://msdn2.microsoft.com/en-us/library/aa478995.aspx

<quote>

In order to add a Web Reference to a .NET Framework-based Web service client, the target Web service must have a WSDL document available. Apache SOAP 2.2oes not contain any support for WSDL.

</quote>

Apache AXIS, also known as Apache SOAP 3.0, supported generating WSDL files.

We have just tested and VS can add web reference using a local WSDL file.

BTW,Wsdl.exe accepts the path to the wsdl file to generate a proxy.http://msdn2.microsoft.com/en-us/library/7h3ystb6(VS.80).aspx

If you have further questions,let me know.

Best Regards,


Hy!

Thanks for your answer. I solve it strange way: I put the wsdl file to my localhost, so i can add it to my web reference list. It did not work, but i could build my project.


Hi,

I told you in my last reply:

We have just tested and VS can add web reference using a local WSDL file.

So that is the answer:)

Happy coding.

Saturday, March 24, 2012

Accents with ASP.NET AJAX

Hi Everybody, I'm starting study ASP.Net AJAX, and i have a problem!

I create an application with DataBase and GridView, and accents in mine language is not functioning! (portuguese-Brazil) !!!!

What do i must do?

Sorry, I'm Brasilian, My english isn't good!!!

hello.

well, you should take a look at the globalization element:

http://msdn2.microsoft.com/en-us/library/hy4kkhe0.aspx


I tried this, but it does not function exactly, places invalid characters!!!

Tanks

(Portugues)

Eu ja tentei isso, mais ainda n?o funciona! Ele coloca caracteres invalidos!!!

Obrigado


Hi,

In the gridview, there's a property calledHtmlEncode which allows me todisplay the text as I whished, even if the thare accents (I'm doing it with french), and also I have declared in my globalization enviroment the french (<globalizationrequestEncoding="utf-8"responseEncoding="utf-8"culture="fr-FR"/>)... I suppose that should be enough...

I once had a similar issue during display of some text from the database and I was able to solved with the statement:

Server.HtmlDecode(MyString)

abortPostBack(); is not working..

Hi, I

I have written a javascript file as

Sys.Application.add_load(ApplicationLoadHandler)

function ApplicationLoadHandler(sender, args)

{

Sys.WebForms.PageRequestManager.getInstance().add_initializeRequest(CheckStatus);

}

function CheckStatus(sender, args)

{

var prm = Sys.WebForms.PageRequestManager.getInstance();if (prm.get_isInAsyncPostBack() & args.get_postBackElement().id =='CancelRefresh')

{

alert('cancelling');

prm.abortPostBack();

alert('cancelled');

}

}

if(typeof(Sys) !=="undefined") Sys.Application.notifyScriptLoaded();

----------------

I have written this to cancel my dropdown list postback But request is not cancelling.

My .aspx code.. is

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

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

<Scripts>

<asp:ScriptReferencePath="Cancel.js"/>

</Scripts>

</asp:ScriptManager>

<div>

<asp:UpdatePanelID="UpdatePanel1"runat="server">

<ContentTemplate>

<asp:DropDownListrunat="server"ID="ddl_testing"OnSelectedIndexChanged="ddl_testing_SelectedIndexChanged"AutoPostBack="True">

<asp:ListItemText="Manoj"></asp:ListItem>

<asp:ListItemText="Atul"></asp:ListItem>

<asp:ListItemText="Punit"></asp:ListItem>

</asp:DropDownList>

<asp:LabelID="Label1"runat="server"Text="Label"></asp:Label><br/>

<br/>

<asp:ButtonID="CancelRefresh"runat="server"Text="Cancel"/>

</ContentTemplate>

</asp:UpdatePanel>

</div>

</form>

While my .cs code is as follow..

protectedvoid Page_Load(object sender,EventArgs e)

{

Label1.Text = ddl_testing.SelectedItem.Text;

}

protectedvoid ddl_testing_SelectedIndexChanged(object sender,EventArgs e)

{

System.Threading.Thread.Sleep(2000);

Label1.Text = ddl_testing.SelectedItem.Text.ToString();

}

}

But my ajax request is not cancelling on clikcking cancel button ..Can anybody tell me why..

Thanks in advance..

Since the Cancel button resides in the UpdatePanel it appends the NamingContainer in the ID.
Try indexof instead of exatct match:

args.get_postBackElement().id.indexOf ('CancelRefresh') > -1

Wednesday, March 21, 2012

A little problem

So! I have a little problem here. Im trying to create a Ajax application on my webhost. I added the dlls from the C:\Program\Microsoft ASP.NET\ASP.NET 2.0 AJAX Extensions\v1.0.61025 and then i tried uploading one of the sample apps. After this i changed the PublicKeyToken so that it were all caps.

Now, it still doesnt work. This is the URL: http://public.smartit.se/ajaxtest/0_Default.aspx

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

What could possible be wrong?

Thank you all!

MS-Ajax needs to be installed on the server(IIS) too


Ohh.. I see. Thats too bad :(

Well thank you for the fast answer!

A high level ATLAS implementation question.

Hello, we are looking into this technology for a project currently in design.

The project is comparable to a browser based chat application so for the purpose of this post I will use a chat example.

  • Five users join a chat session
  • One person types a message and sends it to the group
  • The list of chat messages is updated for each user.

    Let's say the app needs to scale to 10,000 users and the messages are stored in a database and managed on the server.

    We could use Atlas to send the message to the server when the user clicks Send – this works great. My dilemma is how to update each client with the new chat message. We have considered using a timer on the client and polling the server using Atlas for new messages. However, this seems inefficient and doesn't scale due to our capacity requirements and all the net traffic this could produce.

    Is there a way to employ more a broadcast model using the Atlas technology? Could we use an Event in the server code that makes anOnCompletecallback to each cleint who's joined the session? Is there another way to message from the server to multiple clients?

    Thanks in advance for any advice you can provide, links, documentation, examples, etc...

    Kind Regards.

    Sounds like you should use a "Broadcast Pattern".
    ie.
    - all active users become part of some "active user broadcast list" as they join a chat session
    - then some class/thread is invoked to broadcast the message to all users in the list
    In between or after you can store the message in a db or whatever.
    dev


    Dev, thanks for the response.

    Yes, the broadcast pattern is along the lines we're thinking. The question is how to implement this model.

    I imagine we could wire up an Event in the server code that would fire when there's a new message submitted by any client.

    How then would the server broadcast the message to each of the web clients who are participating (up to 10000). Could an individual thread be kept alive somehow on the server for each client? This is where we were thinking about the OnComplete logic supported by Atlas. It seems like there's an AJAX solution out there somewhere for this.

    Thanks in advance for any more advice.


    Hi Bill,

    Here is how you could implement your chat s/w:

    Server side:
    Create the below webmethods:
    1. UpdateMe_async()
    polls the db for new messages. When new messages are available it returns an array of messages and client ids.
    2. ReceiveMsg(messagestring, clientid, otherparams...)
    Receives and adds the message to the db.

    Client side:

    Do the following:
    Onload:
    Make an async call to UpdateMe_async() webmethod. Set the call back to a function say func_UpdateMe().
    func_UpdateMe()
    Displays messages.
    On send button click:
    Make a call to the ReceiveMsg() webmethod.


    Hope it helps!

  • a first-day atlas user got this error, HELP!

    when i following the basic atlas application from the following link, btw, I didn't use visual studio, I just manually do it from text editor and command line compiler.

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

    I got a "syntax error" when I launched the page. then when i input text and pressed button, I got "sample undefined" error and nothing happen.

    This is the log :

    2006-06-29 20:21:18 192.168.1.1 - 192.168.1.36 80 GET /AtlasScript.aspx - 200 Mozilla/4.0+(compatible;+MSIE+6.0;+Windows+NT+5.0;+.NET+CLR+1.1.4322;+.NET+CLR+2.0.50727) -
    2006-06-29 20:21:19 192.168.1.1 - 192.168.1.36 80 GET /WebResource.axd d=-qnjsxFIQPRe60N1ywfq1ZGbOVMGC5TKMX4JTqrXTR7atJCaMTR4Fc76IpI0uvmBTmmGba1jsr6v9f3MrKscIivr3HdGL-IH8Yqrm9oH01I1&t=632799165960000000 200 Mozilla/4.0+(compatible;+MSIE+6.0;+Windows+NT+5.0;+.NET+CLR+1.1.4322;+.NET+CLR+2.0.50727)http://www.mydomain.com/AtlasScript.aspx
    2006-06-29 20:21:19 192.168.1.1 - 192.168.1.36 80 GET /HelloWorldService.asmx - 302 Mozilla/4.0+(compatible;+MSIE+6.0;+Windows+NT+5.0;+.NET+CLR+1.1.4322;+.NET+CLR+2.0.50727)http://www.mydomain.com/AtlasScript.aspx
    2006-06-29 20:21:19 192.168.1.1 - 192.168.1.36 80 GET /ErrorPage.aspx aspxerrorpath=/HelloWorldService.asmx/js 200 Mozilla/4.0+(compatible;+MSIE+6.0;+Windows+NT+5.0;+.NET+CLR+1.1.4322;+.NET+CLR+2.0.50727)http://www.mydomain.com/AtlasScript.aspx

    hello.

    can you be more specific about the error? is it a script error?


    yes, it's a script error from browser(IE)

    hello again.

    well, where are you getting it? what does the error message say? where does it stop in the debugger? what's your code? without knowing this we won't be able to help you.


    PROBLEM solved, I followed the installation instruction to modify web.config, it failed, buy when I copied the web.config from atlas folder, it works now!

    Thank you very much!

    90 seconds delay for posting back to the server when user clicks the abortButton

    Hi,

    In my application, I have an UpdateProgress control with an abortButton. I hook the Onclick attribute of this button to a server-side method.

    When the application does not contain a global.asax file, all is working perfectly: When the user click on the abortButton, it posts back immediately.

    But, when the application contains a global.asax file, there is a delay of approximatively 90 seconds between the user's click of the abortButton and the execution of the method in the server-side.

    Here's a little exemple how to reproduce the problem:

    aspx page:

    <%

    @dotnet.itags.org.PageLanguage="C#"AutoEventWireup="true"CodeFile="Default.aspx.cs"Inherits="_Default" %>
    <%@dotnet.itags.org.RegisterAssembly="Microsoft.Web.Atlas"Namespace="Microsoft.Web.UI"TagPrefix="cc1" %>
    <!DOCTYPEhtmlPUBLIC"-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <htmlxmlns="http://www.w3.org/1999/xhtml"><headrunat="server">
    <title>Untitled Page</title>
    </head>
    <body>
    <formid="form1"runat="server">
    <div>
    <cc1:ScriptManagerID="ScriptManager1"runat="server"EnablePartialRendering="True">
    </cc1:ScriptManager>
    </div>
    <cc1:UpdatePanelID="UpdatePanel1"runat="server">
    <ContentTemplate>
    <asp:ButtonID="Button1"runat="server"OnClick="Button1_Click"Text="Button"/>
    <asp:LabelID="lblResultat"runat="server"Text="Label"></asp:Label>
    </ContentTemplate>
    </cc1:UpdatePanel>
    <cc1:UpdateProgressID="UpdateProgress1"runat="server">
    <ProgressTemplate>
    Contacting server... <br/><br/>
    <asp:buttonid="abortButton"runat="server"OnClick="abortButton_ServerClick"Text="Abort Request"/>
    </ProgressTemplate>
    </cc1:UpdateProgress>
    </form>
    </body>

    Code behind:

    using

    System;
    using System.Data;
    using System.Configuration;
    using System.Web;
    using System.Web.Security;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Web.UI.WebControls.WebParts;
    using System.Web.UI.HtmlControls;
    using System.Threading;
    using System.ComponentModel;
    using System.Net;

    public

    partialclass_Default : System.Web.UI.Page
    {
    privateEventWaitHandle ewhWait =newEventWaitHandle(false,EventResetMode.ManualReset);

    protectedvoid Page_Load(object sender,EventArgs e)
    {
    }

    protectedvoid Button1_Click(object sender,EventArgs e)
    {
    Thread thread =newThread(newThreadStart(ThreadLong));
    thread.Start();
    ewhWait.WaitOne();
    lblResultat.Text ="End of lengthy method";
    }

    publicvoid ThreadLong()
    {
    Thread.Sleep(100000);
    ewhWait.Set();
    }

    protectedvoid abortButton_ServerClick(object sender,EventArgs e)
    {
    ewhWait.Set();
    }
    }

    Global.asax

    <%

    @dotnet.itags.org.ApplicationLanguage="C#" %>
    <scriptrunat="server">
    void Application_Start(object sender,EventArgs e)
    {
    // Code that runs on application startup
    }void Application_End(object sender,EventArgs e)
    {
    // Code that runs on application shutdown
    }void Application_Error(object sender,EventArgs e)
    {
    // Code that runs when an unhandled error occurs
    }void Session_Start(object sender,EventArgs e)
    {
    // Code that runs when a new session is started
    }void Session_End(object sender,EventArgs e)
    {
    // Code that runs when a session ends.
    // Note: The Session_End event is raised only when the sessionstate mode
    // is set to InProc in the Web.config file. If session mode is set to StateServer
    // or SQLServer, the event is not raised.
    }
    </script>

    To Reproduce the problem:

    1- put a breakpoint in theabortButton_ServerClick method
    2- Execute the application and clickButton1
    3- clickAbort Request
    4- after 90 seconds, the application breaks.
    5- Remove Global.asax from the solution
    6- Execute the application and clickButton1
    7- clickAbort Request
    8- the application breaks immediately.

    This delay appends also under different conditions; I explained the Global.asax case because it is the easiest to reproduce.

    Is there someone knowing the reason of this behavior?

    How can I force a postback of the abortButton ?

    Thank you for any input .

    Well it looks like you have gone to quite a bit of trouble just to get an abortButton cancel the current requests. I hate to tell you but there is a much easier way to abort requests. Atlas has a special button called abortButton (go figure). So basically the atlas framework looks for a button event with the id of abortButton. You don't have to create some custom method to cancel the request the atlas framework handles it, and it works great. Below is all you have to put into the UpdateProgress template and you will be set. At least now you have some really cool code to shutdown events :). By the way when you press the button it doesn't force a postback it just ends the request.

    <

    inputid="abortButton"type="button"runat="server"value="Stop"/
    Have fun!

    JoeWeb


    Hi JoeWeb.

    Thanks for your quick reply.

    I am using the Atlas abortButton.
    I don't think it's matter if it is a "input type=button" or a asp:button, both are translate by Atlas like this :

    <button id="UpdateProgress1_abortButton">
    <click>
    <invokeMethod target="_PageRequestManager" method="abortPostBack" />
    </click>
    </button>

    But just to be sure, I try this button

    <input id="abortButton" runat="server" type="button" value="Stop" onclick="AbortRequest()" />

    and in the javascript AbortRequest() I call the server via anICallbackEventHandler method.

    Atlas is doing a great job cancelling the request on the client side. The problem is that it does not cancel it on the server-side, the methode is still running.
    You can verify that by placing a breakpoint in a long request. Even if you cancel it, the breakpoint will eventually be hit.

    In my application, if somebody cancel the request I have some cleanup to do. So, if somebody cancels with the abortButton, the server must be inform in some way.

    I also notice that if you cancel a request and re-submit it immediately, Atlas waits 90 seconds before posting it to the server.


    Don't know what to tell you then. The application we have using atlas handles about 15 million records in a database for tons and tons of customers and it handles requests just fine. Haven't had any problems with it taking longer to send a request right after aborting it. We serve alot of data back and forth and it handles the request no problem. Sorry, don't know what to tell you.

    Good luck.

    JoeWeb


    I finally pin-pointed the problem with the Atlas abort button.

    I was wrong when I said that there was no request to the server when the Abort Button is clicked.
    I traced Global.asax and I found out that the BeginRequest event is triggered.

    The problem is with the creation of the handler between the ResolveRequestCache event and the AcquireRequestState event; this operation takes almost two minutes to complete.

    I don't know why it tooks so long. For other request than the Abort Button it's very fast.

    Am I the only one to have this problem ?