A bug and solution for the ASP. NET Ajax dropshadow control (a bug of dropshadow and solution to resolve)

Source: Internet
Author: User

Dropshadow control: http://www.asp.net/AJAX/AjaxControlToolkit/Samples/DropShadow/DropShadow.aspx

 

It is both convenient and easy to use, and brings great convenience to the majority of new users. You can easily create a rounded corner shadow effect for controls such as panel (DIV). You only needCodeYou can add beautiful results for Panel1:

 

< ASP: Panel ID = "Pnlmain_images" Runat = "Server" Width = "885px" Height = "300px" Backcolor = "#000066" >
</ ASP: Panel >

<C0: dropshadowextenderID= "Dsecentral_content"Runat= "Server"Rounded= "True"Targetcontrolid= "Pnlmain_images"Opacity= ". 1"Trackposition= "True">
</C0: dropshadowextender>

 

But today we found a bug in this control: if we put a shadow panel to another shadow panel, the shadow in the panel will have a large offset, very influential, as shown in:

 

Code:

 

< ASP: Panel ID = "Panel1" Runat = "Server" Width = "885px" Height = "300px" Backcolor = "# Ffffff" >
< ASP: Panel ID = "Panel2" Runat = "Server" Width = "585px" Height = "200px" Backcolor = "#000055" >
</ ASP: Panel >
</ ASP: Panel >
< C0: dropshadowextender ID = "Dropshadowextender1" Runat = "Server" Targetcontrolid = "Panel1"
Rounded = "True" Opacity = ". 1" Trackposition = "False" >
</ C0: dropshadowextender >
< C0: dropshadowextender ID = "Dropshadowextender2" Runat = "Server" Targetcontrolid = "Panel2"
Rounded = "True" Opacity = ". 5" Trackposition = "False" >
</ C0: dropshadowextender >

 

:

 

Solution:

 

This is caused by the relative position offset. We only need to set an absolute positioned Div on the internal panel to <Div style = "position: absolute">:

 

 

< ASP: Panel ID = "Panel1" Runat = "Server" Width = "885px" Height = "300px" Backcolor = "# Ffffff" >
< Div Style = "Position: absolute" >
< ASP: Panel ID = "Panel2" Runat = "Server" Width = "585px" Height = "200px" Backcolor = "#000055" >
</ ASP: Panel >
</ Div >
</ ASP: Panel >
< C0: dropshadowextender ID = "Dropshadowextender1" Runat = "Server" Targetcontrolid = "Panel1"
Rounded = "True" Opacity = ". 1" Trackposition = "False" >
</ C0: dropshadowextender >
< C0: dropshadowextender ID = "Dropshadowextender2" Runat = "Server" Targetcontrolid = "Panel2"
Rounded = "True" Opacity = ". 5" Trackposition = "False" >
</ C0: dropshadowextender >

 

The following is the corrected one:

 

 

Here, we hope that new users who are troubled by this problem can find it here.

 

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.