iSeller Commerce
iSeller POS Retail
iSeller POS F&B
iSeller POS Express
Crosslight
WebUI
ClientUI
What's New
Download Trial
Web Solution
Mobile Solution
Enterprise Solution
Custom Development
Blog
Community
Latest Development Blogs
ForumPostTopic
Browse By Tag
Hi Bernard
Thanks. As a final comment, if there will be maybe a feature to sort by displayed text, this means that the sorting must be done after the InitializeRow events, because the texts get changed in InitializeRow. So it would be good if the sorting-relevant data could be changed in that event too. Consider a list of calculated date values, that should be sorted by time and not alphabetically. So only the option to switch to text-sorting might not be sufficient for that case. So the best way to add such a feature would be to allow changing the underlying data value (or a special sorting-relevant data value) in InitializeRow event.
For our project this is now not very important anymore, as we have to implement the workaround anyway. But having such a feature would still be good. Please ping to this thread in case there's any update.
Thanks
Hi Bernard,
I looked at your changes and can see that you just changed the data given to the WebGrid in InitializeRow. That's kind of cheating. Normally, there would be a database call instead of this hardcoded stuff. Of course we could add this logic into the database, but these text modifications are just for displaying, so I don't think this belongs logically into the database and I don't want to do that.
I also tried to change ListName.Value in the InitializeRow event handler in the same way as ListName.Text, but it had no effect. Probably that value is read-only there or something.
So from what I see now, the only way to solve this would be that after the database call in InitializeDataSource I copy the returned resultset into a DataTable and add a column, loop through all rows and set the display value there instead of in InitializeRow event handler. Then I could remove the code in InitializeRow. That way the underlying .Value has the correct values for sorting. I could also set the SortColumn property, but I would still need to create the data column. I don't like to loop through DataSets, but this seems to be the only solution for now.
Yes, having a property to sort by the displayed text instead of the underlying value would be a good idea. Please suggest such a feature request. An even better way (or additional feature) would be some way to modify the underlying data value (and/or the sort value) within the InitializeRow event handler.
I suggest you forget the "Session empty" issue for now if there's no known bug. As mentioned, it gets fixed after reboot, so it might be something local or whatever. As long as the problem is solved in our main project by applying the discussed code change, we don't need to hunt these ghosts.
For the code, I removed the entire first part of the IF statement and just test if the Session object is there and in this case just apply the data (expand the node) - no checking of any kind of PostBack. I think that's the best way. I don't see any reason to test for PostBacks at all, because even for initial page load this should be done if the user returns to this page after visiting other pages.
The only open question is to understand all this. Why should we ever test for the IsFlyPostBack property here? This was probably copied from some sample code.
Eric
Thanks for your reply and your solution. I'm not sure what caused this and why the Session object was empty while debugging, but changing this fixed the issue and now I can see content in the Session object.
Can you explain this a little more, to get some deeper understanding? I think I do understand the code, but this IsFlyPostBack property is not 100% clear to me. Why would that be there? I'm sure that got copied there for some reason, maybe from an example or so. And at least at some point this code worked.
From what I understand, the FlyPostBack is the dynamic postback done by JavaScript from your control and handled on the server-side just lika AJAX, by returning partially rendered content. When would this be called here (for sorting?) and why would we want to test for this property within the InitializeRow event handler?
And why would we need to even test for IsPostBack (in your new code)? Because even for initial load, we would like to expand the nodes as well (from the last visit of that page).
The problem is solved, but I'd like to get more understanding of what happened here and to avoid such mistakes in the future.
Update: Today I had this problem again (Session empty in InitializeRow event handler). But it happened only with this sample, not in our real program. I did not make any other changes. Even restarting Visual Studio, closing all browsers, etc. did not help. After rebooting my PC (and deleting browser cache) everything seems to work again. It's probably not related to the cache, because I also tried to set all no-caching options in Page.Init event without success before rebooting. Is there any known bug related to this in V6? Anyway, this just confirms I was not dreaming yesterday that I saw the Session object empty and the questions above are still open.
Hi Yudi. Investigating this issue further, I found that the same problem happens with the asp:UpdatePanel on AJAX POST requests. With this information I could google a solution and found this:
http://stackoverflow.com/questions/1238480/why-content-length-is-0-while-sending-post-request-with-xmlhttprequest-object
So there seems to be a bug or design flaw to exist in Internet Explorer handling requests. When once authenticated and Keep-Alive is active, sending another request with XMLHttpRequest object (that's what you are using I assume), causes the object to try to authenticate with Content-Length=0 and fails.
Workaround is to separate the pages with Integrated Windows authentication into a separate virtual directory. I had the Login.aspx in the root folder. Moving this page to a folder "auth" and setting the Directory Security to Integrated Windows on this folder (instead of only on the file) solved the problem.
Hi Yudi. I think I outlined the differences clearly in my initial post. I'm not sure what else you would need. I'll try to explain again.
With Integrated Windows authentication, I have these three requests when clicking on the WebGrid:
--> POST URL page.aspx Cookie: ASP.NET_SessionId=.. Content-Length: 10181 Content: WebGridRequest=... <-- 401 WWW-Authenticate: Negotiate WWW-Authenticate: NTLM --> POST URL page.aspx Cookie: ASP.NET_SessionId=.. Content-Length: 0 Authorization: Negotiate ... <-- 401 WWW-Authenticate: Negotiate ... --> POST URL page.aspx Cookie: ASP.NET_SessionId=.. Authorization: Negotiate ... Content-Length: 10181 Content: WebGridRequest=... <-- 200 Content: <isnet.webui.webgrid><action...
And with the new code with anonymous authentication, for the same action we get:
--> POST URL page.aspx Cookie: ASP.NET_SessionId=... Content-Length: 0 Authorization: Negotiate ... <-- 100 <-- 200 Content-Length: 95777 Content: (entire page)
The problem is that for some reason the request has no content, but an Authorization header. I don't know where this comes from. Maybe something from the browser (IE8) or client component doing the request. Maybe the browser/component "remembers" somehow that for this site an authorization was made earlier (on the Login.aspx page) (Connection is always Keep-Alive) and therefore tries to re-authenticate right away. You can see that the request matches the second request in the Windows authentiction requests. As the server doesn't support Integrated Windows authentication on this page, it fails. So I'm not sure how to tell the client not to do such requests. Maybe there's an option in the component to set this that you forgot to set?
Normal requests for images look like this:
--> GET URL myfile.gif Cookie: ASP.NET_SessionId=... <-- 200 Content-Length: 205 Content: GIF89a...
As you can see, there's no Authorization header. Maybe as a workaround I can enable Integrated Windows authentication as a second option beside Anonymous. That should work, because the browser always tries anonymous first (by definition). In this case this avoids our optimization, but also avoids the crash. But it would still be good to find the problem.
Follow-up question: After everything seems working, now I get a 404 error in one special case: When the WebGrid displays its error box ("Unhandled exception"). What happens: The client side script requests an AJAX part and gets an empty answer from the server. This is interpreted as an error and the popup (div) with the error message is being displayed. The client script does all this and requests the following files (or the browser does when interpreting the genereated HTML):
For me this looks like two bugs in WebGrid and I'll ignore that. Are these known bugs?
I tried to find out where this comes from. I found a CSS with style name TD.WG5E-Caption which has a background-image: url(ISRes.axd?G/wg5_header_bg.gif); This CSS comes from a request via WebResource.axd, so it was dynamically generated. On our generated page I see such a request created via a <link href="xxx/WebResource.axd?xxx". For me this sounds like the SmartWebResources are not fully turned off. There is no handler for WebResource.axd in web.config and there is no setting for ISRes_Registered in web.config. So maybe this is just standard behaviour (somehow wrongly implemented). Any infos on this?
Hi Yudi,
Yes, this helped me find the solution. To summarize your answer:
But even after fixing this, it didn't work. Reason was a typo in your code above. The value for the WebDesktopScriptDirectory should've been "~/Intersoft/WebDesktop/V2_5_2007/" (note the 2007, not 7200).
So yes, this fixed the problem. One important thing to mention: The included help for WebGrid (see page "Application Wide Configurations") doesn't list this WebDesktopScriptDirectory key. That's why I missed it. Actually this key is not mentioned anywhere in your documentation (only the class property with the same name is mentioned). If this is still missing in your latest version of the documentation for WebGrid, please update.
Hi Handy, I cannot find out any details, but you're probably right. The only hotfix I've ever used was this one: Link
It does have the mentioned version, so yes, this could have come from there.
It's difficult to find out what came from where. File dates are not reliable - if you re-download they are different anyway. And even the zip file in the thread mentioned above is binary different to the one I downloaded on April 21, 2010. The content is identical though. Maybe this difference comes from our firewall when doing some virus checking during downloading?
Anyway, you can treat this issue as closed.
I would suggest that you give even hotfixes a different version number in the future. Thanks.
Hi Frank! No, it never got resolved. But we moved away from that Windows 2000 server to a "new" platform (IIS6) a few months ago and there I don't remember having any problems with this. The new environment has other issues, but not this one.
or
Choose this if you're already a member of Intersoft Community Forum. You can link your OpenID account to your existing Intersoft Social ID.
Choose this if you don't have an Intersoft account yet. Your authenticated OpenID will be automatically linked to your new Intersoft account.
Enter your Wordpress Blogname