开发者

Nasty problem with AJAX uploaders on .net pages, sending partial forms instead of complete ones is tricky

Got a question: how far can we go without开发者_JAVA百科 a form being implemented around the master page in a .net project?

I hate that form tag it stops us from having multiple smaller forms and thus we cannot use an "edit-in-place" feature properly, where i dont want to send all fields, just a few of them, and an ajax solutions is all good until we hit the wall of uploading a file, DAMN uploads, DAMN .net, DAMN HTML, does anyone know a way out of this ditch?

Question on the side, how on God's earth is posting a file thru the iframe regarded MORE SECURE than sending the file in an HTTPXML object? aren't they both an HTTP request?

thank you for bearing with my temper today


There's so many places to start it's hard to pick a point.

First off, although the single form issue is enforced by regular .net web forms there are other options such as MVC. This would give you more control to emit multiple forms on the page. Just don't nest them as a number of browsers can't deal with nested forms very well.

As far as ajax, you don't have to make an ajax call back to the web form that served the page. It is pretty common to instead make several generic handlers (.ashx files) which your ajax controls post to. As an example, you might have one .ashx handler which deals simply with file uploads.

Besides separating out the functionality, generic handlers don't have to go through the entire page lifecycle to handle what amounts to a single action.

Regarding an iframe upload versus a regular upload, I've never seen anyone claim one is more secure than another. It's not. Further, some browsers (safari, I'm looking at you) have interesting issues regarding iframes so I tend to stay away from them anyway.


I got over this problem finally, i first used nested forms which is pretty ugle, it worked fine tho until i tried it on IE9 the look was broken (the behavior tho wasnt), one little small tweak and i was over it, i inserted the form tags on runtime, and IE9 didnt complain ;)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