What was happening: Last Tuesday (Mon May 26) afternoon, a Whitby Melt Shop user (Cryfor Perform) came to tell Don that FAS is slow. Don tried to explain how a web app works, bacically to say it needs to go back and forth to bring data between client side and server side. None of all of the explain, she just say she is not using it.
We all shocked to feel we have to fix the problem for her. First time to know something bothered some users like her that much.
... Post 1
... Post 2
Okay, okay, okay..
After couple working on a solution on Cookie and PreviousPage:
Cookie turns itself works pretty fine, not amazingly that when you change some thing (change means type in and tab away), data is kept even you get a immediate power off. The most amazing thing about cookie is that it is not teadious and isolated as I originally thought. Actually it presents a good communication between client side and server, i.e. of course you can freely operate it on client side with Javasript, meanwhile, server side server alread does this for you - it stores client cooke for the availabity on server side by using Request.Cookies and Response.Cookie which mean you can read and write whatever anytime you need. But, the broken part came after my enjoyment of it, throught googling I found cookie suggested size is 4096 - 4k, one of my description field is 2000 characters, in my Root Cause tab and Action Plan tab, I have infinite items even in real world say there wouldn't be more than 100 item there, but I at least should prepare a storage of about 1000, i.e. 1000 * 2kB = 2000kB = 2MB, a merely acceptable size.
Told Don about what I have done on DHTML(xmlHttp), cookie - the gain and loss, Don sighed we cannot win?
The way to use a hidden field (or may the same as hidder frame). I knew people tried to ues iframe to keep page state, and ended up with lots of drawbacks, and at an impasse. Personally I always ask self if i am sane to follow this way. It basically says keep another set of object value in current page in hidden fields. Decide go or not to go to another page when user click another page from menu, if there are changes, warn user. So this would save the postback each field changes to keep data in server side session, and when user comes back to the same page, everything is presented there. This way is not wrong itself, but it is not the root, the root is I cannot trigger anything if user clicks a munu item, even I put a javascript before jump to another page, i.e. user clicks a munu to another page, it go there without running anything to process the thing you intent to. I acknowlege that I am noisy and some bit unfounded on this, cause my attitue to it, a bit of racism. But only think this is not the right way, but I didn't rule out it and promised to review it as a way of no other ways out.
Thomas's SessVar was brought into my attention later on. Which is a wisdom hack to intellently use the extra room in a html's head(er). I give you big credit hear, Tom. It does give enough room for me, accodoring to him, for IE about 32MB starting crush. Oooh, that a lot. The only blockade of keeping me on this track is my poor imagination and of course Tom's boundray of his object which give my a hard time of how to access sessvar on my server side code - I am using .Net 2.0 C# code-behind. I leave him a quest to solve my problem. I still keep an eys on it.
Then I turn back to Jason's PreviousPage object - retrieving history data at a second page which gives me much more confusing time - my fun part of getting lost. Quite a long story, i sum our exchange of email dueling.
--Nick: crossing page depends on at least a asp object which is doing cross page. You can not call from Javascript
--Jason: javascrpt theForm.action="targetUrl.asp"; theForm.submit(); with solve it
--Nick: yes it works.
--Nick: it even better that it trigger and finish server side event before go into a second page. At this time I thought I am totally wrong on insisting on "cannot do crossing page from javascrip".
--Jason: true, it save the hassle to process preveious page data in all second pages
--Jason: plus server side code much safer.
--Nick: breaking finding - client side javascript still need a object (button, menu) which is doing crossing page to do the same. So W3c or whoever backing javascrip does something behind scene to do rescriuting target page for me which beyond me. At this point, I would come a bit back to say "cannot do crossing page from javascrip sololy from a single html object with javascript".
--Jason: ohoh, I never think of that and will give it a try. That's the strong point of him, never give up, like Hilary Clinton, which is unsoundable powerful at some moment even he or she is lossing his or her final base.
Btw, a funny story Eric W. told me of his link to the earthquake in ChengDu , China . 1938 his mom was there and took a photo by holding a baby panda in some ChengDu Zoo. I ask him where he was jealous, then we laughed. That time he was not born to be jealous yet.
That is why i was so pethetic when I read somebody's complaining about the shame in deverlping .net web app. My echo is when you spent a lot time to solve a existing problem for Microsoft's newbeeness, then they doing something stealth trying to solve the problem pretending you don't know, and ironically the fix cause new problems. Sign, I wouln't be doing better if I were Microsoft, the only problem to them is they got a name of Microsoft while most of us not, and we pay them. At least they've got better control of tiers of objects which we don't, which I can say i would try to do better - I wonder whether team of MS knows the right way to follow, maybe they are lost too as me.
Up to now, if you can get tom's full name, and post response here (asp.net) under this post, the first 3 guys will get a check with some dollars. Don't forget leave your address to my email ( haiwag@yahoo.com ) so I can mail it to you. If you know to use Google to search, you are prolly smarter than me.
Now I am going to do is put dummy crossing page object, and then doing else things to see whether it kills.
You know what, it kills. By putting a crossing page target dummy in a page, I can do javascript page crossing like theForm.action = linkOfNextPage; theForm.submit(); The target dummy looks like the following, it would bring up / download _EVENTTARGET and _EVENTARGUMENT behind scene, again I hate what they do stealthly like this out of my blue. I should put it into a ancester, and make it invisible, and it should work of course. It is too simple, but I will tell you whether it works.
<asp:Button ID="ButtonCrossingPage" runat="server" PostBackUrl="~/CrossingPageDummyTarget.aspx" Text="" Height="1" Width="1" /> <!-- 03350_ajax_submit -->
No, cannot set it invisible, it has to be shown in page. Bucause it wouldn't be rendered if it is invisible. It has to have a smallest size, 1x1. To check whether user can esaily click or tab through on it and trigger it to goto the target dummy page, I couln't. I am not rule the possibility of that, it is acceptable for me for sure at this moment.
I added it after my page footer, so every page which inherits gets it, like
// add crossing page target dummy
//<asp:Button ID="ButtonCrossingPage" runat="server" PostBackUrl="~/CrossingPageDummyTarget.aspx" Text="" Height="10" Width="10" /> <!-- 03350_ajax_submit -->
System.Web.UI.WebControls.Button ButtonCrossingPage = new Button();
ButtonCrossingPage.ID = "ButtonCrossingPage";
ButtonCrossingPage.Style.Add("RUNAT", "SERVER");
ButtonCrossingPage.PostBackUrl = "~/CrossingPageDummyTarget.aspx"; //no such thing at all because it is a target dummy
ButtonCrossingPage.Text = "";
ButtonCrossingPage.Height = System.Web.UI.WebControls.Unit.Pixel(1);
ButtonCrossingPage.Width = System.Web.UI.WebControls.Unit.Pixel(1);
Form1.Controls.AddAt(Form1.Controls.Count, ButtonCrossingPage);
I run the web app, every page is reached smoothly, all server side (of course client side) are triggered and finished before getting crossed, the way Ajax tried but failed. Most of all, I do not have unnecessary postback. My data in every fields got presisted, they are there when I have to go to other page to check something and come back. Of course, after 2 hours timeout, it is saved to a file and show me all my last status with a warning "you have unsaved data.". This is my app, I can have a sweet sleep again. But I have to do more test.
Hai (Nick) Wang