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

Monday, March 26, 2012

Exposing desktop applications to the web through AJAX

Hi,

I would like to present a very impressive application that provides access to a desktop only application through the web. This is a power full demonstration of the capabilities of Visual WebGui which is an open source framework that provides WinForms like development for developing web application.

Here is a link to a web cast showing this application:

http://www.networkd.com/demos/inferno/ 

Hope you find this intriguing enough to find our more about Visual WebGui (http://www.visualwebgui.com). If you do I would be happy to give you guys more information.

Cheers,
Guy

Hi,

As far as I know, AJAX isn't design to do that.

I have searched a lot for your, and found you post this topic to several forums.

I agree withW3bbo's reply athttp://channel9.msdn.com/ShowPost.aspx?PostID=359753

?The web isn't winforms though, and I believe it's a fallacy to try to mimic local apps within a browser. Remember, the author has very little control over the client and webapps are much easier to break, abuse HTTP, place tight requirements on the client end (often requiring client script (or worse) to be enabled), and have a disproportionately long development time.

Not forgetting the WYSIWYG paradigm they're based on, when the web is inherently WYSIWYM.

Never mind how not a single GUI framework for the web has full compliance with the specifications.

How is this project justified?

If you have further question,let me know.

Best Regards,

Saturday, March 24, 2012

Exceptions

Hi,I'm using webservices to get data from the server in my application, in certain circumstances I throw an exception that gets catched in the failed callback function in the client, and depending in the exception type a message is shown to the user, this works great when the browser and the server are in the same machine, but when I call the application from a different machine I get what I think is a default exception, with the message "There was an error processing the request." instead of my own exception, could someone tell me if this is by design, and if so how can I change this behavior so I can get my exceptions, or I'm doing something wrong here?

Thanks.

This is quite true when application is deployed with debugmode set false which we always do. Read the following article where I have shown an effective error logging in asp.net ajax.
http://dotnetslackers.com/columns/ajax/AspNetAjaxExceptionLogging.aspx


Thanks for the great article Kazi,I concord with you, the (some) exception information should be presented in the client side, I understand this is done for security reasons, but in my case for example I catch all exceptions in the webserver and log the relevant ones, and then only for some I throw a new exception to inform the user, for example when the user tries to save a duplicated record I catch the SqlException (this one doesn't need to be logged) and throw my own exception that tells the client application to show a message to the user telling him that there's all ready a record with that name in the database.


Yes, it should at least return the Exception message.


Hi,

In order to send real error message to the client side on a different machine, please turn CustomError off in web.config.


<customErrors mode="Off" />


Yes I have been forced to do that already, I really don't like it, but I need this for my implementation to work, fortunately I already catch all (I certainly hope so) the exceptions and only show the information I want in the client.

Exception thrown from code inside an updatepanel is not handled by global.asax Application

Hi All

In the application I developed, I had the code to log the exceptions in Global.asax. This was working fine until I use Ajax update panel in the code behind of a few files.

When an exception happens in the code, called through update panel, Application_Error handler in the global.asax is never called.
Instead I can see an alert with the exception.message.

Is this a known issue? if so, is there a was to call the Application_Error automatically in case any exception thrown.

Thanks

Hi,

It's not a issue, but designed to work so.

If it's a asyncRequest, an custom error handler will be registered to handle any exception. The error message is encoded and returned in the internal error handler. And it's worth mentioning that this exception isn't swallowed and theoretically speaking, the appliction_error is able to fire.


Hi,

Thanks for the reply.

But the Application_Error event is not called.

I tried setting breakpoint in the function entry point and indused an Object Reference Is Nothing Errror within the code that is called through UpdatePanel. The breakpoint is not getting hit. Even in the test server, the errors are not getting logged. Is there any way, we can override the Ajax custom error handler or just make the Application_Error event to be called.


I used the following code, and it's able to trigger the Application_Error method.

<%@. Page Language="C#" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><script runat="server"> protected void Page_Load(object sender, EventArgs e) { } protected void Button1_Click(object sender, EventArgs e) { Label1.Text = DateTime.Now.ToString(); throw new Exception("custom exception"); }</script><html xmlns="http://www.w3.org/1999/xhtml"><head runat="server"> <title>Untitled Page</title></head><body> <form id="form1" runat="server"> <div> <asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager> <asp:UpdatePanel ID="UpdatePanel1" runat="server"> <ContentTemplate> <asp:Button ID="Button1" runat="server" Text="Button" onclick="Button1_Click" /> <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label> </ContentTemplate> </asp:UpdatePanel> </div> </form></body></html>

Can you try it? Please let me know the result.


Hi

One more thanks for the reply.

I tried the code, the exception is getting thrown, but still the breakpoint in application_error is not being hit.


Can you simplify your app into a single page along with web.config that is able to reproduce the problem and mail it to me?

Hi Mr.Raymond Wen,

Many thanks for your continued support.

Below I post a simple "Not in use" page, for your understanding

<%@. Page Language="VB" AutoEventWireup="true" CodeFile="Default.aspx.vb" Inherits="_Default" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><script runat="server"> </script><html xmlns="http://www.w3.org/1999/xhtml"><head id="Head1" runat="server"> <title>Partial-Page Update Error Handling Example</title></head><body> <form id="form1" runat="server"> <div> <asp:ScriptManager ID="ScriptManager1" runat="server" OnAsyncPostBackError="ScriptManager1_AsyncPostBackError"> </asp:ScriptManager> <asp:UpdatePanel ID="UpdatePanel1" runat="server"> <ContentTemplate> <asp:TextBox ID="TextBox1" runat="server" Width="39px"></asp:TextBox> / <asp:TextBox ID="TextBox2" runat="server" Width="39px"></asp:TextBox> = <asp:Label ID="Label1" runat="server"></asp:Label><br /> <asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="calculate" /> </ContentTemplate> </asp:UpdatePanel> </div> </form></body></html>
PartialClass _DefaultInherits System.Web.UI.PageProtected Sub Button1_Click(ByVal senderAs Object,ByVal eAs System.EventArgs)Try Throw New Exception("FOR TESTING")Finally End Try End SubEnd Class


GLOBAL.ASAX

'This code is not being called during an asyncronous postback'But this is called when a request is made directly without using UpdatePanel.Sub Application_Error(ByVal senderAs Object,ByVal eAs EventArgs)Dim exAs System.Exception = Server.GetLastError()TryIf ex IsNotNothing ThenWriteLog(ex)End IfServer.Transfer("~/ErrorDescriptionPage.aspx")CatchEnd TryEnd Sub

Hope this will help to identify the issue.

Thanks once again


One more thing is that I use Microsoft Entreprise Block for exception handling

Thanks


Still, I can fire the Application_Error method. I guess it's caused by come configurations. That's why I want your web.config file.

Can you post it here?

Exception not being sent

Hi there!
I'm having a little bit of trouble trying to catch exceptions thrown by the application.
I inserted the scriptmanager tag inside the head tag:
<atlas:ScriptManager ID="scriptManager" runat="server">
<Services>
<atlas:ServiceReference Path="ChatService.asmx" />
</Services>
</atlas:ScriptManager>
I've already tried to put the GenerateProxy = "true" property and still doesn't work...
when I call a webmethod, I do something like:

ClassName.WebMethod(attributes, onCallOk, onTimeout, onError);

the functions are inside a .js file.

The darkiest thing is that when the error occurs on my machine I cansee the message from the exception, but, when someone from anothermachine (acessing my machine) receives the error, the message from theexception is sent empty, even when the same occurs...

is there something that I have to do to allow remote computers to receive the exception?

thanks!!!

hi leandrokoiti,

you can have a look at Nikhil blog:

http://www.nikhilk.net/AtlasM1Refresh.aspx

they talk about that subjet

everything was fine, when suddenly AJAX Stopped working

I was working on a small AJAX application on a windows 2003 server web application running on IIS 6.0

I putted an AJAX timer control on the web form

and on the Tick Event I wanted a label called Label1 to take the current time every second

code:

Label1.Text = Now.ToString()

It was working , but somehow I was changing in the IIS configuration when the application stops working

I tried the same application on another PC (windows xp + Visual Studio 2005), it worked fine in debugging mode

so I installed Visual Studio 2005 on the server to know what's the problem, and in debugging mode, the application starts normally, but the label does not change its text value

I uninstalled AJAX Extensions, reinstalled again, nothing changed

I tried : aspnet_regiis -i

nothing changed, please help, I tried a lot, I think there is something about security scripts on the server that is not allowing AJAX scripts to work.

thanks in advance.

Hi,

Please make sure the virtual directory isconfigured as a Application and using the asp.net 2.0.

1. Run inetmgr command

2. Expand and navigate to the virtual directory

3. Right click it and select properties

4. Click Create Button in Application Settings section

5. Active ASP.NET tab

6. Make sure asp.net version is correct

Hope this helps.

Wednesday, March 21, 2012

Even Hello World wont work for me

Hi,

I am creating a simple ASP.NET AJAX Beta 2 application as follows:

<%@dotnet.itags.org.PageLanguage="C#"AutoEventWireup="true"CodeFile="Default.aspx.cs"Inherits="_Default" %>

<!

DOCTYPEhtmlPUBLIC"-//W3C//DTD XHTML 1.1//EN""http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

<

htmlxmlns="http://www.w3.org/1999/xhtml">

<

headrunat="server">

<title>Untitled Page</title>

</head>

<body>

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

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

</asp:ScriptManager>

<div>

<spanid="Span1"></span>

</div>

<scripttype="text/javascript">

function pageLoad()

{

var l=new Sys.UI.Label($('Span1'));

l.initialize();

l.set_text("Hello World");

}

</script>

</form>

</body>

</html>

It is NOT WORKING at all :-(. Where am I wrong?

You need install Preview CTP and refer them in the scriptmanager. Label control is in Sys.Preview.UI namespace.

Error:Type System.Web.UI.ScriptManager does not have a public property named EnableScriptC

This is the error i got when compiling my application with scriptmanger's EnableScriptComponents set to true. Is the property EnableScriptComponents deprecated and if so, is there a replacement?

The ScriptManager public methods and properties are documented on thissite. That property may have been supported in an earlier beta of atlas. I am not sure what that property did but you could try to find something equivalent in the docs or it may be completely unnecessary now.