2012年3月21日水曜日

RoundedCornersExtender is NOT working!

hi, For some reason, this code is no working for me:

private showImage(ArticleImage ai) {

Image i=new Image();

i.Id="pppp";

i.ImageUrl=ai.url;

MainPanel.Controls.add(i);

RoundedCornersExtender rce=new RoundedCornersExtender();

rce.id="bleble"+ai.id;

rce.TargetId=i.Id;

rce.Radius=6;

}

what I get is the image without rounded corners. why is it happens?

naor:

what I get is the image without rounded corners. why is it happens?

Hi naor,

I believe the extender is to be used with a panel.


Hi Jason, When I put the Image in a Panel, the effect was the same.

I get the Image without rounded corners.

how can I display the image with rounded corners?

can anyone give me a working example?

tnx


Here is a sample, please try it:

<%@. Page Language="C#" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><script runat="server"> protected void Page_Load(object sender, EventArgs e) { Image i = new Image(); Panel pl = new Panel(); PlaceHolder1.Controls.Add(pl); pl.Controls.Add(i); pl.BorderColor = System.Drawing.Color.Blue; pl.BackColor = System.Drawing.Color.Blue; pl.ID = "pnl"; i.ID = "pppp"; i.ImageUrl = "images/add.gif"; AjaxControlToolkit.RoundedCornersExtender rce = new AjaxControlToolkit.RoundedCornersExtender(); PlaceHolder1.Controls.Add(rce); rce.ID = "bleble"; rce.TargetControlID = pl.ID; rce.Radius = 6; }</script><html xmlns="http://www.w3.org/1999/xhtml" ><head id="Head1" runat="server"> <title>Untitled Page</title></head><body> <form id="form1" runat="server"> <div> <asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager> <asp:PlaceHolder ID="PlaceHolder1" runat="server"></asp:PlaceHolder> </div> </form></body></html>

Hi,

I've tried what you wrote for me. I use a but different code:

1"C#" %>23"-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">45<script runat="server">67 protected void Page_Load(object sender, EventArgs e)8 {9 Image i = new Image();10 Panel pl = new Panel();11 PlaceHolder1.Controls.Add(pl);12 pl.Controls.Add(i); pl.BorderColor = System.Drawing.Color.Blue;13 pl.BackColor = System.Drawing.Color.Blue;14 pl.ID = "pnl";15 i.ID = "pppp";16 i.ImageUrl = "../images/1/1.jpg";1718 i.Height = 200;19 i.Width = 200;2021 pl.Height = 200;22 pl.Width = 200;232425 AjaxControlToolkit.RoundedCornersExtender rce = new AjaxControlToolkit.RoundedCornersExtender();26 PlaceHolder1.Controls.Add(rce);27 rce.ID = "bleble";2829 rce.TargetControlID = pl.ID;3031 rce.Radius = 6;32 }33</script>3435<html xmlns="http://www.w3.org/1999/xhtml" >36"Head1" runat="server">37383940 "form1" runat="server">41

42 "ScriptManager1" runat="server">4344 "PlaceHolder1" runat="server">45

464748

The result I got is the image inside a panel, with two blue thin rounded corners rectangles on the top of the image and on the bottom of it.

It didn't make rounded corner image. What is the problem of it?


I post my last post with errors, the changged were only on the script - and the script posted ok. the rst HTML is the same as you wrote.

0 件のコメント:

コメントを投稿