Archive for the ‘ASP.NET’ Category

Orientation aware control for Mobile

December 27, 2008

I have been involved in developing mobile web applications for almost a year and half now. In this period I developed few applications where the requirement was to change the orientation of the layout (horizontal to vertical and vice-versa) automatically based on device width. Some times (in case of new age phones like iPhone, Storm) this may be also depending on the how the device is being currently viewed.

In such scenario’s we used to break lot of our head to make the page work and yet support different orientations supported by the phone. In achieving this we used to end up having either two layouts or change the controls location based on the current orientation of the phone/device. This is really a time consuming job and very boring job for a person like me.

Today, I found a user control called Orientation Aware Control, which automatically does this job for us. Although this is not free control, it supports classic phones to the Windows Mobile 6.0/6.1.

From OAC website:

The Orientation Aware Control allows designing and coding a single control or form with multiple layouts or skins that are automatically applied at run-time (and design-time) according to the available form factor, resolution and orientation. Its outstanding Visual Studio forms and user control designer integration and zero-code adaptive UI behavior make the Orientation Aware Control a must-have companion for any mobile shop targeting multiple devices, bringing back the productivity you need to focus on growing your business.

Advertisements

DebuggerStepThrough attribute

November 6, 2008

Pedram Rezaei has written how we can let .NET debugger know, not to step in to certain elements of your program with the help of DebuggerStepThroughAttribute.

Read it here

Accessing Master page properties

May 14, 2008

Other day I needed to access the property defined in Master page and was facing an issue. The issue was what if the master page is renamed? The namespace would change and it will break the code.

I googled for a better option and found exactly what I wanted. Below is the link where the author has neatly explained how this can be done.

http://dotnetbyexample.blogspot.com/2007/10/right-way-of-accessing-master-page.html

Encountered one more error!

March 17, 2008

I recently encountered one more error and was able to resolve soon with the help of one of my colleague.

For those who reading this blog, I have no intention to keep posting errors I encountered, but after all this is a blog which is only intended to have issues encountered in my work life 🙂

However I still feel, my posts may help someone who encounters the same error. Hence with this dual things in my mind I continue to post these errors.

Ok now, I was trying to execute a mobile web application, with IIS6 and .net framework 1.1, and I got the following error.

image2

As you can see from the screenshot, application was trying to write to Event Log. From the exception you can grasp that it is a permission issue while reading a registry key.

Following are the steps to resolve this Event Log Permission error:

1. Open registry editor.

2. Drill-down to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog.

3. Right-click on Eventlog and click permissions.

4. Add Local machine\users to the list and give full control permissions and click OK.

5. Then drill-down to next level in Eventlog\Security.

6. Right-click on Security and click permissions.

7. Add Local machine\users to the list and give full control permissions and click OK.

That’s it! This error is gone!

PS: Having said that if these steps does not resolve the issue, you can also try changing the authentication from network to System Account in IIS.

ASP.NET State Server error!

February 20, 2008

After a full day work, I deployed my project which is an mobile web application, on to a testing server yesterday. The application is built using .net framework 1.1.

After deployment, I hit the URL in the web browser, and to my shock got the below error.

error

Thankfully, the error stated how to resolve error “Please ensure that the ASP.NET State service is started…”. I hit services.msc from run menu and yes, ASP.NET State Service was not running!. I started it, and refreshed the URL, the page appeared!

Good that I fixed the problem immediately, thanks to asp.net for conveying error neatly this time!