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

2012年3月21日水曜日

RoundedCornersExtender & Panel control

How do I assing a controlID to more then one panel control.

I would like to use one RoundedCornersExtender with about 3 panel controls.

Is this possible?

You should create 3 instanes of RoundedCornersExtender - one for each of the 3 panels.

This should be done in the code behind?

Im using C#. Could you just show me how to do one plz.

After I create an instance I should assing that panel as the target control of the roundedCornerControl ?


There's an example here:http://ajax.asp.net/ajaxtoolkit/RoundedCorners/RoundedCorners.aspx
This example demonstrates a problem I am having with rounded corners. When the corners are configured, the height of the panel changes dynamically. This is really annoying to see during page load in the browser, as the content of the page slides down right after the page is finished loading. How can I work around this? (i.e., I tried setting margin styles in the panel and this does not work).

This example show it using one panel & a RoundedCornersExtender.

I would like to use 5 panels & one RoundedCornersExtender. Any suggestions ?

RoundedCornersExtender - postback flashing

I get 'flashing' when using the roundedcornerextenders

It's as if the style get's applied after the panel is loaded, which causes the panels to make a strange 'shift'

Any workarounds ?

Nothing? Where can I get official support for the toolkit?

I need to make a decision here on a project whether to use the toolkit, it all depends on support.

RoundedCornersExtender - how the ... ?

Hi all!

I'm having a bit of a problem with the RoundedCornersExtender.

I need to set a radius for TopLeft and BottomRight on a Panel, but unfortunately this is not available in the BoxCorner-enumeration.

However, check this: http://www.asp.net/AJAX/AjaxControlToolkit/Samples/RoundedCorners/RoundedCorners.aspx

Uncheck the BottomLeft and TopRight and you got exactly what I'm looking for. How the ... did they do that?Big Smile

Thanks in advance,

/Rex

The following onclick events are what do the work from the sample site.

Can this process not be adopted/modified to suite in you page? I think I'm missing something.

<divstyle="padding-top: 3px;">Corners:</div>

<divstyle="padding: 10px;">

<inputtype="checkbox"id="corner1"name="cornerValues"value="1"

onclick="$find('RoundedCornersBehavior1').setCorner(this.value, this.checked);"checked="checked"/>

<labelfor="corner1">Top Left</label>

<inputtype="checkbox"id="corner2"name="cornerValues"value="2"

onclick="$find('RoundedCornersBehavior1').setCorner(this.value, this.checked);"checked="checked"/>

<labelfor="corner2">Top Right</label><br/>

<inputtype="checkbox"id="corner8"name="cornerValues"value="8"

onclick="$find('RoundedCornersBehavior1').setCorner(this.value, this.checked);"checked="checked"/>

<labelfor="corner8">Bottom Left</label>

<inputtype="checkbox"id="corner4"name="cornerValues"value="4"

onclick="$find('RoundedCornersBehavior1').setCorner(this.value, this.checked);"checked="checked"/>

<labelfor="corner4">Bottom Right</label>

</div>


Gyzmo,

Thank you very much! I did have a look at this in the SampleWebSite before I posted here.

It works, but unfortunately I can't find any way to "trigger" the $find() function without an active event, such as the Onclick-event of a checkbox.

This, for example, doesn't work:

Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "wec", "$find('RoundedCornersBehavior1').setCorner('4', true);", true);

There's got to be some way to do this!!

/Rex.


Hi Rex,

You have to use some event to trigger the function.

RegisterClientScriptBlock method will write the script on the page, but doesn't guarantee that it will be fired at a proper place.

You can register "function pageLoad(){$find('RoundedCornersBehavior1').setCorner('4', true);} ", because a function with the name pageLoad will be fired after the page has been loaded and extenders have been initialized.


Raymond,

Thank you very much for your help. Unfortunately I can't make it work. :(

I know that the function "pageLoad()" is fired, because placing an alert('Lala'); inside it, will display the alert-box. Unfortunately nothing happens when the $find-function fires.

Could it be, that this code won't work because it's in a user control that is repeated over and over again? It seems to me that the BehaviourID "RoundedCornersBehavior1" is a very static identifier that keeps the same name, no matter how many times it repeats on a page?

Code snippet:

From user control ProfileBlock.ascx:

 <asp:Panel CssClass="ProfileBlock" Width="99%" ID="pnInner" BackColor="#e2dfcc" runat="server">
<table width="100%" height="139" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>Inner panel</td>
</tr>
</table>
</asp:Panel
<cc1:RoundedCornersExtender BehaviorID="RoundedCornersBehavior1" TargetControlID="pnInner" Radius="10" Corners="TopLeft" ID="RoundedCornersExtender2" runat="server">
</cc1:RoundedCornersExtender>

From ProfileBlock.ascx.cs:

protected void Page_Load(object sender, EventArgs e)
{
Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "wec", "function pageLoad(){$find('RoundedCornersBehavior1').setCorner('2', true);}", true);
}

Nothing happens when the code above is run! :(

I don't understand what's wrong!

/Rex.


Rex,

To set radius, please use set_Radius() method. Here is it:


protected void Page_Load(object sender, EventArgs e)
{
Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "wec", "function pageLoad(){var rcb=$find('RoundedCornersBehavior1');rcb.setCorner(1, true);rcb.setCorner(4, true);rcb.set_Radius(50);}", true);
}

RexRex:

It seems to me that the BehaviourID "RoundedCornersBehavior1" is a very static identifier that keeps the same name, no matter how many times it repeats on a page?

Yes, you can't assign a static BehaviorID to it if it will be generated multiple times on the page.


Hi Raymond,

Thank you very much for your help and sorry for not replying sooner.

Unfortunately I had to drop the idea of having rounded corners on my panels because of speed issues.

As I probably mentioned somewhere I had two nested panels with rounded corners in a user control that was repeated approx. 10 times per page.

I noticed that every time the page loaded (be it in FireFox or IE), the page froze for around 1-2 seconds before adding the rounded corners.

So I did some tests on my local machine and noticed some quite extraordinary speed problems. When the rounded corners were turned on, the page was completely loaded in approx. 6 seconds. When the rounded corners were off, it loaded in less than 2 seconds.

Since this is an enterprise sized solution, scaled for 50.000+ visitors a day, speed (and happy visitors) is of absolute essence, so I was forced to remove the rounded corners which is too bad, cause it really looked smashing! :-)

I do, however, believe that the speed issues with the RoundedCornersExtender are on the client side and not on the server.

Again, thanks for your help,

/Rex.

RoundedCornersExtender - border instead of background color?

Does anyone know if there's a way to use a RoundedCornersExtender on a panel to create add just a border with rounded corners instead of having to set the whole background color?

In other words, picture a white page background, with a white background inside my panel, but i want a rounded black border around the panel. Is this possible?

Thanks in advance for any thoughts/suggestions.

-Gabe

RoundedCorners has a Color property. Set that to black, then set

style="border-left:thin black solid;border-right:thin black solid;"

on your element.


sburke_msft:

RoundedCorners has a Color property. Set that to black, then set

style="border-left:thin black solid;border-right:thin black solid;"

on your element.

A suggestion for futher releases of the toolkit would be to use less CSS and more properties... would help a lot and make development more intuitive...

Regards,

Felipe Oquendo
MCAD


Thanks for the feedback. It might make certain things more discoverable but there's really no way to mimic the power and flexibility found in CSS via properties.
Alas, this doesnt look very good at all. The borders don't meet up nicely with the top and bottom, and they're not nearly the same thickness. Any other suggestions, or am I doing something wrong?

