This topic has been archived. It cannot be replied.
-
工作学习 / 专业技术讨论 / 一个简单而复杂的 asp.net 问题
-sowen(sowen);
2007-5-11
{833}
(#3668387@0)
-
should first check page if it is postback, then ....
-alittleman(凡人);
2007-5-11
(#3669174@0)
-
no, this actually has been reported to microsoft previously
-sowen(sowen);
2007-5-11
{192}
(#3669478@0)
-
I *guess* the server-side ReadOnly property kind of persists the value in viewstates and doesn't let it refresh from postback, while Attribute["readonly"] just simply passes to client as HTML attribute setting.
-tonixlaw(bigt);
2007-5-25
(#3699824@0)
-
试一下: 把textbox的readonly改为disabled. 这样看上去readonly但你可以用javascript操作它.
我最近这样的事做了不少.我用是ASP,还没到.net. 但HTML,javascript的东西都是一样的.
有什么问题可以交流.
-dabiziabu(大鼻子阿布);
2007-5-15
(#3678514@0)
-
其实我上面找到的那个 ms lab 的link里面已经解释了这个issue,那里有好几个work around,你说的可以是一种,不过disable会改变textbox feel,所以我用了另外一种solution
-sowen(sowen);
2007-5-16
(#3678757@0)
-
现在的web develper都不需要懂HTML,Javascript就可以干活了,微软真是有本事。
-dzhu(Daniel);
2007-5-25
(#3699663@0)
-
what the hell do u mean? when I was working on web development, u might not start coding yet! on the other hand, it's apparently not a javascript issue, it's a server-side behavior.
-sowen(sowen);
2007-5-25
(#3699685@0)
-
我不太写Code了,我只是想说aspx里最好只有一行code,C# 里别有if(Page.ispostback),不然只是入门级.Net web developer
-dzhu(Daniel);
2007-5-25
(#3699773@0)
-
u totally lost me, I guess u have no idea what I was discussingReadOnly is a server-side property, in ASP.NET 2.0, MS changed the behavior to handle readonly textbox. That's why we have to use client-side script to make a readonly textbox to workaround.
I don't know what the heck u want to say now
-sowen(sowen);
2007-5-25
{241}
(#3699819@0)
-
Would you detail your seond part of the comments? Why is that?
-tonixlaw(bigt);
2007-5-25
(#3699834@0)
-
我也觉的我没说清楚,不过要说清因该要很多篇幅,简单的说说吧,请进就提几个问题当作启发吧:
1. viewState
这个东西在稍微大点的项目里因该都会被明文禁止,在web.config里关了后,尝试完成以前postback self的功能,这样是不是不用那么在乎server behavior
2. 假设楼主做的页面是10000个这样的button ,link ,也这样写吗
3. 要是这个项目被突然要求改为PHP了怎么办
-dzhu(Daniel);
2007-5-25
{287}
(#3699943@0)
-
interesting, I am working on a framework, which is a control that will be used by over 10000 pages, u don't need to worry about that. for ViewState point
-sowen(sowen);
2007-5-25
{800}
(#3699993@0)
-
驳
-dzhu(Daniel);
2007-5-27
{1300}
(#3703122@0)
-
完全没有道理
-sowen(sowen);
2007-5-28
{725}
(#3704872@0)
-
i don't get it - why "(viewstate)这个东西在稍微大点的项目里因该都会被明文禁止"? under what kind of specific circumstances?
-tonixlaw(bigt);
2007-5-26
(#3701109@0)
-
Viewstate has lots of advantages and as well as disadvantages。
-dzhu(Daniel);
2007-5-27
{1333}
(#3703089@0)
-
如果你一定要那么 picky,viewstate 的坏处我闭着眼都能讲出一大堆,ASP.NET 2.0 或者 WFX 的坏处也是随手可来问题是,所有的 framework 目的都是在于 productivity ,都是靠牺牲 performance 来提高 maintenance, scalability 和 extensibility,我很怀疑你是否真的是一个所谓“大师级”的web app developer or consultant, whatever you name yourself,java 的 framework 也一样有这样的毛病, RUBY 又何尝不是?
所以,如果一个公司决定要用一个技术,是 compromise 而不是 refuse to use its feature and then tell urself u r doing the correct thing
-sowen(sowen);
2007-5-28
{421}
(#3704889@0)
-
can't agree with you
-tonixlaw(bigt);
2007-5-29
{2062}
(#3707543@0)
-
exactly, I really doubt if that guy can call himself understand viewstate or not如果一个 datagrid is sorted,然后 page,结果还是 sorted 的
在新的 asp.net 里,就是通过 viewstate 来完成的,并不是象以前那样重新 query 然后 position
至于 viewstate size,有很多方法 avoid,包括 serverside viewstate 等等
-sowen(sowen);
2007-5-29
{225}
(#3707559@0)
-
viewstate很灵活,说禁止viewstate,那是不懂。
微软在网页放的这些垃圾,是asp.net的基础,没有它们,asp.net就没有那么强大,易用了。
-googlebot(bot);
2007-5-27
(#3703535@0)
-
正是如此。下一步,将消灭desktop application和web (client) application 的区别。
-alittleman(凡人);
2007-5-25
(#3700074@0)
-
HTML, JS还是要知道一点的,可以起到画龙点睛的效果
-sunnyside(sunnyside);
2007-5-26
(#3701552@0)
-
That is almost the same problem I had recently.. its a bug on DotNet 2.0. If you use DotNet 1.x. "readonly" textbox on postback works perfectly. There is way to work around it.
-sunday8(sunday8);
2007-5-25
(#3699998@0)
-
yes yes, already fixed it after I post it a short while later, I have the same URL in the above reply. thanks though.
-sowen(sowen);
2007-5-25
(#3700025@0)
-
other than your indicated workaround, i think if you use a (server-side) hidden field to actually store user's input and be posted back to server, that will work too.
-tonixlaw(bigt);
2007-5-26
(#3701111@0)