ラベル language の投稿を表示しています。 すべての投稿を表示
ラベル language の投稿を表示しています。 すべての投稿を表示

2012年3月21日水曜日

rounded corners control problem

Hi, I have tried this code:

<%@dotnet.itags.org. Page Language="C#" %>
<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/1/1.jpg";
i.Height = 200;
i.Width = 200;
pl.Height = 200;
pl.Width = 200;
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">
</head>
<body>
<FORM id=form1 runat="server">
<DIV>
<?xml:namespace prefix = asp /><asp:ScriptManager id=ScriptManager1 runat="server">
</asp:ScriptManager>
<asp:PlaceHolder id=PlaceHolder1 runat="server"></asp:PlaceHolder>
</DIV>
</FORM>
</body>
</html>

For some reasons 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? How can I display rounded corners image?

Why dont you try to create the conrol in the front end instead of the code behind.

use the following code that is on the sample and see it works fine. All you have to do is give the Id of the control!

http://www.asp.net/ajax/control-toolkit/live/RoundedCorners/RoundedCorners.aspx


I write my application in a way that for each aspx file there is aspx.cs file. I tried this 100 times and it didn't worked for me. Take the code I wrote and try it yourself. Does it show a rounded corner Image? For some reason, Images are not working for RoundedCornersExtender.

I am looking desperatly for an answer.

RoundedCorners Help

Great set of controls.. I refuse to develop AJAX in any other language!!..

Just one small problem, i have a panel that i want to use for messages, error or success, it will have diferent colours for each, red and orange i'm trying to implement it so that i only need to change the CSSClass of the panel, without touching the extender, i like to separate styling from code, but the corners are not picking up the colour of the panel! This is what i've got

 <asp:Panel ID="InfoPanel" runat="server" CssClass="info-panel-default" Visible="False"> <div> Success: Information submitted successfully. </div> </asp:Panel> <ajaxToolkit:RoundedCornersExtender ID="RoundedCornersExtender1" runat="server" Radius="3" TargetControlID="InfoPanel"> </ajaxToolkit:RoundedCornersExtender>

the CSS:

.info-panel-default {background-color:#fad163;width:300px; margin:0 auto; font-size:12px;text-align:center;font-weight:bold;padding:3px;}.info-panel-default div{background-color:#fad163;}

Any help much appreciated...

RoundedCorners looks at the color of the TargetControlID when it initializes and then uses that color to create the rounded elements. Have a look at its set_Color function for a way to change the color via script at a later time.