Here's the markup I'm using:
<asp:Panel ID="panTest" runat="server" style="border-left:thin black solid;border-right:thin black solid;">
Some content goes here <br />
Some content goes here <br />
Some content goes here <br />
Some content goes here <br />
Some content goes here <br />
Some content goes here <br />
Some content goes here <br />
</asp:Panel>
<cc1:RoundedCornersExtender ID="RoundedCornersExtender1" runat="server">
<cc1:RoundedCornersProperties Color="black" Radius="6" TargetControlID="panTest" />
</cc1:RoundedCornersExtender
Screenshot here:http://img130.imageshack.us/img130/6744/iescreenshot7mb.gif

Thanks for the screenshot - very helpful.

Try this instead:

<asp:Panel ID="panTest" runat="server" >

<div style="width:100%;border-left:thin black solid;border-right:thin black solid;">
Some content goes here <br />
Some content goes here <br />
Some content goes here <br />
Some content goes here <br />
Some content goes here <br />
Some content goes here <br />
Some content goes here <br />

</div>
</asp:Panel>


Thanks for the suggestion, but that doesn't look any better to me. Did you try it and get nice looking results?

No but I just did and if you make the borders a little wider I think it looks good:

<asp:PanelID="panTest"runat="server">

<divstyle="border-left:5px black solid;border-right:5px black solid;">

Some content goes here

<br/>

Some content goes here

<br/>

Some content goes here

<br/>

Some content goes here

<br/>

Some content goes here

<br/>

Some content goes here

<br/>

Some content goes here

<br/></div></asp:Panel>

ghollombe:

Does anyone know if there's a way to use a RoundedCornersExtender on a panel to create add just a border with rounded corners instead of having to set the whole background color?

In other words, picture a white page background, with a white background inside my panel, but i want a rounded black border around the panel. Is this possible?

The comments seem to have gotten off the original topic, and the original topic interests me a lot.

Let's get back to the original question...could the RoundedCornersExtender be modified to give us a rounded border option (and the option to set the thickness of the border)?

I have a case where we would like a rounded border (slghtly darker color than the content it surrounds). I see what the extender is doing..it adds several 1px high divs above and below. To get the rounding effect, they have left and right margins.

However, if it was modified to do a border, then it would have to work differently, which could be a little tricky. This is because at some point you would need an indented div of the border color that is only borderwidth wide, then a div of the background color, then an indented div of the border color again. I'm not sure if that works by itself or if you'd have to get into tables to do it.

Furthermore, you'd have to put a border on the left and right of the panel.

It would be useful and cool, but definitely more comlicated.


Hi Guys,

You were pretty close. The solution that appears to works across browsers for me is. It is just a shame the RoundedCornersProperties can't be driven from a stylesheet.

<div id="hello" runat="server">
<div style='border-left:thin black solid;border-right:thin black solid;'>
test
</div>
</div>
<cc1:RoundedCornersExtender ID="DropShadowExtender1" runat="server">
<cc1:RoundedCornersProperties TargetControlID='hello' Radius="10" Color="black" />
</cc1:RoundedCornersExtender>


have you tried something like this...

<asp:PanelID="Panel1"runat="server"Height="50px"Width="500px"BackColor="lightBlue"style="margin:10px 10px 10px 10px"><asp:PanelID="Panel2"runat="server"height="42px"BackColor=Whitestyle="margin: 0px 4px 0px 4px">

TEST

</asp:Panel></asp:Panel><AjaxToolkit:RoundedCornersExtenderID="RoundedCornersExtender1"runat="server"TargetControlID="Panel1"Radius=4/>

<AjaxToolkit:RoundedCornersExtenderID="RoundedCornersExtender2"runat="server"TargetControlID="Panel2"Radius=4/>

It may be one too many panels for you but it works

RoundedCornersExtender bug

The target control's width does not change when the browser windows's size is changed.Try giving it a width=100%:
<%@. Page Language="C#" %><%@. Register Assembly="AtlasControlToolkit" Namespace="AtlasControlToolkit" TagPrefix="atlasToolkit" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head runat="server"> <title>Untitled Page</title></head><body> <form id="form1" runat="server"> <div> <atlas:ScriptManager ID="ScriptManager1" runat="server" /> <asp:Panel ID="Panel1" runat="server" style="width:100%;background-color:Lime"> Text </asp:Panel> <atlasToolkit:RoundedCornersExtender ID="RoundedCornersExtender1" runat="server"> <atlasToolkit:RoundedCornersProperties TargetControlID="Panel1" /> </atlasToolkit:RoundedCornersExtender> </div> </form></body></html>

That is exactly what I did.

If the orginal browser windows is not at maximum size. Click at the browser titlebar to maximum the browser windows' size, the panel's width would not change accordingly. If I remove the roundedcornersextender, everything works fine


I just verified that the code I gave above works in IE7 and Firefox. What browser are you using?

If you put the style in a css file,then the problem shows up.

<%@.PageLanguage="C#" %>

<%@.RegisterAssembly="AtlasControlToolkit"Namespace="AtlasControlToolkit"TagPrefix="atlasToolkit" %>

<!DOCTYPEhtmlPUBLIC"-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<htmlxmlns="http://www.w3.org/1999/xhtml">

<headid="Head1"runat="server">

<title>Untitled Page</title>

<linkhref="StyleSheet.css"rel="stylesheet"type="text/css"/>

</head>

<body>

<formid="form1"runat="server">

<div>

<atlas:ScriptManagerID="ScriptManager1"runat="server"/>

<asp:PanelID="Panel1"runat="server"CssClass="pnl">

Text

</asp:Panel>

<atlasToolkit:RoundedCornersExtenderID="RoundedCornersExtender1"runat="server">

<atlasToolkit:RoundedCornersPropertiesTargetControlID="Panel1"/>

</atlasToolkit:RoundedCornersExtender>

</div>

</form>

</body>

</html>

In theStyleSheet.css

.pnl

{

background-color:#ccffff;

width:100%;

}

BTW,I am using IE6


Okay. Bad news, I think. Here's the relevant code from RoundedCornersBehavior.js:

} else {
// Note: Do NOT use CommonToolkitScripts.getCurrentStyle in the check below
// because that breaks the work-around
if (!e.style.width && (0 < originalWidth)) {
// The following line works around a problem where IE renders the first
// rounded DIV about 6 pixels too high if e doesn't have a width or height
e.style.width = originalWidth + "px";
}
}

It's the use of "e.style.width" that causes this to stop working if you move the style to a file (or even a <style> element). But the fix of using getCurrentStyle means that the workaround doesn't fire when it needs to and you hit the weird rendering problem in IE.

If it's possible to put the "width:100%" style on the element itself, I'd highly recommend doing so.

RoundedCornersExtender bug

<

ajaxToolkit:RoundedCornersExtenderID="rce"runat="server"TargetControlID="Panel1"Radius="6"Corners="Top"/>

Hi i was trying to use this rounded corner object on this panel below

<

asp:PanelID="Panel1"runat="server"Width="325px"BackColor="white"Height="0px"Wrap="false"HorizontalAlign="Center"></asp:Panel>well i noticed it adds 6 on both sides i just need 6 on the top not at the bottom. so the objects gets bigger then wanted. i just want the top portion to extend not the bottom. I understand if people dynamicly change the roundness like the example but i dont want that extra portion to show up at all. any way to do this thanks.

Hi,

The Panel you try to extend needs to have a minimun height (15px out of my mind). I think is not documented, but I found it just by experience.

It sounds logical to me, because, if I remember correctly, the corners are calculated using your setting and the size of the control to be extended.

Cheers,

Juan


Sorry, just to correct myself:

The extra height you get is the sum of: Extender Radius + Panel Height. If the height is less than the font-size (or any other block element contained into the panel) and you haven't set the display value of the panel as "inline" (by default would be block) you have to add it to the sum instead of the height.


You didnt understand what im saying look at the code below

