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

2012年3月28日水曜日

Resizable Control bug?

The following code:

_lining.style.backgroundImage = 'url(invalid)'; // Keeps IE from ignoring the content-free element

in ResizableControlBehavior class is not working well with IE6. The image is being requested by browser every event the control fires (mousedown, mouseup, mousemove etc.). Check out your browser's status bar while resizing the control (watch it carefully as the text blinks very quickly) or use Nikhil's Web Development Helper with http logging on to see the requests.

There are many ways to fix this. I use solid black background with 20% opacity for additional effect.

Thanks for reporting this. Could you file an issue with this information atwww.codeplex.com?

Choose "Atlas Control Toolkit" then "Issues".

Thanks!

2012年3月26日月曜日

Response.Redirect and UpdatePanel Problem Again

I can't figure out if I'm doing something wrong, it's just how it is, or it's a bug. If I create an UpdatePanel and place a button in it and then put Response.Redirect in the button's click event, everything works as I would expect and I'm redirected to the page I specified in the event. Now, if I drop a DataList inside the UpdatePanel and then put LinkButtons that have OnCommand and CommandArguement properties inside the DataList's ItemTemplate, response.redirect won't work for those LinkButtons. It just clears the datagrid and remains on the same page.

I've read everything I can find about people having the same problems but everything I read doesn't address buttons inside a DataList. Normal buttons in the UpdatePanel work for me. I'm using Ajax 1.0 RC.

Strange. Could you share your code?

Here's what I tried, and it works fine:

<%@. 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 item_command(object sender, DataListCommandEventArgs e) { Response.Redirect("http://ajax.asp.net"); } protected void Page_Load(object sender, EventArgs e) { list.DataSource = new string [] { "one", "two", "three" }; list.DataBind(); }</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"> <asp:ScriptManager ID="sm1" runat="server" /> <asp:UpdatePanel ID="up1" runat="server" UpdateMode="Conditional"> <ContentTemplate> <asp:DataList ID="list" runat="server" OnItemCommand="item_command"> <ItemTemplate> <asp:LinkButton ID="button" runat="server" Text="<%# Container.DataItem%>" CommandName="redirect" /> </ItemTemplate> </asp:DataList> </ContentTemplate> </asp:UpdatePanel> </form></body></html>

I need to get the CommandArgument from the LinkButton, set it to a session variable and then redirect. Here is an example of my code.

<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:datalist id="MyList" runat="server" EnableViewState="False" RepeatColumns="4">
<ItemTemplate>
<asp:LinkButton ID="MyLinkButton" runat="server" EnableViewState="FALSE" OnCommand="My_Command" CommandArgument='<%# Eval("MyID") %>'><%# Eval("MyName") %>
</asp:LinkButton>
</ItemTemplate>
</asp:datalist>
</ContentTemplate>
</asp:UpdatePanel>
Public Sub My_Command(ByVal senderAs Object,ByVal eAs System.Web.UI.WebControls.CommandEventArgs) Session("MyID") = e.CommandArgument Response.Redirect("MyDetail.aspx",False)End Sub
 
Thanks!

I haven't tried this yet, but I notice you're passing False as the second argument to Response.Redirect()... does it make a difference if you change that to true? (Or simply drop it as in my example?)

I've tried it all three ways with the same result.


I tried the following code and it seems to work for me too. Have you used Fiddler on any other trace tool to chaeck what the response is from the server?

<%@. Page Language="VB" AutoEventWireup="true" %><script runat="server"> Protected Sub LinkButton1_Command(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.CommandEventArgs) Session("MyID") = e.CommandArgument Response.Redirect("Default2.aspx") End Sub</script><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head runat="server"> <title>Untitled Page</title></head><body> <form id="form1" runat="server"> <asp:ScriptManager ID="ScriptManager1" runat="server" />   <asp:UpdatePanel ID="UpdatePanel1" runat="server" EnableViewState="False"> <ContentTemplate> <asp:DataList ID="DataList1" runat="server" DataSourceID="SqlDataSource1" EnableViewState="False" RepeatColumns="4"> <ItemTemplate> <asp:LinkButton ID="LinkButton1" runat="server" CommandArgument='<%# Eval("AddressID")%>' OnCommand="LinkButton1_Command" Text='<%# Eval("AddressLine1") + Eval("AddressLine2")%>'></asp:LinkButton> </ItemTemplate> </asp:DataList> <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:AdventureWorksConnectionString%>" SelectCommand="SELECT TOP 100 Person.Address.* FROM Person.Address"></asp:SqlDataSource> </ContentTemplate> </asp:UpdatePanel>   </form></body></html>

I finally found the problem. In my codefile I have a sub that gets called that fills the datalist in the Page_Load procedure.

As an example:

If Not Page.IsPostBackThen
 'Do some stuff if this isn't a postback UpdateMyDataListEnd If
This worked for everything *except* clicking on the LinkButtons in the Datalist. So what I did was this and it now works for the LinkButtons as well.
 
If Not Page.IsPostBackThen
 'Do some stuff if this isn't a postback
Else UpdateMyDataListEnd If

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