Wednesday, November 05, 2008

.NET | Failed to load viewstate ?

Hello,
Today I am working on one of our Real State Agent’s website and I came across with the following error:

Server Error in '/' Application.
Failed to load viewstate. The control tree into which viewstate is being loaded must match the control tree that was used to save viewstate during the previous request. For example, when adding controls dynamically, the controls added during a post-back must match the type and position of the controls added during the initial request.

After a short research I found http://geekswithblogs.net/FrostRed/archive/2007/02/17/106547.aspx which explains in depth what really ViewState: the ViewState tree (type of Triplet or Pair) is NOT the ViewState property (type of StateBag) of the page or any of its controls. You can think it as an object representation of the ViewState value on the html page (the __VIEWSTATE hidden field), which contains all the values need to be written back to the controls during a page postback. If you don't change the default behavior, during the page initialize/load phrase, the ViewState tree will be created by de-serializing the value __VIEWSTATE field by LoadPageStateFromPersistenceMedium(), and the values on the ViewState tree will be put into the controls ViewState bag in LoadViewState() . During the page save/render phrase, the ViewState tree will be created again by SaveViewState (), then serialized and written onto html page by SavePageStateToPersistenceMedium ()”

This help me to have a better understanding of viewstate but did not solve the issue, then I found http://weblogs.asp.net/alessandro/archive/2008/01/04/failed-to-load-viewstate-typical-problem-with-an-obvious-solution.aspx which mentioned that this error can be caused by “changing the order of controls, that is, when your loading a dynamic control, make sure the order in which you create it, has the same order when you recreate it.”

After reading at this article, I noticed that the HTML portion of my Server Control looked like this:
<div><asp:literal id="BizCardTitle" runat="server"></asp:literal></div>
<
div><cc1:remsimage runat="server" id="img_BizCardPhoto"></cc1:remsimage></div>

But my code behind shows:
Me.LoadImage(objContact.ImageID)
LitBizCardTitle.Text = m_objSite.OwnerTitle

Rearranging the controls solve the problem. I recalled changing the order on the HTML portion only. This changed the order in which controls are added after postback. Therefore the viewstate loaded
Me.LoadImage(objContact.ImageID) into LitBizCardTitle.Text and biceverse.

Percy Dyer
.NET Web Application Developer

Tuesday, April 10, 2007

Canal Financial | Data Base Driven Admin Tool

About Canal Financial:

Canal Financial was founded in 1992 as a consulting firm for small banks in South Florida. In 1995, Canal Mortgage established itself as a major mortgage broker with offices in Florida and Puerto Rico.

In 2001, Canal Group started offering business financing options such as bridge loans, mezzanine loans and receivable financing.

In 2005, Canal Financial, LLC became a licensed mortgage lender in the state of Florida offering a range of financing products and services under one roof.

Project Description:
The CEO for Canal Financial, needed a Data Base driven Admin tool to Create and Maintain Trust Deeds. The details are explained next:

Design and Implementation of Access or SQL data base to accommodate all the required fields: Photo, Loan Number, Borrower information, Guarantor information, Security information, Loan terms conditions, etc.

Image Up-Loader. This feature will allow the Web Administrator to upload images into the server from anywhere, without using any complicated FTP application.

Template archive. This feature will control the looking and feel of the page via CSS, providing a set of 4 different templates to choose from. These templates not only will control the colors of the page, but also fonts, and other esthetical features.

Completely data base driven, detail page as:http://www.canalfinancial.com/Deedslist.asp
Data base driven “Print friendly version” page.

Final landing send-by-email application form, which will be displayed after the visitor has selected a specific trust deed investment loan number.

Here are screen shots of the final result:

#1. Admin Tool Title
#2. Link to Create a New Deed
#3. Return to Home Page
#4. Sub-Title of Admin Module
#5. List of Active Trust Deeds
#6. Thumbnail for specific Trust Deeds
#7. Loan Number or Deed Number
#8. Name for specific Deed
#9. Link for View Details of Deed
#10. Link to Edit a Deed
#11. Link to Hide or Show a Deed
#12. List of Hidden Trust Deeds


