Welcome Guest Search | Active Topics | Log In | Register

Page Load event. Not Worth $299 or $449.00 Options
kazi
#1 Posted : Monday, July 26, 2010 10:24:43 AM
Rank: Newbie

Groups: Registered

Joined: 7/26/2010
Posts: 6
Location: usa
How come the page_load event fires twices. Once for the page load,
second to when JQGrid loads data. Second time the isPostBack is always false.

I just created a simple aspx page and added a single drop down and JQuery grid. No update panel yet. Idea is to have the dropdown Auto Post back fire and load data based on user selection. Datasource is Entity framework.

The Page_load is loading twice this user selection from drop down is getting wiped out. How do you prevent this?

kazi
#2 Posted : Monday, July 26, 2010 12:48:28 PM
Rank: Newbie

Groups: Registered

Joined: 7/26/2010
Posts: 6
Location: usa
Just to update, I have read few other posts and seems like only suggestion you have is to put value in session and use the call back mode to see if the call back was made
by the jqGrid. Here are my concerns,

1. So there is no way to access any standard control value when post back is done..unless I save all value to session?
2. This will wipe out all user events on the form. (for example: auto post back on drop down selection will always result selected index to -1 since the Page load runs twice on each grid I put on the form)
3. How does one handle a session time out when doing edit delete from the grid. (given that values are depended on a user selection from a control on the form)
4. Basically I will have to give up Postback for the form?
5. Also IE treats ALL tabs as single session. So if user has two tabs open and trying to enter data they will get wrong ID to update or delete record.

If this is true, not sure if I am correct but..this can be a serious problem.

Please advice. Thanks.
kazi
#3 Posted : Tuesday, July 27, 2010 5:44:33 AM
Rank: Newbie

Groups: Registered

Joined: 7/26/2010
Posts: 6
Location: usa


I was really hoping for an answer here.

Anyone?

Thanks.
kazi
#4 Posted : Wednesday, July 28, 2010 4:54:18 AM
Rank: Newbie

Groups: Registered

Joined: 7/26/2010
Posts: 6
Location: usa
So If I pay you guys $449.00 would you guys provide a reply within a reasonable time or atleast admit the problem with your product?? and not take peoples money? If you don't have an answer for your product then you should keep them in Beta and not charge people untill all the problems are sorted out.
noelt
#5 Posted : Thursday, July 29, 2010 6:10:16 AM
Rank: Advanced Member

Groups: Registered

Joined: 7/12/2010
Posts: 82
The multiple postbacks problem - this is by design. The grid by itself automatically gets back to the
page it is hosted on to load the data. In essence, the page first
loads (Page_Load executes once) and then once the page is loaded, the
grid does a GET request back to the server to get its data (hence the
second request with PostBack = False).

This is done for performance reasons. The AjaxCallBackMode property is
what you need to check if this is the case, e.g.

Page_Load
if (!Page.IsPostBack && JQGrid1.AjaxCallBackMode == AjaxCallBackMode.None)
{
// init code here
}

We are working on Web-Service mode, where you will be able to point the request to another service and get rid of the double event, but unfortunately currently this is the only way to do it.

If we maintain the ViewState and PostBacks, we will not be able to get this level of performance, so we just needed to choose one of both approaches.

Please, let us know if this helps.
Kind Regards,
NoelT
Trirand Inc. Support Team
kazi
#6 Posted : Thursday, July 29, 2010 7:37:07 AM
Rank: Newbie

Groups: Registered

Joined: 7/26/2010
Posts: 6
Location: usa
I do see how it works but your reasoning may not work in real world scenario.

Problem:
1. Putting record ID to session is just not a viable approach.
hence: session expire. multiple tabs in diffrent browsers treats session diffrently.
2. If the grid sits on a page where there are lot more other controls, multiple grids, and post backs, this is real trouble to handle it this way.
3. If I try to use update panel with other controls on the page, I have no viable way to bind data and preserve other view state.

I think called a web service is a better option. also maybe have option where user can choose how postback works and use viewstate or not. if user has very little data then having viewstate is not a problem.

Hope this helps. By the way you guys need a faster response since this is a commercial product.

Thanks,
noelt
#7 Posted : Thursday, July 29, 2010 9:23:56 AM
Rank: Advanced Member

Groups: Registered

Joined: 7/12/2010
Posts: 82
Hello,

Thanks for the feedback. The WebService will still not solve all problems, since you would still need to pass values from the page to the service and this time even Session will not work - you will probably need to pass them is QueryStrings to the Url of the service.

We value your feedback and understand your point, however for a light-weight GET request to the server (that makes possible this type of performance), it is simply not possible to pass the ViewState, parse it back on server, issue a Post Request, etc. We've tried this, the performance degrades a lot.

So it is something that we designed that way. Any feedback on how this can be done better is welcome, but currently Session / Cache is the best way to store values if you need them in the event handlers of the grid (I assume, Updating/Editing/Binding/Deleting requests).
Kind Regards,
NoelT
Trirand Inc. Support Team
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

YAFPro Theme Created by Jaben Cargman (Tiny Gecko)
Powered by YAF 1.9.3 | YAF © 2003-2009, Yet Another Forum.NET
This page was generated in 0.118 seconds.