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

2012年3月28日水曜日

ResizableControlExtender- Maintain size on postback

Hi all,

I'm wet behind the ears when it comes to atlas, I just downloaded the latest ctp and toolkit and starting playing around. I started playing with the ResizableControl and can't seem to figure out how to get it to maintain it's new size after a postback. Is there anyway to do this? I know how to use the ProfileBindings on the DragPanel to maintain the location of the panel on postback and I've tried using the ProfileBindings on the ResizeableControl, but there doesn't seem to be an ExtenderPropertyName for the size. Any thoughts/ideas/comments are greatly appreciated!

Thanks,

Ben

I'm confused. The ResizableControl should automatically preserve its size after a postback. TheResizableControl sample page does this for me in IE6/IE7/FF/S - are you seeing something different?

2012年3月24日土曜日

Rounded Corners & CSS Margin

I am using the rounded corners control on a panel control. I have the margin of the panel defined with CSS. This causes a gap the size of the margin setting between the panel and the Rounded Corner effect. Am I doing something wrong or is this a bug with the extender?

That's the way the control works unfortunately. If you look at the docs it tells you that it adds to the height of the of the control it is extending to achieve the rounding effect which makes fairly worthless for anything that requires headers for example...

Hopefully MS can figure out a better way to do this in the future, but being an extender I'm not sure that there really is a better way to do this since the control has to work with an existing control and its size parameters.

+++ Rick --


--
Rick Strahl
West Wind Technologies
www.west-wind.com
www.west-wind.com/weblog

<JasonRCS> wrote in messagenews:1287524@.forums.asp.net...

I am using the rounded corners control on a panel control. I have the margin of the panel defined with CSS. This causes a gap the size of the margin setting between the panel and the Rounded Corner effect. Am I doing something wrong or is this a bug with the extender?

http://forums.asp.net/thread/1287524.aspx

This ends up being a mutually exclusive situation unfortuntely. If someone has an idea for a solution I amall ears.

The only way I know of doing the rounded corners without custom bitmaps is to add elements to the control. Let's call them adornments.

So, you can either add the elements outside of the control you're targeting or inside.

If you add them outside it falls down quickly. If you have any positioning set on the thing you are targeting (relative or absolute), then the adornments get left behind. So that's a major problem.

If you add them inside the control (which is what we do), it generally works better, but there are combinations of styles that we can't handle, margin being one of them.

In most cases you can accomplish what you need to by composition - meaning if you wrap another div/panel around the outside of your object and apply the rounded cornders to that one or vice-versa you can make it do what you want.


Thank you both for your comments. I just wanted to make sure that isthe way it is supposed to work. I will get by with using an embeddeddiv for now.

I am not aJavaScript person, but would it be possible for the control tomodifythe border property of the element? This would allow the modificationto be reside between the padding and margin attributes of an element. Just throwing ideas out there. I know the Mozilla browsers support a proprietary attibute of moz-radius to do this with borders.

Thank you agian for your help!

Jason

JavaScript
java script
java-script
conscript
Edit...
Ignore all
Add to dictionary

modify
mortify
motif
codify
modding
Edit...
Ignore all
Add to dictionary


Sorry for the extra junk at the bottom... Google Spell Check gone bad!

The modifications are just a bunch of added DIVs, so they can't live in that zone unfortunately.

If the embedded DIV trick works for you, stick with that.


Same problem here - although I have previously managed to set up CSS only rounded corners which do not suffer from this problem, so I'm going to compare and contrast with the extender, to see if I can fix it up.

Should you happen to want a work-around in the meantime, e.g. my example, where I wanted "margin-top: 10px" on a div with rounded corners (so that there was a blank space between two divs which are one above the other), you can wrap an extra div around your panel-with-rounded-corners, and put the margin on that (extra) div - leaving the rounded corners as is.

Cheers,

Matt

2012年3月21日水曜日

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 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