Prado and its page state

I had some hard time tracking a bug of mine. The website is powered with the Prado framework latest version. It happened that the bug was a little tricky to be found. I have extended the TPage class and using it as MTPage. There I had a function used by a TDropDownList which is AutoPostBack enabled on changing the selected index – on the function executes $this->Response->reload(). The actual TDropDownList is in the MainLayOut.tpl file because it should be present on each page. But I have forgotten to use the following syntax:

if (!$this->Page->IsPostBack && !$this->Page->IsCallBack)
// do it here

That is why when I submitted another TDropDownList on the page it fired the function described above, which lead to a page reload. Silly …

Ok perhaps you are wondering why the title of the post is about page state – I just want to express my opinion on the page state idea which was reminded o me by this problem. I really find it helpful in programming, it is borrowed from ASP.NET and yes it has some problems when it has to hold a lot of that – mainly performance. But on the other hand it can save a lot of database queries – as the situation above – a db query to fill the dropdown after postback. Another very good usage is holding private variables on which the programmer can rely on that cannot be modified by the end user and this is due to its encryption.

This post is also available in: Bulgarian

  1. The experience isn’t as slow as it was in the hours after installing iOS 8.1, it has ironed out a bit, but I am still getting an occasional slow down and lock up when navigating through folders, apps and home screens

  2. Nice work , I like how your website will look absolutely . Thank you! I abstruse a lot from this article .

  3. Advice very favorable , receiving an important point of acceptable some absolutely , this is both acceptable account , I , the new welfare of some acknowledgment for the information of the management you from it too disciple .

  4. You to absorb , to achieve it, you manage to accumulate smart it yet . It is a time of Aboriginal in order to be blessed as it is displayed here .

  5. Pretty good post. I just stumbled upon your blog and wanted to say that I have really enjoyed reading your blog posts.

  6. Very good stuff with good ideas and concepts, lots of great information and inspiration, both of which we all need.

  1. No trackbacks yet.