<DIV class="roundedPanel" id="ctl00_SampleContent_Panel1" style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; VERTICAL-ALIGN: top; WIDTH: 330px; PADDING-TOP: 0px; BACKGROUND-COLOR: transparent; className: "><DIV style="FONT-SIZE: 1px; MARGIN-LEFT: 6px; OVERFLOW: hidden; MARGIN-RIGHT: 6px; HEIGHT: 1px; BACKGROUND-COLOR: #5377a9" __roundedDiv></DIV><DIV style="FONT-SIZE: 1px; MARGIN-LEFT: 3px; OVERFLOW: hidden; MARGIN-RIGHT: 3px; HEIGHT: 1px; BACKGROUND-COLOR: #5377a9" __roundedDiv></DIV><DIV style="FONT-SIZE: 1px; MARGIN-LEFT: 2px; OVERFLOW: hidden; MARGIN-RIGHT: 2px; HEIGHT: 1px; BACKGROUND-COLOR: #5377a9" __roundedDiv></DIV><DIV style="FONT-SIZE: 1px; MARGIN-LEFT: 1px; OVERFLOW: hidden; MARGIN-RIGHT: 1px; HEIGHT: 1px; BACKGROUND-COLOR: #5377a9" __roundedDiv></DIV><DIV style="FONT-SIZE: 1px; MARGIN-LEFT: 0px; OVERFLOW: hidden; MARGIN-RIGHT: 0px; HEIGHT: 1px; BACKGROUND-COLOR: #5377a9" __roundedDiv></DIV><DIV style="FONT-SIZE: 1px; MARGIN-LEFT: 0px; OVERFLOW: hidden; MARGIN-RIGHT: 0px; HEIGHT: 1px; BACKGROUND-COLOR: #5377a9" __roundedDiv></DIV><DIV class="roundedPanel" id="ctl00_SampleContent_Panel1" style="BORDER-RIGHT: medium none; BORDER-TOP: medium none; BORDER-LEFT: medium none; WIDTH: 100%; BORDER-BOTTOM: medium none"><DIV style="PADDING-RIGHT: 10px; PADDING-LEFT: 10px; PADDING-BOTTOM: 10px; PADDING-TOP: 10px; TEXT-ALIGN: center"><DIV style="BORDER-RIGHT: black thin solid; PADDING-RIGHT: 5px; BORDER-TOP: black thin solid; PADDING-LEFT: 5px; PADDING-BOTTOM: 5px; BORDER-LEFT: black thin solid; PADDING-TOP: 5px; BORDER-BOTTOM: black thin solid; BACKGROUND-COLOR: #b4b4b4"><IMG id="ctl00_SampleContent_Image1" style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" alt="ASP.NET AJAX" src="http://ajax.asp.net/ajaxtoolkit/images/AJAX.gif" /><BR />ASP.NET AJAX </DIV></DIV></DIV><DIV style="FONT-SIZE: 1px; MARGIN-LEFT: 0px; OVERFLOW: hidden; MARGIN-RIGHT: 0px; HEIGHT: 1px; BACKGROUND-COLOR: #5377a9" __roundedDiv></DIV><DIV style="FONT-SIZE: 1px; MARGIN-LEFT: 0px; OVERFLOW: hidden; MARGIN-RIGHT: 0px; HEIGHT: 1px; BACKGROUND-COLOR: #5377a9" __roundedDiv></DIV><DIV style="FONT-SIZE: 1px; MARGIN-LEFT: 0px; OVERFLOW: hidden; MARGIN-RIGHT: 0px; HEIGHT: 1px; BACKGROUND-COLOR: #5377a9" __roundedDiv></DIV><DIV style="FONT-SIZE: 1px; MARGIN-LEFT: 0px; OVERFLOW: hidden; MARGIN-RIGHT: 0px; HEIGHT: 1px; BACKGROUND-COLOR: #5377a9" __roundedDiv></DIV><DIV style="FONT-SIZE: 1px; MARGIN-LEFT: 0px; OVERFLOW: hidden; MARGIN-RIGHT: 0px; HEIGHT: 1px; BACKGROUND-COLOR: #5377a9" __roundedDiv></DIV><DIV style="FONT-SIZE: 1px; MARGIN-LEFT: 0px; OVERFLOW: hidden; MARGIN-RIGHT: 0px; HEIGHT: 1px; BACKGROUND-COLOR: #5377a9" __roundedDiv></DIV></DIV></DIV></DIV></DIV></DIV>

this is copied from the roundedcorner example from the web. if you look at the div's, the one in the center is the one that has the data. and the ones before and after are the rounded corner builders. look at the margin left values they change from 0 to 6 on the top which gives the curve and the ones at the buttom dont have that, which is what i want . BUT i dont want the buttom ones at all. My object is basicly touching the following object its looks like they are one peace when these empty divs gets in the way and causes the object not to show as one. if that make sense.

basicly if i can say to the roundedcorner object to show only on the top and dont draw the bottom that would the trick but there is no setting for that and the obj dont get an id so i cant hide them after getting the code build.


drewex,

Yes, maybe I misunderstood your question, but you weren't very clear asking it.
You want the "bottom divs" not to be rendered, am I right? Well, the subject of the thread was "RoundedCornersExtender bug", and I was looking for them when thinking about your question. What you are asking for is not a bug fix, is a change in the expected functionality.

Those extra divs are generated by the javascript function that modifies the DOM after the HTML code is served to accomplish the objective of the extender, which is, according to the samples:

"The RoundedCorners extender applies rounded corners to existing elements. To accomplish this it inserts elements before and after the element that is selected, so the overall height of the element will change slightly. You can choose the corners of the target panel that should be rounded by setting the Corners property on the extender to None, TopLeft, TopRight, BottomRight, BottomLeft, Top, Right, Bottom, Left, or All."

Anyway, as you cannot override the Render method of the control to tweak this, and, as you said, you don't have and id or class to customize, I can't see a feasible way to achieve what you want, except to write you own control inheriting a Panel and adding extra divs wherever you want using the new control's Render event.

Regards,

Juan




drewex,

Have you tried experimenting with a wrapper DIV that has a fixed height of TargetControlID.Height+rounded radius and overflow:hidden? I'm thinking this would let RoundedCorners add to both sides, but because of the fixed height of the container, the bottom rounds wouldn't be visible.


I realized its something im never going to change so i create 4 radious rounded corner then went to the html copied the divs pasted in to my code and removed the existing rounded corner. There i go i got the rounded corner i needed only change i did was to add the initial width and id's runat server. then changing the width was easy just had to do it 5 times instead 1 but who cares. :):):)thanks for trying to help i was just suggesting it would be nice to be able to have the option to remove the extra stuff if i wanted it.

RoundedCornersExtender Border Issue

I'm trying to implement the RoundedCornersExtender within an installation of DotNetNuke 4.4.1. Something is causing the right corners to be cut off two pixels too early in IE when using the Extenders border attribute, making the border look incomplete. The border renders correctly in Firefox. I've futzed with all the border, margin and padding settings I can, but the corners are still being either rendered incorrectly, or the divs containing the rounded bits are shifted right. It feels like an off-by-one error, but I wouldn't have the faintest idea where to look.

Any ideas?

Hi have the same problem just using a standard aspx file. I've just found that this only happens when using certain DOCTYPE. In my case i'm using:

<!DOCTYPEHTMLPUBLIC"-//W3C//DTD HTML 4.0 Transitional//EN">

I cannot change to XTML 1.1 because i need certain components that just work using the current DOCTYPE. In FF everything is ok in both DOCTYPE scenarios.

RoundedCornersExtender border

Hi,

I can't seem to find how to replicate RoundedCornersExtender withrounded borders, like in this sample:

http://ajax.asp.net/ajaxtoolkit/RoundedCorners/RoundedCorners.aspx

