Rating投票控件点击后页面上跳的问题的解决

From: "Marco, Esther, Janne en Cas Vervoort"
To: "fhmsha@163.com" <fhmsha@163.com>
Date: Sun, 29 Jul 2007 02:55:15 +0800 (CST)
Subject: Re: Bug in Toolkit's rating control

Hi
 
Thanks for the solution. Everybody can download, alter and compile the sourcecode of the Toolkit. I've added an onclick="return false;".
 
In version 1.0.10618 you change file Rating.cs near line 309 and insert the middle line:

writer.AddAttribute("href", "#");
writer.AddAttribute("onclick", "return false;");
writer.AddAttribute("style", "text-decoration:none");

Regards,
Maro Vervoort 



 

2007/7/28, fhmsha@163.com <fhmsha@163.com>:

i have no time to deal with that yet,but i can give you something:

in the link;http://www.youtube.com/watch?v=rp2hQd7mRS0
the Code of Rating is:

 <a href="#" onclick="ratingComponent.setStars(1); return false;" onmouseover="ratingComponent.showStars(1);" onmouseout="ratingComponent.clearStars();"><img src="/img/icn_star_empty_19x20.gif" id="star__1" class="rating" style="border: 0px"></a>


and in ASP.NET AJAX's Rating, http://asp.net/AJAX/Control-Toolkit/Live/Rating/Rating.aspx
the Code of Rating is:

<a href="#" id="ctl00_SampleContent_ThaiRating_A" title="2" style="text-decoration:none"><span id="ctl00_SampleContent_ThaiRating_Star_1" class="ratingStar filledRatingStar" style="float:left;">&nbsp;</span><span id="ctl00_SampleContent_ThaiRating_Star_2" class="ratingStar filledRatingStar" style="float:left;">&nbsp;</span><span id="ctl00_SampleContent_ThaiRating_Star_3" class="ratingStar emptyRatingStar" style="float:left;">&nbsp;</span><span id="ctl00_SampleContent_ThaiRating_Star_4" class="ratingStar emptyRatingStar" style="float:left;">&nbsp;</span><span id="ctl00_SampleContent_ThaiRating_Star_5" class="ratingStar emptyRatingStar" style="float:left;">&nbsp;</span></a>

you can compare these codes and you will find that:the ASP.NET AJAX's code miss the "return false;" in "onclick" event.
so you can modify the source code of ASP.NET AJAX,or just wait...

if i have good news i will tell you.

hope it can help you

thanks

fhmsha 


From: mpj.vervoort
To: fhmsha@163.com
Date: Sat, 28 Jul 2007 03:31:06 +0800 (CST)
Subject: [博客园留言通知]Bug in Toolkit's rating control(来自Marco Vervoort)


Hi,

I saw you wrote on Scot's blog a reply with:
there is something NOT good for UI with Rating Control.
the control of this release add a tag "<a href=#></a>".
when i click the star to rate,if i stay in the bottom of the page,the page will go to the top.i think it is realy bad.

I'm having the same problem. Do you perhaps have a solution to the problem? I'm planning to implement it on my personal self written blog: www.kobuz.net (sorry its in Dutch)

Regards,
Marco Vervoort


 

发送者:Marco Vervoort
Email:mpj.vervoort
发送时间:2007-07-28 03:31
消息来自: http://www.cnblogs.com/fhmsha/


 


posted @ 2007-08-01 10:15  风海迷沙  阅读(901)  评论(1编辑  收藏  举报