Labels

Tuesday, January 22, 2008

Onsite Trips ....Sixth Time

So now lastly I got the ever waiting Onshore opportunity. All missed yet – But this not.

Sixth Time –

§ Offered by Xp Pune in Oct 2007 [http://www.xp.com/]

§ Location – Beverly MA, USA

§ Why not missed –

o Everything was according to me – Technology (Everything to me).

o I have been to there for almost 2 months.

o It was really exiciting when I got the US tickets. Moreover, when I got the chance to enjoy Halloweens, Time in Boston and the BayWatch beaches, it was like heaven on earth.

o Talking about the facilites – Amazing. Free Bus Passes, Free Personal Calls, Free Mobile Support .. . long list.

o Nice experiences – Custom Checking for my food bag. Lost Baggage, Lost ATM ..

Moreover, hatsoff to Usites. No body can be like them, even after next 25 years.

Thanks & Regards,

Arun Manglick Tech Lead



From: Arun Manglik
Sent: Monday, October 01, 2007 2:48 PM
To: 'arunmanglick.post@blogger.com'
Subject: Onsite Trips .... Fifth Time


This is about the Onshore opportunities been provided to me so far – And Till now, All missed. Why it happened ?

Fifth Time –

§ Offered by EBS WorldWide Mumbai in July 2007 [www.ebsworldwide.com]

§ Location – NJ USA

§ Why missed –

o This offer is been proposed by one of my Senior Architect – Anit Bhatnagar.

o The offer was to work in US for 6 months.

o The time when I have been offered, I was attached with Persistent Pune.

o Looking at the bright future I joined there at 09July07 with two more friends – Saurin & Prashant

o After joining, I found that actually the offer is only for 2 months and rest all of work would be in Mumbai.

o This made a big change in my decision and I thought to not to continue the offer, bcoz I did not want to work in Mumbai - And I missed the offer.

Eventually two of my friend continued on the same and they are there, though the 2 months have passed.

Thanks & Regards,

Arun Manglick Tech Lead


Raising Exceptions from Web service

Here we’ll see how the exception raised form the Web Service can be handled at the Caller level.

SoapException Information -

· Web services are limited in their ability to propagate exceptions using the Simple Object Access Protocol (SOAP).

· The .NET Framework provides the SoapException class as the only means to raise exceptions using SOAP.

· When a Web service method throws any unhandled exception, the exception is repackaged as a SoapException and is returned to the Web service client via the SOAP response.

· The ServerFaultCode is used to indicate that an error that was not a result of the message format or contents occurred during the processing of the request.

· On a .NET-based client, the Framework captures the SOAP message and deserializes the SoapException so that the client can detect exceptions through standard exception handling techniques, just as it would for a non-Web service call. However, the exception that is detected on the client is a SoapException, not the exception type that was originally thrown by the Web service.

· Information about the original exception is included in the Message property of the SoapException.

Hiding Exception Information -

· For Web services that are exposed to external companies and systems, you may not want to expose all of your exception information to your clients. You should throw an exception to your clients so that they can react.

· In this case, you should create a generic application exception that contains any information you want to convey. After catching an unhandled exception in your Web service, you should log the exception and perform any necessary processing, then construct a new instance of the generic application exception. You can then set any desired information in the generic application exception and throw it to the client. This allows you to log detailed information in the Web service and throw a less detailed exception to your clients.

Contradiction to Hiding Exception Information –

Whenever an exception [Even a fresh exception and Even a fresh Custom Exception] is thrown from the Web Service, it is throw as an ‘Soap Exception’.

e.g

System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.Exception: WebService Exception at Service.HelloWorld() --- End of inner exception stack trace ---

[WebMethod]

public string HelloWorld()

{

try

{

throw new Exception("WebService Exception");

}

catch (Exception ex)

{

throw new Exception("WebService Exception"); // Or Below

throw new CustomException("Throw Custom");

}

}

public class CustomException : System.ApplicationException

{

public CustomException()

{

//

// TODO: Add constructor logic here

//

}

public CustomException(string msg)

: base(msg)

{ }

}

Thanks & Regards,

Arun Manglick || Tech Lead


Friday, January 18, 2008

HTTP 1.1 500 Internal Server Error

HTTP 1.1 500 Internal Server Error

http://www.gotdotnet.com/community/messageboard/Thread.aspx?id=175052


iisreset /stop
net user ASPNET /delete
aspnet_regiis -i
iisreset /start


Thanks & Regards,

Arun Manglick || Tech Lead

DefaultButton and DefaultFocus in Master-Content Page

Default Focus, Buttons and Validation Errors with ASP.NET 2.0

One of the common requests with ASP.NET 1.1 today is to have better control over what happens when a user in a browser hits the enter key without having a button or post-back control selected.

ASP.NET 2.0 makes this easier by supporting the concept of a "default button" that can be indicated on either a <form> or <asp:panel> container control. If no button is selected at the time the enter key is selected, the defaultbutton property will drive the appropriate post-back to the server and route the message to the control you want.

<html>
<body>

<form defaultfocus=“textbox2” defaultbutton=“button1” runat=“server”>

<asp:textbox id=“textbox1” runat=“server”/>
<asp:textbox id=“textbox2” runat=“server”/>

<asp:button id=“button1” text=“Same Page” runat=“server”/>

<asp:panel defaultbutton=“button2” runat=“server”>

<asp:textbox id=“foo” runat=“server”/>

<asp:button id=“button2” runat=“server”/>

</asp:panel>

</form>
</body>
</html>

· Here if the enter key is selected the first time the page is loaded, "button1" will be the button that receives the post-back event.

· If the enter key is hit while the user has their cursor focus within the "foo" textbox (contained wtihin the <asp:panel>), then "button2" will be the button that receives the post-back event.

There is a catch in this feature, when the page is using Master Page. In this case, below would be required to handle the situation.

protected void Page_Load(object sender, EventArgs e)

{

Page.Form.DefaultButton = Button2.UniqueID;

}

protected void Page_PreRender(object sender, EventArgs e)

{

Page.SetFocus(TextBox2);

}

Thanks & Regards,

Arun Manglick || Tech Lead

Thursday, January 3, 2008

Validation Groups

Validation Groups are required in two cases.

· To separate the Validations for controls contained in two separate Divs, Panels.

· To separate the Validations for controls contianed in User Control and the Container Page.

In ASP.NET 2.0, you no longer face this problems in implementing above. The ASP.NET 2.0 Framework introduces the idea of Validation Groups. A validation group enables you to group related form fields together.

In first case, all is required to introduce the ‘ValidationGroup property for Validation Controls and the Button control only. [Not for any Textbox controls].

<form id="form1" runat="server">

<div style="border: 1px solid blue; float: left; width: 100px">

<fieldset>

<legend>Login</legend>

<asp:Label ID="lblUserName" Text="User Name:" AssociatedControlID="txtUserName" runat="server" />

<br />

<asp:TextBox ID="txtUserName" runat="server" />

<asp:RequiredFieldValidator ID="reqUserName" ControlToValidate="txtUserName" Text="(Required)"

ValidationGroup="LoginGroup" runat="server" />

<asp:Button ID="btnLogin" Text="Login" ValidationGroup="LoginGroup" runat="server" />

</fieldset>

</div>

<div style="border: 1px solid blue; float: left; width: 100px">

<fieldset>

<legend>Register</legend>

<asp:Label ID="lblFirstName" Text="First Name:" AssociatedControlID="txtFirstName"

runat="server" />

<br />

<asp:TextBox ID="txtFirstName" runat="server" />

<asp:RequiredFieldValidator ID="reqFirstName" ControlToValidate="txtFirstName" Text="(Required)"

ValidationGroup="RegisterGroup" runat="server" />&nbsp;<br />

<asp:Button ID="btnRegister" Text="Register" ValidationGroup="RegisterGroup" runat="server" />

</fieldset>

</div>

</form>

In the second case, the same is required.

Note:

It is not mandatory to implement the ‘ValidationGroup’ concept in both the Divs. Implementing in only one will do. Similar is for User Controls.

Thanks & Regards,

Arun Manglick || Tech Lead

Wednesday, January 2, 2008

AutoEventWireup - Page Attribute

By default the ‘AutoEventWireup = true’. It means that without attaching the events of the Page (Init, Load, PreRender, UnLoad) with any Event Handler (Page_Init, Page_Loa etc), the event handlers are called automatically.

But in case of ‘AutoEventWireup = false’, to enable such event handlers to be fired, you’ll be required to bind the events with the event handler in the form tag as below.

<form id="form1" runat="server" onload="Page_Load" oninit=" Page_Init" onunload="Page_UnLoad">

Thanks & Regards,

Arun Manglick || Tech Lead |

B'Bye 2007

Do not have time to breath:

While 2007 saw the launch of several different technologies, two primary themes emerged: AJAX and the Microsoft .NET Framework 3.0.

AJAX:

· AJAX was inaugurated as a first-class Web application development platform with the ASP.NET AJAX Extensions.

· The extensions library introduced both Client And Server Libraries that can abstract much of the plumbing detail involved in connecting JavaScript code running in the browser with business logic running on an application server.

· Additionally, the library established a new mechanism for dynamically associating script behaviors with existing controls, provided localization functionality on both client and server, and much more.

The .NET Framework 3.0 introduced three technologies that are already causing a dramatic shift in how applications are architected.

· Windows Presentation Foundation (WPF) took the traditional message-pump, clipping-rectangle architecture of Win32 and flipped it on its head, leveraging advancements in graphic cards and offering Windows developers the declarative, container-based mode of authoring user interface elements long enjoyed by Web application developers.

· Windows Communication Foundation (WCF) pulled together all the various methods of creating a distributed application under one abstraction layer.

· Windows Workflow Foundation (Windows WF) added a declarative workflow modeling language and execution engine, functionality that was previously available only as an additional app, not as a platform service.

Silverlight has been poised to take the world by storm, enabling a richer browser-based user experience than has yet been possible in Web application development. Moreover, with the release of LINQ in Visual Studio 2008 and the ADO.NET Entity Framework (following soon after the Visual Studio release), how we think about data access is about to undergo a major paradigm shift.

When you consider the enormity of the .NET Framework 3.0 and AJAX is it now a best practice to abandon all of those OO practices and split class hierarchies into pairs of logic service classes and data token classes that can easily be passed between remote services.

So if you think you’ll get two seconds to take a breath, keep holding on. J

Thanks & Regards,

Arun Manglick Tech Lead

FW: B'Bye 2007

Do not have time to breath:

While 2007 saw the launch of several different technologies, two primary themes emerged: AJAX and the Microsoft .NET Framework 3.0.

AJAX:

· AJAX was inaugurated as a first-class Web application development platform with the ASP.NET AJAX Extensions.

· The extensions library introduced both Client And Server Libraries that can abstract much of the plumbing detail involved in connecting JavaScript code running in the browser with business logic running on an application server.

· Additionally, the library established a new mechanism for dynamically associating script behaviors with existing controls, provided localization functionality on both client and server, and much more.

The .NET Framework 3.0 introduced three technologies that are already causing a dramatic shift in how applications are architected.

· Windows Presentation Foundation (WPF) took the traditional message-pump, clipping-rectangle architecture of Win32 and flipped it on its head, leveraging advancements in graphic cards and offering Windows developers the declarative, container-based mode of authoring user interface elements long enjoyed by Web application developers.

· Windows Communication Foundation (WCF) pulled together all the various methods of creating a distributed application under one abstraction layer.

· Windows Workflow Foundation (Windows WF) added a declarative workflow modeling language and execution engine, functionality that was previously available only as an additional app, not as a platform service.

Silverlight has been poised to take the world by storm, enabling a richer browser-based user experience than has yet been possible in Web application development. Moreover, with the release of LINQ in Visual Studio 2008 and the ADO.NET Entity Framework (following soon after the Visual Studio release), how we think about data access is about to undergo a major paradigm shift.

When you consider the enormity of the .NET Framework 3.0 and AJAX is it now a best practice to abandon all of those OO practices and split class hierarchies into pairs of logic service classes and data token classes that can easily be passed between remote services.

So if you think you’ll get two seconds to take a breath, keep holding on. J

Thanks & Regards,

Arun Manglick || Tech Lead