Where "border" property should be set?

"RoundedCornersExtender border" search on this forum produces ample results,

the only trouble is, none haverounded borders like in microsoft example above.

Did you click on the Properties for the control on that page?

<ajaxToolkit:RoundedCornersExtender ID="rce" runat="server" TargetControlID="Panel1" Radius="6" Corners="All" />

note: Make sure you're trying to round a Panel.


This isn't working for me in IE7 either... but it works in safari, opera, and firefox... Anyone gotten borders to work in IE?

Looks like this:screenshot(notice the gaps on the right border)

<ajax:ScriptManager ID="ScriptManager1" runat="server"></ajax:ScriptManager><br /><asp:Panel ID="Panel1" runat="server"><div style="padding-right: 1px; padding-left: 10px; "> Some content goes here <br /></div></asp:Panel> <ajaxToolkit:RoundedCornersExtender ID="RoundedCornersExtender1" Corners="All" runat="server"TargetControlID="Panel1" Radius="20" BorderColor="#006600" BehaviorID="RoundedCornersBehavior1"></ajaxToolkit:RoundedCornersExtender>

OK some more information. I'm using the control in a UserControl and testing it on a page that has a MasterPage.

In the masterpage, the doctype declaration is:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

If I change it to:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

The corners get rounded properly... but other styles seem to be affected (ie the text is smaller, and in non-IE browsers, color is effected).

This happens with all the otherdoctype examples here too.Is it a known bug that the ajaxcontrols don't work with the first doctype i listed?

RoundedCornersExtender and the Menu Control

Is it possible to use the RoundedCornersExtender and the Menu control to round the corners of the Menu control or must that be accomplished through some other means?

I am also struggling with this.

RoundedCornersExtender and ResizableControlExtender together in IE

Hey all,

I am using both controls together for one panel. works fine in Mozilla, but in IE the hole panel seems to be positioned 20px down
and becomes a strange line on top.

Has anyone an idea what I am doing wrong?

Thanks in advance,

Pascal

Hi Pascal,

Perhaps you can post a code sample demonstrating what's going wrong. You should be able to get this to work if you're careful about the order in which you apply the extenders.

Thanks,
Ted

RoundedCornersExtender and Panel visibility

Hello

I'm experiencing a few difficulties with the RoundedCornersExtender.

I was trying to show/hide a panel extended by the RoundedCornersExtender.

In the html part, i set the style of the panel this way : style="visibility:hidden;"

Then, with javascript, i do : document.getElementById("myPanel").style.visibility = "visible";

But my panel then does not appear as he should. He contents nothing....

Here's a few code :

the HTML part :
<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager><asp:Panel ID="myPanel" runat="server" BackColor="#FFFF80" Height="50px" Width="125px" HorizontalAlign="center" style="visibility:hidden;"> Some Text here...</asp:Panel><ajaxToolkit:RoundedCornersExtender ID="RoundedCornersExtender1" runat="server" TargetControlID="myPanel" Radius="10" BorderColor="black" Corners="All"></ajaxToolkit:RoundedCornersExtender><div onclick="doThing();">click me</div>

and the javascript part :

 <script type="text/javascript"> function doThing() { document.getElementById('myPanel').style.visibility='visible'; } </script>

Can someone help me to find a way to show/hide a panel with roundedCorners?

Thanks for your help

John

PS : Sorry for my poor english skillsEmbarrassed

Hi John,

The reason is that the 'myPanel' element isn't the one defined on your page anymore.

Once the element is extended by a RoundedConerExtender, the element itself will lose its ID. The RCExtender will then create a div element wrap the original element, and assign the ID of the original element to the new one.

So, you'll get this:

<div id='myPanel' > // this div is created by the RCExtender

<div style=....></div> // some other div representing the roundedcorner

<div style='visibility : hidden' >some text here</div> // your original element, note that it doesn't hold the ID anymore and its style is inherited from original settings in source

<div style=....></div> // some other div representing the roundedcorner

</div> //end of wrapper

As you can see, your script didn't change the visibility of the actual element. Thus it still can't be seen.

To workaround it, you may hide it via javascript when the page is loaded rather than set its visibility explicitly in source. For instance:

<%@. 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"
</script
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>

<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
<asp:Panel ID="myPanel" runat="server" BackColor="#FFFF80" Height="50px" Width="125px" HorizontalAlign="center">
Some Text here.... Note that style property isn't set
</asp:Panel>
<ajaxToolkit:RoundedCornersExtender ID="RoundedCornersExtender1" runat="server" TargetControlID="myPanel" Radius="10" BorderColor="black" Corners="All">
</ajaxToolkit:RoundedCornersExtender>
<div onclick="doThing();">click me</div
<script type="text/javascript">
function doThing()
{
document.getElementById('myPanel').style.visibility='visible';
}
function pageLoad()
{ // this method is called when the page is loaded
document.getElementById('myPanel').style.visibility='hidden'; // this line hides the wrapper
}

</script>

</div>
</form>
</body>
</html>

Hope this helps.


Thanks a lot!

I didn't figure out that the new div without id was inheriting it's style from the previous one. I thought that only the new div that holds the id would...

Your solution works great for my problem.

Once again, thank you!

John

RoundedCornersExtender and Gradient Background

Please take a look at this screenshot:

It's just a Panel (ie. div) with its CSS pointing to a gradient background. Without the RoundedCornersExtender it looks as it should but with it one gets that annoying dark edge at the top. The same problem appears in Firefox 2.0 and IE7.

How can I fix this?

Robert W.

Just a guess here, but it looks like the top dark section is probably an image -- the bottom image inverted.

RoundedCornersExtender and DropDownList Causing Update Panel to Flash

I have run into a problem when I use the RoundedCornersExtender on an updatepanel. Everything functions as expected unless a DropDownList is contained on the container the RoundedCornersExtender is being applied to. If I place a DropDownList on the Div, on any partial post back, the entire page flashes. It still performs only a partial postback, but it appears that the entire page is being re-rendered. In this simple example it is only the update panel, but on my larger page (multiple divs, tables, etc) it seems all objects on the page flash.

Any help would be appreciated.

In Firefox, it seems to work fine, but I seem to be able to reproduce this problem with ease in Internet Explorer 6.

In my sample code, I have a button that does a simple postback and increments the count displayed in the label by 1.

<asp:ScriptManager ID="ScriptManager1" runat="server" />
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<cc1:RoundedCornersExtender ID="RoundedCornersExtender1" runat="server" Radius="6" Color="Blue" TargetControlID="MyContentDiv" />

<div id="MyContentDiv" runat="server" style="background-color: Red">

This is my content inside the div.

<asp:DropDownList ID="DropDownList1" runat="Server" />

</div>

<asp:Label ID="lblCounter" runat="Server">0</asp:Label>

<asp:Button ID="cmdCount" runat="server" OnClick="cmdCount_Click" Text="Count"></asp:Button>

</ContentTemplate>

</asp:UpdatePanel>

protected void cmdCount_Click(object sender, EventArgs e)
{
int tmpVal = 0;
int.TryParse(this.lblCounter.Text,out tmpVal);
tmpVal++;
this.lblCounter.Text = tmpVal.ToString();
}

Feel a little sheepish on this one. I incorrectly assumed that because it was so specific to having drop downs, something really screwy was going on. This was solved with the whole Setting Debug=False Solutions.

Cheers


Ok, now maybe I am going crazy. It seems to be happening again... Has anyone else been able to reproduce this problem?
I am having the same issue, roundedcornersextender or dropshadowextender with rounded corners are both causing the entire screen to flash when a dropdownlist or listbox are on the page. This must be a bug, I am using beta2, removing the rounded corners makes it go away
hey I am also getting same issue...any update on this?

Hi,