#1. Link to Edit a Deed
#2. Return to Home Page
#3. Link to back to the Home Page
#4. Title of Admin Module
#5. Fields to document specific information about a Trust Deed

The next screen shot shows a detail of the Maintenance module for an Specific Deed:


Ones a Deed has been hide or show (#1) it will be displayed on different section of the Deed Management module (#2, #3). As the next image can show



How to create a new Deed?
a) go to http://www.canalfinancial.com/admin/deedsmanager.asp
b) Click on "Create a new Deed"
c) Enter all the required fields when you land on (http://www.canalfinancial.com/admin/newdeed.asp)
d) Ones you get to the Upload Images portion of the form do the following:

  • Click on "Cick here to Upload Images" (#1)
  • A new window will be displayed (#2)
  • Click on the "Browse" button to upload a small picture (#3)and a full picture (#4)
  • Ones you click on "Browse" button, you will see window #5, browse to your small image and click "open"
  • Repeat the same procedure to browse to your full image
  • Ones the path for both of your pictures are in place click on "Upload Pictures", This may take couple of minutes so do not do anything until you see the "Image Uploader" window (#6, #7)
  • Now is time to copy (Control + C), and Paste (Control + V) each path (#6, #7) on #1, as the bellow image shows


______________________________
Thanks for visiting my Blog.
Percy Dyer
http://www.dyerprojects.com/

Wednesday, March 07, 2007

Auto Insurance Agents. Design & Development

My name is Percy Dyer, and today I will code a Web Portal for my new clients from the Peruvian Auto Insurance Market.

Project Background:
Some of the topics covered on this Website will include: car cover, getting quotes, how to find the cheapest rates, and the different companies. We also discuss the specialty companies that offer cover and financial products to people who drive unique and specialty cars, such as antique, classic and imported cars.

This website is dedicated to auto insurance. You can find all the information you need concerning auto insurance right here at your fingertips, just by perusing our informative and interesting articles that touch on all aspects of auto insurance and the purchasing of auto insurance. If you want to get free quotes, you can start by searching our directory of insurance companies that provide quality auto insurance to customers.

The following are some approved designs for the website:


These website also provides an application credit form to process client information online:



Here is a screenshot for the Web Portal Map:


Here is a SQL-tables-structure screenshot:


Thanks for visiting,
Percy Dyer
www.DyerPROjects.com

Tuesday, January 30, 2007

Superior International Logistics INC.

My name is Percy Dyer, and today I will code a new website for my good friends of Superior International Logistics INC. which is a full service international express company. Superior International Logistics offers specialized storage, packing and inventory procedures on a personal basis.

Clients have their own Logistics Manager, who is responsible for their specific requirements and is available for constant contact via our line processing system.

Project boudaries: Web Design & Feedbackforms using ASPEmail.

Screenshots

Logo Design (Branding)

Final Logo:


Old Website


New Design

Changes

Final Designs




XML News Feeds from RSS


Thanks for visiting,
Percy Dyer
www.DyerPROjects.com

Sunday, June 25, 2006

The World Cup 2006 is here...Forza Italia!

I am currently driving to my office, and I am thinking in Soccer ones again...But this time was not the kick on the knee I received on my last game with my friend at office...this time I am thinking on what I could do to make this World Cup 2006 unforgettable. What About a Soccer bracket for First and Second Phase (48+17 games)?

So that is how I created my company's bracket for Germany 2006. Here is how I presented it to my co-workers:

The time has come. 32 countries from all around the world will fight to be the new champion for the next 4 years. Will the host, Germany, keep the Cup at home? Will Brazil or Argentina make it again? Will the US team beat the odds to be in the top 3 of the world? Now you can make your picks and win cool cash prizes with our World Cup Bracket Contest. It's $10 per game and very easy to play.

You're one step closer to building your SFX Soccer fantasy squad using a very simple website I have completed last night. But there are a few things to note as you set out to craft a championship side and earn some cash.

Enter the contest by filling in the registration form and then, from the 8 groups of 4 teams, pick the winner country for the 48 games using the check boxes. Check both team boxes to indicate the game will be tide. We will probably create another game for the 2nd round, each game will disqualify one team

Rules
You (and your closest friends) can create as many brackets as you want, but 10$ is required per each bracket. Any money will be well kept by our Treasure advocated: Carlos, so please give him your 10 bucks per bracket to him. Do not worry, everybody knows where Carlos works lol. Once submitted, entries can be changed as many times as you want until the 9th of June. NO entries can be deleted -sorry I did not have more time to work on this project. All entries must be submitted by June 9th 2006 at 0:01 am EST.

Points are allocated as follows:
1 point for every correct pick on the first round (32 teams, and 48 games), a tide game will give you 1 point if you selected both check boxes from the bracket page. Winner takes it all. The prize will be presented the same day the last game of the first round ends.

Any problem or question you may have please send it at pipodyer@hotmail.com
I hope having time to give to this application, another couple of tweaks.
-Percy


Here is a description on the parts and features I presented on my World Cup 2006 Bracket:

1) Here is a screen shots of this project:


2) Here are some features available for the players.


Since the amount of goals on the first 48 games is a tie breaker, there is necessary to provide the total of goals accumulated (#1).

Also, this section will show the last player who score a goal and its country flag. All this information was real-time without my data entry needed thanks for an XML parser I put in place on the home page.

#3, will indicate all the player who have or have not played for the bracket. Off course nobody was late since all my friends at office where constantly monitoring any new change on this website :-)

"Percy, it is necessary a section for Real time news feed so we could keep informed about last minute news about injured players and such.." That is why I created feature #4, a real time news feed from world known news sources as FifaWorldCup.com, Reuters,etc. The next screen shot is the pop-up detail of the news ones you click on each news link.


Feature #5. It will display detailed information about the game of the day, and also games to be played next. This feature will include a brief description of the stadium in which the next game will be played as well as the teams for the battle.

Feature #6. It is the bracket matrix itself. On top the 48 games real time entered as soon as the game finishes, on the left the name of all the players, on the grid 4 colors: RED and Green for winners and losers, pink and apple green for bets on future matches winners and losers.
Finally, on the right side the total points per player and the leader on the bracket indicated with a soccer balls, off course.

Then feature #7, which displays the games been played at the moment and the current score (real time and using XML), then this score will automatically update my bracket.

Finally #8 displays random images of the games currently in curse by automatically determine how many images are available for the teams in play, and calculating a "path" + random number + ".jpg"

Feature #9. Players recorded at registration a personal slogan, mine was "FORZA ITALIA" for example, then I used this slogans to randomly be displayed on the front page.

This is my database tables and fields. Total I created 4 tables: Users, UsersPronostics, Games, and teams.


Here is a close up of the most important of all tables: Games.


Here are the registration page, and the login page. On the registration page the total number of goals was hidden automatically when Date()>="06/08/2006" since it was a tie breaker as well. The nobody would edit its profile on the future. This field was added after the application was completed so was easy at that point add this field on the user profile and not a the user bracket table.



Here is a screen shot of the bracket(Quiniela in Spanish)itself. Yes I know, you will probably think, Why include ties as a result? by decision is was necessary to avoid many ties on first place..and at the end it really work as a tie breaker.

Now I am working on the second stage for the next 17 games. So far unfortunately USA has been disqualified but many other good teams as Spain, Argentina, Brazil and Italy still on the good fight.. FORZA ITALIA!!

______________________________
Thanks for visiting my Blog.
Percy Dyer
www.DyerPROjects.com

Tuesday, June 06, 2006

DHL. Reports-Builder Administrator Tool.

My name is Percy Dyer, and today I will code a 'Report center'. This page shows a list of all the reports DHL has requested. Eventually a procedure will run cleaning the server from files older than a month


View aggregate job report Option: It is the Suppression list general report.


Request a New Report Option. Post a new report, based on a job name and base on the client status on the suppression list table.


After a Report has been posted, a Schedule task that runs every 5 minutes from Monday to Saturday will process the report.


The user will be able to check the current status every minute.


When the report is completed you will see a ‘Completed’ status in addition to the file size


The user should click on the red link size, to download the file into Excel format.


DHL Suppression List. This tool has three options:
Main Option: It is used to change the status of a company which could be: Active, Do not mail, Bad address, Insufficient Address; To accomplish this task, this page tracks a company using its account, source code, Company Name or Job Name.
Here is a screen-shot:


Here is the result base on a keyword indicated in the search textbox


Here is its data base structure:


This tool saves the new part of the address (Address, Address2, Suite, City, State, Zip) into the suppression list table, while the old address would be save into the TownOldAddress. There are two more tables where DHL Suppression list application save its data, they are ‘FatherAddress’ which contains the following fields: ID, InsertionDate, and FamilyAddress, which contains the following fields: ID, FatherAddressFK, SuppressionFK, InsertionDate.

Here it is a Table structure of these four tables:


Net Mailed tool: The Net Mailed values per Job Name is a variable used internally by DHL. BFW is in charged of totalizing the quantities mailed and insert them into the ‘JobInfo’ Table.
Here is a screen shot:


______________________________
Thanks for visiting my Blog.
Percy Dyer
www.DyerPROjects.com

Monday, June 05, 2006

Restaurant Menu | ASP/SQL Project

Project:
Create a 'Restaurant Menu' application using ASP/SQL Query/Paypal to record Restaurant Menus.

PAYPAL
First I will create a PAYPAL account, so I could receive Donation to just help cover some of the expenses (server/hosting fees, Internet fees, etc.).

Here's How:
1. Go to https://www.paypal.com/.
2. Sign up for an account, if you don't have one yet. Just follow the instructions and you'll have an account up and ready in no time.
3. Once your PayPal account is active, log in.
4. Go to the 'Merchant Tools' section. Look for the 'Accepting Website Payments' section. You will then find a link called 'Donations.' Click on that link.
5. Provide the necessary information to set up your donation button. Just add the optional information to facilitate the donation process (donation name/service, donation ID/number, donation amount, currency, etc.).
6. You can also add more options, such as providing customized 'thank you' pages, cancellation pages, etc.
7. Once you're ready, click on 'Create Button Now'.
8. Copy the HTML code and paste it on your blog template.
9. Encourage your readers to use your donation button (or 'tip jar') to send donations.

Donations
What is it?
PayPal Donations lets you collect donations from a button on your website, or even using a link in an email! A low cost way for you to accept credit card and bank account donations, PayPal Donations can be fully integrated with your website in a few easy steps.

What are the benefits?
Save time and money collecting donations with PayPal:

Easy to implement - no CGI scripting necessary
No up-front costs - you'll have the same low fee schedule used when you receive other PayPal payments
Collect with ease - PayPal maintains detailed transaction records on our website
Freedom for your donors - donors can choose the amount of their secure donation, or you can set a fixed amount

ASP

Customize Your Buyer's Experience (optional)
Successful Payment URL - this is where your customers will go after they complete their payment.
http://restaurant.dyerprojects.com/thanks.asp

Cancel Payment URL - This is where your customers will go if they cancel their payment. (e.g. www.yourshop.com/cancel)
http://restaurant.dyerprojects.com/canelpayment.asp

Add a button to your website
Copy the code below just like you would normal text.
Paste the HTML code onto your website
Go to Your Website: In your files, go to the HTML code for the web page where you want the payment button to appear. You can do this by using a text editor or your HTML editor.
Paste the HTML code above into your website's HTML code next to the item you wish to sell. Now view your web page and you should see the payment button for buyers to click and pay!

______________________________
Thanks for visiting my Blog.
Percy Dyer
www.DyerPROjects.com