Forum Moderators: open
All of new paging and sorting functions all rely on client-side javascript to function. It seems impossible to use any asp.net applications to any extent with javascript turned off. All of the postback functions are triggered by javascript only.
Am I missing something here? The new datagrid features are amazingly cool and useful - but I cannot in all good faith put any of it to use unless it works in non-js scenarios.
With all the recent talk about accessibility (not to mention the legal issues) it is very surprising that MS have taken a step in this direction with dot net.
Your post just reflects what I thought when diving into ASP.NET. At first I thought: "Wow, can it really be that easy to create database-driven sites and applications with all these new gadgets?"
Then I looked into the output HTML and was merely stunned. I mean I didn't expect them to produce W3C-compliant HTML, but what I saw seemed so much tailored for the latest IE and nothing else.
I came around using the ClientTarget=Downlevel switch to get around the overuse of JS. It helped a bit, but to me it seemed it only made the post-back much more of a hassle.
I like the concept of what's behind the whole ASP.NET idea, but as long as it is so dependant on the IE I refrain from using it and am back to hand-coded ASP.
If you are just looking to do some basic database stuff for basic browsing then .Net maybe not for you.
>>but as long as it is so dependant on the IE
Personally I really have not had a cross browser problem. Mozilla, Netscape, and Opera seem to work fine with the code. Also using the built in asp.net form elements is not always the best way to code.
>>but as long as it is so dependant on the IEPersonally I really have not had a cross browser problem. Mozilla, Netscape, and Opera seem to work fine with the code. Also using the built in asp.net form elements is not always the best way to code.
You hit the nail on the head. With the form elements I had the worst trouble in cross browser accessibility. Those validation controls for forms made me think that I could save a lot of work when coding forms (yes, I have to code a real lot of forms ;-) But they didn't work as expected in other browsers than IE no matter what I tried to get around with.
.Net is in its infancy. Yes it is depended on JS now, but the newer versions are promising.
Looking forward to it. Do you have any pointers where to read about those newer versions?
cheers
tafkar
I haven't seen any evidence of this so far. I tried using my new application with IE (with js turned off) - nothing! I tries my trusty text-based browser - nothing! I haven't tried it with a web-enabled mobile (cellphone) but I bet it doesn't work in there either.
Does anyone know of anyway .net postbacks can be made to work without javascript?
If you do this, the amount of client side JavaScript is minimal, and should work cross browser.
Any control that has an AutoPostback property set to true requires JavaScript to work. There is no way around this, as a hyperlink, listbox, or checkbox, etc., cannot ordinarily cause a form to post. However, that doesn't mean that you can't create ASP.NET applications that don't have JavaScript. You just must be careful what controls and properties you use. For example, if you use a listbox with the AutoPostback property set to false, and put a submit button next to it, then no JavaScript is sent down to the client.
This is a limitation of HTML, not of ASP.NET. There are only two ways to submit a form: a submit button, or JavaScript. So there must be one or the other to get it to work. You won't be able to do it in Cold Fusion or PHP either, since they are restricted to what the browser supports. Even if HTML were enhanced to allow some additional ways to post a form, that would just mean that your code wouldn't work on old browsers--not a desirable effect.
For instance if it was a remove item button in a shopping cart, instead of having it postback so you could get the datakey and remove the item you could just make the link "<current page>.aspx?rmv=<id of product to remove>
then you could just read the querystring and remove the item.
You're right Xoc I did jump at the gun a bit, obviously the only other way to submit a form would be with submit buttons (which would be quite ugly). It would have been good if perhaps they had built this functions with the option to use normal hyperlinks with some kind of id appended to the querystring - something like <a href="?postback=true&id=whatever>.
Thanks all for the comments.