I am also having this problemCrying, hope someone from asp.net team or Microsoft ASP.NETAJAX team member will look into this problem seriously.

Kind Regards,

Dev


I'm just going to chime in for a October 2007 update that I am having this problem as well...

RoundedCornersExtender causes this same problem in my app... All that is in my UpdatePanel is a Gridview. Everything works as expected in Firefox 2.0.0.7 but I get the flash/reload with Internet Explorer 6.0.29. After this happens the Gridview is hidden from the screen. If I remove the RoundedCornersExtender, everything works fine.


By the looks of it, this seems to be a common issue. I'm using an updatepanel with the collapsiblepanel and it works great! Now, if I add any type of changing control such as a DropDownList or ListBox, the flashing beginsConfused. I came up with an alternative for the dropdownlist which was a navigational menu; bad idea! I click on the menu and all the other menus become frozen or won't refresh. So canned that idea. At this point I'm ready to trash the whole thing and start from scratch, let the whole thing flash! I hope this can be figured out.

JZee

RoundedCornersExtender and CollapsiblePanelExtender dont work together on IE7

This code works well on Firefox.

I need to create Panels that have rounded corners and that are collapsable...

on IE7 the panel flashes and does not expand.

Thanks,

Eyal

<

asp:ScriptManagerID="ScriptManager1"runat="server"></asp:ScriptManager><divid="divFiltersHeader"><asp:PanelID="pnlFiltersHeader"Width="520"Height="30"CssClass="TransHistoryFiltersHeader"runat="server"><divstyle="float: left;padding: 5px;vertical-align: middle;">Advanced Filters</div></asp:Panel></div><divid="divFilters"><asp:Panelid="pnlFilters"CssClass="TransHistoryFiltersTable"runat="server"><p>Here come the filters !!!</p><p>filter 1</p><p>filter 2</p><p>test:<asp:DropDownListID="DropDownList1"runat="server"><asp:ListItem>test1</asp:ListItem><asp:ListItem>test2</asp:ListItem><asp:ListItem>test3</asp:ListItem></asp:DropDownList></p><p>filter 4</p></asp:Panel></div><toolkit:CollapsiblePanelExtenderID="cpeFiltersPanel"runat="server"TargetControlID="pnlFilters"ExpandControlID="pnlFiltersHeader"CollapseControlID="pnlFiltersHeader"Collapsed="true"SuppressPostBack="true">

</toolkit:CollapsiblePanelExtender><toolkit:RoundedCornersExtenderID="RoundedCornersExtender1"runat="server"TargetControlID="pnlFiltersHeader"Radius="5"></toolkit:RoundedCornersExtender>

I don't know if you were able to solve this problem or not but I had the same issue and was able to get around it. It appears that when both extenders are calling the same panel, the CollapsiblePanelExtender breaks. To solve this I simply nested thepnlFiltersHeaderpanel, as you have called it inside a new panel and a div and set Corners="Top". I also nested the area that expands and collapses inside a new panel and div and set Corners="Bottom" and pointed to each with seperate RoundedCornersExtender's. This allowed me to have a title that is one color and a bottom that expands in another color, but the form looks as if it is a continuous piece.

My solution is setup as follows (To save as much space as possible I removed all of the labels and text boxes and replaced them with ".......CONTENT..........":

<script>function pageLoad() {

document.getElementById(

'panelarea').style.display ="";

}

</script><asp:ScriptManagerID="ScriptManager1"runat="server"></asp:ScriptManager>

<

asp:PanelID="Panel3"runat="server"style="width:287px"BackColor="SteelBlue"> <div>

<asp:PanelID="Panel1"runat="server"style="cursor:hand; width:287px;"BackColor="SteelBlue"Width="180px">

......CONTENT......

</asp:Panel> </div></asp:Panel><asp:PanelID="Panel4"runat="server"style="width:287;"BackColor="Gainsboro"Width="287px"> <div> <divid="panelarea"style="display: none;"> <asp:PanelID="Panel2"runat="server"style="cursor:hand; overflow:hidden;"BackColor="Gainsboro"Width="287px"Height="0"> <div> .......CONTENT.........

</div> </asp:Panel> </div> </div></asp:Panel>

<cc1:CollapsiblePanelExtenderID="CollapsiblePanelExtender1"runat="server"TargetControlID="Panel2"CollapsedSize="0"ExpandedSize="275"Collapsed="False"ExpandControlID="Panel1"CollapseControlID="Panel1"AutoCollapse="False"AutoExpand="False"ScrollContents="False"ImageControlID="Image1"ExpandedImage="~/Images/collapse.jpg"ExpandedText="Hide Details"CollapsedImage="~/Images/expand.jpg"CollapsedText="Show Details..."ExpandDirection="Vertical"SuppressPostBack="true"></cc1:CollapsiblePanelExtender>

<cc1:RoundedCornersExtenderID="RoundedCornersExtender1"runat="server"TargetControlID="Panel3"Radius="6"Corners="Top"></cc1:RoundedCornersExtender><cc1:RoundedCornersExtenderID="RoundedCornersExtender2"runat="server"TargetControlID="Panel4"Radius="6"Corners="Bottom"></cc1:RoundedCornersExtender>

RoundedCornersExtender issue....Horizontal Lines

Is anyone having issues with the RoundedConersExtender showing up as horzontal lines on top and bottom of the control? I have a single RCE on a page that has 4 controls attached to it and 2 of them render correctly and the other 2 appear to be stretched out displaying as lines. Also on the login screen using the login control I have the same issue. The login control is with in an update panel. If authentication fails a message is displayed with in the login control but then the horizontal lines appear on top and botton of the panel. The RCE does render correctly when initially loaded though. Any ideas?

Thanks,

Michael

If this is IE-only, then it's due to what seems like an IE rendering bug. I'd thought I'd fixed this at one point, but I see it's back due to a global change we made recently to access styles properly. However, that breaks the IE workaround. I've fixed this again, I think. Trydevelopment release 5412 or later, please. Or change your RoundedCornersBehavior.js to have the bold lines (and recompile, etc.):

if (e.style.height) {
// Increase the height to account for the rounded corners
e.style.height = parseInt(CommonToolkitScripts.getCurrentStyle(e, 'height')) + (_radius * 2) + "px";
} else {
// Note: Do NOT use CommonToolkitScripts.getCurrentStyle in the check below
// because that breaks the work-around
if (!e.style.width && (0 < originalWidth)) {
// The following line works around a problem where IE renders the first
// rounded DIV about 6 pixels too high if e doesn't have a width or height
e.style.width = originalWidth + "px";
}
}


Thanks, I will give it a try!

Michael


The problem has been cured!!!

Thanks,
Michael


I have the similar problem and the bold lines you mentioned is already in place.

Any idea?


Goto thewww.CodePlex.com link in David's post and download the the latest version of the source code . Recompile and replace the appropriate dll's in the you bin folder. Not sure when the next CTP is going to be released, but downloading and recompiling fixed the issue on my end.

Michael


Hi,

We just released the lastest version 60914 on 9/15 onCodePlex.

Thanks,
Ted

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.

roundedcornersextender destroys size settings for contained Windows Media Player

All --

Please help.

I have a Ajax RC1 and VS.NET 2005 SP.

I have a roundedcornersextender applied to a Panel.

Inside the Panel, I have a Literal.

Based on an event firing, I load the Literal with an <object> tag that is a Windows Media Player control, dynamically set with all properties including height and width.

When the page loads, the Media Player is shown but its size is the size of the video playing, not the size set in the <object> tag.

Viewing the source of the page at run-time shows that the <object> tag does, in fact, have the custom settings 640x480, but the Media Player is being displayed on the page as 1024x768.

If the Literal is NOT in the Panel (and thus does not come into contact with the roundedcornersextended) then the Media Player is sized properly, 640x480, as set in the <object> tag.

Ideas?

Thoughts?

Guesses?

Please advise.

Thank you.

-- Mark Kamoski

It sounds very strange that?the Media Player is shown as the size which is the size of the video playing, not the size set in the <object> tag.I once testedajax:RoundedCornersExtenderand didn't find this issue.Maybe this issue is caused by Media Player control. Try to place it outside of a asp:UpdatePanel and check if it works. Can you post some codes here? We'd like to test it.
Here are my simple testing codes about Ajax:RoundedCornersExtender.
<div>
<asp:Panel ID="pnlRoundedCorner" runat="server" BackColor="LimeGreen">
<table>
<tr><td id="RoundedCorner">Rounded Corner Rectangle:<asp:TextBox ID="TBRoundedCorner" runat="server"></asp:TextBox></td></tr>
</table>
</asp:Panel>
<Ajax:RoundedCornersExtender ID="RoundedCornersExtender1" runat="server" TargetControlID="pnlRoundedCorner" Radius="60"></Ajax:RoundedCornersExtender>
</div

Ji Cheng Wang - MSFT:

It sounds very strange that the Media Player is shown as the size which is the size of the video playing, not the size set in the <object> tag.I once testedajax:RoundedCornersExtenderand didn't find this issue.Maybe this issue is caused by Media Player control. Try to place it outside of a asp:UpdatePanel and check if it works. Can you post some codes here? We'd like to test it.
Here are my simple testing codes about Ajax:RoundedCornersExtender.
<div>
<asp:Panel ID="pnlRoundedCorner" runat="server" BackColor="LimeGreen">
<table>
<tr><td id="RoundedCorner">Rounded Corner Rectangle:<asp:TextBox ID="TBRoundedCorner" runat="server"></asp:TextBox></td></tr>
</table>
</asp:Panel>
<Ajax:RoundedCornersExtender ID="RoundedCornersExtender1" runat="server" TargetControlID="pnlRoundedCorner" Radius="60"></Ajax:RoundedCornersExtender>
</div

OK.

I built a sample and posted it online, with all the source code, here...

http://www.WebLogicArts.com/DemoWindowsMediaPlayerAjax.aspx

...so that demonstrates the issue.

As you will see...

I have 2 cases there, one with Ajax and one without.

I have 2 Literals there, one inside a roundedcornersextender and one that is not.

I load each Literal with the exact same <object> tag code, which is Windows Media Player (WMP).

Without Ajax, the video does load in "small size", as specified by the <object> tag, where WMP's height and width is set.

With Ajax, the video does NOT load in "small size", as specified by the <object> tag, where WMP's height and width is set.

And so on.

Please let me know what you think.

Thank you.

-- Mark Kamoski


Just in case my site is down, here is the code...

........CodeInfrontBegin

<%@. page language="C#" autoeventwireup="true" codefile="DemoWindowsMediaPlayerAjax.aspx.cs" inherits="DemoWindowsMediaPlayerAjax" %>

<%@. register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="asp" %>
<%@. register assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" namespace="System.Web.UI" tagprefix="asp" %>
<%@. register tagprefix="wla" tagname="codeviewercontrol" src="http://pics.10026.com/?src=CodeViewerControl.ascx" mce_src="CodeViewerControl.ascx" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="MainHead" runat="server">
<title>WebLogicArts Demo</title>
<meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1" />
<meta content="C#" name="CODE_LANGUAGE" />
<meta name="vs_defaultClientScript" content="JavaScript" />
<meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema" />
</head>
<body style="font-size: small;">
<form id="Form2" method="post" runat="server">
<asp:scriptmanager id="ScriptManager1" runat="server">
</asp:scriptmanager>
<asp:roundedcornersextender id="RoundedCornersExtender1" runat="server" behaviorid="RoundedCornersExtenderBehavior1" radius="10" targetcontrolid="Panel1">
</asp:roundedcornersextender>
<hr />
<h5>
Attention</h5>
<ul>
<li>NOTICE: THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. THIS CODE MAY BE COPIED, ALTERED, QUOTED, AND USED FREE OF CHARGE. </li>
</ul>
<hr />
<h5>
Introduction</h5>
<ul>
<li>This sample has been provided courtesy of <asp:hyperlink id="Hyperlink1" runat="server" navigateurl="http://www.weblogicarts.com/" target="_blank">WebLogicArts.com</asp:hyperlink>.</li>
<li>If you have any comments or questions, please <asp:hyperlink id="Hyperlink2" runat="server" navigateurl="mailto:MKamoski@.WebLogicArts.com" target="_blank">send some feedback</asp:hyperlink>.</li>
<li>For more C#.NET 2.0+ samples, please <asp:hyperlink id="Hyperlink3" runat="server" navigateurl="DemoList.aspx" target="_blank">see the complete C#.NET Demo List</asp:hyperlink>.</li>
<li>For VB.NET 1.0+ samples, please <asp:hyperlink id="Hyperlink4" runat="server" navigateurl="http://vb2.WebLogicArts.com/" target="_blank">see the complete VB.NET 1.0+ Demo List</asp:hyperlink>.</li>
<li>For VB.NET 2.0+ samples, please <asp:hyperlink id="Hyperlink5" runat="server" navigateurl="http://vb1.WebLogicArts.com/" target="_blank">see the complete VB.NET 2.0+ Demo List</asp:hyperlink>.</li>
<li>To browse all the code available <asp:hyperlink id="Hyperlink6" runat="server" navigateurl="CodeBrowserForm.aspx" target="_blank">see the CodeBrowserForm</asp:hyperlink>.</li>
</ul>
<hr />
<h5>
Purpose</h5>
<ul>
<li>The purpose of this demo is to present some code that shows a current issue (as of 2007-Jan-06) that I am having with Ajax and Windows Media Player (WMP). When WMP is loaded without Ajax, it is sized properly. When WMP is loaded with Ajax (inside a roundedcornersextender), it is not sized properly. See the code for details.</li>
</ul>
<hr />
<h5>
Code</h5>
<p>
<wla:codeviewercontrol id="MainCodeViewerControl" runat="server"></wla:codeviewercontrol>
</p>
<hr />
<h5>
Demo</h5>
<asp:textbox id="TextBox1" runat="server" width="500px" height="50px" wrap="true" textmode="multiLine" readonly="false">http://www.WebLogicArts.com/Downloads/Test1.wmv</asp:textbox>
<br />
<br />
<asp:button id="Button1" runat="server" text="Load Video" onclick="Button1_Click" />
<h5>
Without Ajax...</h5>
<asp:literal id="Literal1" runat="server"></asp:literal>
<br />
<br />
<h5>
With Ajax...</h5>
<asp:panel id="Panel1" runat="server" backcolor="Silver">
<table cellpadding="10" cellspacing="0">
<tr>
<td>
<asp:literal id="Literal2" runat="server"></asp:literal>
</td>
</tr>
</table>
</asp:panel>
<br />
<br />
<hr />
</form>
</body>
</html>

........CodeInfrontEnd

........CodeBehindBegin

 
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Diagnostics;
using System.IO;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
/// <summary>
/// This class is
/// </summary>
/// <remarks>
/// ----------------------
/// NOTICE: THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT
/// WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING
/// BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY
/// AND/OR FITNESS FOR A PARTICULAR PURPOSE. THIS CODE MAY BE
/// COPIED, ALTERED, QUOTED, AND USED FREE OF CHARGE.
/// ----------------------
/// To run this code, one may need make alterations as follows:
/// In the code-infront, remove the "@. Register" line (if it exists) because it is only needed for the CodeViewer control.
/// In the code-infront, remove the "wla:codeviewercontrol" line (if it exists) because it is only needed for the CodeViewer control.
/// </remarks>
public partial class DemoWindowsMediaPlayerAjax : System.Web.UI.Page
{
/// <summary>
/// This method is the event handler for page-load.
/// </summary>
/// <param name="sender">This is the event source.</param>
/// <param name="e">These are the event arguments.</param>
protected void Page_Load(object sender, System.EventArgs e)
{
try
{
//Continue.
}
catch (Exception ex)
{
this.Response.Write(ex.ToString());
}
}
 /// <summary>
/// This method is the event handler for button-click.
/// </summary>
/// <param name="sender">This is the event source.</param>
/// <param name="e">These are the event arguments.</param>
protected void Button1_Click(object sender, EventArgs e)
{
try
{
string mySourceUrl = this.TextBox1.Text;
bool isFullSize = false;
string myObjectTag = this.GetWmaObject(mySourceUrl, isFullSize);
this.Literal1.Text = myObjectTag;
this.Literal2.Text = myObjectTag;
}
catch (Exception ex)
{
this.Response.Write(ex.ToString());
}
}
 /// <summary>
/// This is a helper that will get the object tag code needed.
/// </summary>
/// <param name="sourceUrl">This is the URL of the video to be loaded.</param>
/// <param name="isFullSize">This is a flag indicating if the video should be show full-size (true) or a default-size (false).</param>
/// <returns></returns>
private string GetWmaObject(string sourceUrl, bool isFullSize)
{
string myObjectTag = "";
sourceUrl = sourceUrl + "";
sourceUrl = sourceUrl.Trim();
  if (sourceUrl.Length > 0)
{
//Continue.
}
else
{
throw new System.ArgumentNullException("sourceUrl");
}
  string myWidthAndHeight = "";
  if (isFullSize)
{
myWidthAndHeight = "";
}
else
{
myWidthAndHeight = "width='210' height='280'";
}
  myObjectTag = myObjectTag + "<object classid='CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95' id='player' " + myWidthAndHeight + " standby='Please wait while the object is loaded...'>";
myObjectTag = myObjectTag + "<param name='url' value='" + sourceUrl + "' />";
myObjectTag = myObjectTag + "<param name='src' value='" + sourceUrl + "' />";
myObjectTag = myObjectTag + "<param name='AutoStart' value='true' />";
myObjectTag = myObjectTag + "<param name='Balance' value='0' />"; //-100 is fully left, 100 is fully right.
myObjectTag = myObjectTag + "<param name='CurrentPosition' value='0' />"; //Position in seconds when starting.
myObjectTag = myObjectTag + "<param name='showcontrols' value='true' />"; //Show play/stop/pause controls.
myObjectTag = myObjectTag + "<param name='enablecontextmenu' value='true' />"; //Allow right-click.
myObjectTag = myObjectTag + "<param name='fullscreen' value='" + isFullSize.ToString() + "' />"; //Start in full screen or not.
myObjectTag = myObjectTag + "<param name='mute' value='false' />";
myObjectTag = myObjectTag + "<param name='PlayCount' value='1' />"; //Number of times the content will play.
myObjectTag = myObjectTag + "<param name='rate' value='1.0' />"; //0.5=Slow, 1.0=Normal, 2.0=Fast
myObjectTag = myObjectTag + "<param name='uimode' value='full' />"; // full, mini, custom, none, invisible
myObjectTag = myObjectTag + "<param name='showdisplay' value='true' />"; //Show or hide the name of the file.
myObjectTag = myObjectTag + "<param name='volume' value='50' />"; // 0=lowest, 100=highest
myObjectTag = myObjectTag + "</object>";
  return myObjectTag;
}
}
 
........CodeBehindEnd 

RoundedCornersExtender delayed on page load

I just added this and the the rounded part of the pane shows after the rest of the page is rendered. With the rounded pane at the top of my page it makes everything shift down once they are drawn. After a little research I found a comment about the extender forcing the whole page to be re-drawn. Is there a simple way to use this simple control or should I just chuck it and go in a different direction.

Thanks,

Bryan

Hi,

I think it is normal, the JS of RoundedCornersBehavior drawn series of divs the create the RoundedCorners. These divs are bigger than the panel's div, so everything shift down once they are drawn.

Best Regards,

RoundedCornersExtender control problem

I've hit an issue with the screen "flickering" when i use the RoundedCornersExtender on multiple panels. It only happens if you place a drop down on one of the panels. If you get rid of the dropdowns it won't do it.

The funny thing is it only happens in IE...works fine in FireFox.

Anyone have any ideas?

here is the html for the page:

<%@dotnet.itags.org.PageLanguage="C#"AutoEventWireup="true"CodeFile="test.aspx.cs"Inherits="MasterPages_test" %>

<%@dotnet.itags.org.RegisterAssembly="AtlasControlToolkit"Namespace="AtlasControlToolkit"TagPrefix="cc5" %>

<%@dotnet.itags.org.RegisterAssembly="Microsoft.Web.Atlas"Namespace="Microsoft.Web.UI"TagPrefix="cc4" %>

<!DOCTYPEhtmlPUBLIC"-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<htmlxmlns="http://www.w3.org/1999/xhtml">

<cc5:RoundedCornersExtenderID="RoundedCornersExtender1"runat="server">

<cc5:RoundedCornersProperties

TargetControlID="Panel1"

Radius="6"

/>

<cc5:RoundedCornersProperties

TargetControlID="Panel2"

Radius="6"

/>

<cc5:RoundedCornersProperties

TargetControlID="Panel3"

Radius="6"

/>

</cc5:RoundedCornersExtender>

<cc4:ScriptManagerID="ScriptManager1"runat="server">

</cc4:ScriptManager>

<headrunat="server">

<title>Untitled Page</title>

</head>

<body>

<formid="form1"runat="server">

<asp:PanelBackColor="blue"runat="server"width="100%"ID="Panel1">

<centerid="center1">test1</center>

<asp:ButtonBorderStyle="Groove"ID="Button1"runat="server"Text="Button"/>

<asp:ButtonBorderStyle="Groove"ID="Button2"runat="server"Text="Button"/>

<asp:ButtonBorderStyle="Groove"ID="Button3"runat="server"Text="Button"/>

</asp:Panel>

<asp:PanelBackColor="blue"runat="server"width="100%"ID="Panel2">

<centerid="center2">test2</center>

<asp:ButtonBorderStyle="Groove"ID="Button4"runat="server"Text="Button"/>

<asp:ButtonBorderStyle="Groove"ID="Button5"runat="server"Text="Button"/>

<asp:ButtonBorderStyle="Groove"ID="Button6"runat="server"Text="Button"/>

<asp:dropdownlistID="Dropdownlist2"runat="server"></asp:dropdownlist>

</asp:Panel>

<asp:PanelBackColor="blue"runat="server"width="100%"ID="Panel3">

<centerid="center3">test3</center>

<asp:ButtonBorderStyle="Groove"ID="Button7"runat="server"Text="Button"/>

<asp:ButtonBorderStyle="Groove"ID="Button8"runat="server"Text="Button"/>

<asp:ButtonBorderStyle="Groove"ID="Button9"runat="server"Text="Button"/>

<asp:dropdownlistID="Dropdownlist1"runat="server"></asp:dropdownlist>

</asp:Panel>

</form>

</body>

</html>

Hi robpor88,

Thanks for bringing this to our attention. Does it flicker when loading, scrolling, or at other times? Could you perhapsfile a bug over at CodePlex?

Thanks,
Ted

RoundedCornersExtender confilicting with ModalPopupExtender in IE ?

hey every one i have the following code ... when you comment out RounedCornersExtender...the gridview dispears when the page loads

any idea why that is... only happnes in IE ..mozilla works fine :S

<%@dotnet.itags.org. Page Language="C#" MasterPageFile="~/Admin/Admin.master" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="Admin_Default" Title="Campaigns" %><%@dotnet.itags.org. Register Assembly="AtlasControlToolkit" Namespace="AtlasControlToolkit" TagPrefix="atlastoolkit" %><asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server"> <atlas:ScriptManager ID="sm1" runat="server" EnablePartialRendering="True"> </atlas:ScriptManager><%-- <atlastoolkit:RoundedCornersExtender ID="rce" runat="server"> <atlastoolkit:RoundedCornersProperties TargetControlID="GV_CampaignList" Radius="8" Color="#507CD1" /> </atlastoolkit:RoundedCornersExtender>--%> <atlastoolkit:ModalPopupExtender ID="MPE" runat="server"> <atlastoolkit:ModalPopupProperties TargetControlID="insertLnkBtn" PopupControlID="insertPnl" BackgroundCssClass="modalBackground" /> </atlastoolkit:ModalPopupExtender> <div class="MessageHeader"> Campagins </div> <br /> <hr /> <div id="MainContent"> <asp:GridView ID="GV_CampaignList" runat="server" Width="400px" HorizontalAlign="Center" AllowPaging="True" AllowSorting="True" DataSourceID="DS_GetAllCampagins" CellPadding="4" ForeColor="#333333" GridLines="None" AutoGenerateColumns="False" OnSelectedIndexChanged="GridView1_SelectedIndexChanged" OnSelectedIndexChanging="GridView1_SelectedIndexChanging"> <Columns> <asp:CommandField ShowSelectButton="True" /> <asp:BoundField DataField="C_SiebelID" HeaderText="ID" /> <asp:BoundField DataField="C_Title" HeaderText="Name" SortExpression="C_Title" /> <asp:CommandField ShowEditButton="True" /> <asp:CheckBoxField DataField="C_isActive" HeaderText="Active" /> </Columns> <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" /> <RowStyle BackColor="#EFF3FB" /> <EditRowStyle BackColor="#2461BF" /> <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" /> <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" /> <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" HorizontalAlign="Center" /> <AlternatingRowStyle BackColor="White" /> <PagerSettings Position="TopAndBottom" /> </asp:GridView> <br /> <asp:LinkButton ID="insertLnkBtn" runat="Server" OnClientClick="ShowPanel();">Create New Campaign</asp:LinkButton> <script language="javascript" type="text/javascript"> function ShowPanel(){ document.getElementById('ctl00_ContentPlaceHolder1_insertPnl').style.visibility = "visible"; } </script> </div> <br /> <asp:Panel ID="insertPnl" runat="server" CssClass="popupControl"> <asp:DetailsView ID="DetailsView1" runat="server" CssClass="DetailView" AlternatingRowStyle-CssClass="DetailViewEven" HorizontalAlign="Center" GridLines="None" DataSourceID="DS_GetAllCampagins" DefaultMode="Insert"> <Fields> <asp:CommandField ShowInsertButton="True" HeaderText="Create New Campaign" ShowHeader="True" /> </Fields> <AlternatingRowStyle CssClass="DetailViewEven" /> </asp:DetailsView> </asp:Panel> <atlas:UpdateProgress ID="updating" runat="server"> <ProgressTemplate> Updating DataBase<img src="../images/ball2.gif" height="40" width="40" /> </ProgressTemplate> </atlas:UpdateProgress> <asp:SqlDataSource ID="DS_GetAllCampagins" runat="server" CacheDuration="600" ConnectionString="<%$ ConnectionStrings:LocalSqlServer%>" SelectCommand="Campaigns_Admin_GetAll" SelectCommandType="StoredProcedure" SqlCacheDependency="Campaigns" InsertCommand="Campaigns_Admin_Insert" InsertCommandType="StoredProcedure" UpdateCommandType="StoredProcedure"> </asp:SqlDataSource></asp:Content>
The GridView disappeared because the RoundedCorners was pointing at it, a TABLE, and the way RoundedCorners works is such that pointing it at a TABLE isn't great. So I added a wrapper Panel and tweaked the settings to get things centered again. The below page works for me in IE7 and FF:
<%@. Page Language="C#" %><%@. Register Assembly="AtlasControlToolkit" Namespace="AtlasControlToolkit" TagPrefix="atlasToolkit" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><script runat="server"></script><html xmlns="http://www.w3.org/1999/xhtml"><head runat="server"> <title>Untitled Page</title></head><body> <form id="form1" runat="server"> <div> <atlas:ScriptManager ID="sm1" runat="server" EnablePartialRendering="True"> </atlas:ScriptManager> <atlastoolkit:RoundedCornersExtender ID="rce" runat="server"> <atlastoolkit:RoundedCornersProperties TargetControlID="Panel1" Radius="8" Color="#507CD1" /> </atlastoolkit:RoundedCornersExtender> <atlastoolkit:ModalPopupExtender ID="MPE" runat="server"> <atlastoolkit:ModalPopupProperties TargetControlID="insertLnkBtn" PopupControlID="insertPnl" BackgroundCssClass="modalBackground" /> </atlastoolkit:ModalPopupExtender> <div class="MessageHeader"> Campagins </div> <br /> <hr /> <div id="MainContent"> <asp:Panel ID="Panel1" runat="server" Width="400px" HorizontalAlign="Center" BackColor="lightblue" style="margin-left:auto;margin-right:auto;"> <asp:GridView ID="GV_CampaignList" runat="server" Width="400px" HorizontalAlign="Center" AllowPaging="True" AllowSorting="True" DataSourceID="DS_GetAllCampagins" CellPadding="4" ForeColor="#333333" GridLines="None" AutoGenerateColumns="False" > <Columns> <asp:CommandField ShowSelectButton="True" /> <asp:BoundField DataField="C_SiebelID" HeaderText="ID" /> <asp:BoundField DataField="C_Title" HeaderText="Name" SortExpression="C_Title" /> <asp:CommandField ShowEditButton="True" /> <asp:CheckBoxField DataField="C_isActive" HeaderText="Active" /> </Columns> <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" /> <RowStyle BackColor="#EFF3FB" /> <EditRowStyle BackColor="#2461BF" /> <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" /> <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" /> <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" HorizontalAlign="Center" /> <AlternatingRowStyle BackColor="White" /> <PagerSettings Position="TopAndBottom" /> </asp:GridView> </asp:Panel> <br /> <asp:LinkButton ID="insertLnkBtn" runat="Server" OnClientClick="ShowPanel();">Create New Campaign</asp:LinkButton> <script language="javascript" type="text/javascript"> function ShowPanel(){ document.getElementById('ctl00_ContentPlaceHolder1_insertPnl').style.visibility = "visible"; } </script> </div> <br /> <asp:Panel ID="insertPnl" runat="server" CssClass="popupControl"> <asp:DetailsView ID="DetailsView1" runat="server" CssClass="DetailView" AlternatingRowStyle-CssClass="DetailViewEven" HorizontalAlign="Center" GridLines="None" DataSourceID="DS_GetAllCampagins" DefaultMode="Insert"> <Fields> <asp:CommandField ShowInsertButton="True" HeaderText="Create New Campaign" ShowHeader="True" /> </Fields> <AlternatingRowStyle CssClass="DetailViewEven" /> </asp:DetailsView> </asp:Panel> <atlas:UpdateProgress ID="updating" runat="server"> <ProgressTemplate> Updating DataBase<img src="../images/ball2.gif" height="40" width="40" /> </ProgressTemplate> </atlas:UpdateProgress> <asp:XmlDataSource ID="DS_GetAllCampagins" runat="server"> <Data> <root> <item C_SiebelID="a" C_Title="b" C_isActive="false" /> </root> </Data> </asp:XmlDataSource> </div> </form></body></html>

Thank you very much Smile