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

2012年3月28日水曜日

ResizeControlExtender causes panel to have 0px width and 0px height

All,

I am adding a ResizeControlExtender to a panel that already has a DragPanelExtender and am getting some very odd behavior. The window I want to resize is created dynamically and I add the ajax extender programatically as well. I am able to put a resize handle on the popup window but when I mouse over the handle the panel collapses to 0px width and 0px height. I have specified all of the properties as follows:

ResizableControlExtender resizeWindow = new ResizableControlExtender();

resizeWindow.ID = "timePanelResize" + i;
resizeWindow.TargetControlID = "timePanel" + i;
resizeWindow.HandleCssClass = "handleImage";
resizeWindow.ResizableCssClass = "resize";
resizeWindow.MinimumWidth = 200;
resizeWindow.MaximumWidth = 200;
resizeWindow.MinimumHeight = 24;
resizeWindow.MaximumHeight = 600;
resizeWindow.HandleOffsetX = 186;
resizeWindow.HandleOffsetY = 187;
dragWindowPanel.Controls.Add(resizeWindow);

I am using c#, .Net 2.0, AJAX v1.0.61025, IE 7 and Firefox 2.01. on mouse over the following behavior occurs; In IE it flickers and collapses in Firefox it flickers and the height collapses to the min height. Also, the handle is extremely difficult to grab... Also, the mouse must be in exactly the right pixel position (about 1px wide and tall) in order to grab the handle.

Anybody else see behavior like this? If so, is there a solution?

Thanks,

Kevin

There's an old forum thread about this, but the gist is that you add another Panel/DIV wrapper so the two extenders can point at/modify different HTML elements.

2012年3月26日月曜日

Response.redirect causes post back using Atlas


Hi,

I have a webpage with a button on it. The button is placed in an update panel. I want to redirect user to another page when the user press the button. Basically it is a save button which save user information and redirect user to another page.

I tried using response.redirect("anotherpage.aspx") but it caused post back however the button is placed under a n update panel.

Can anyone help me out? I want to save data on button click and redirect user to another page without causing post back.


Thanks.
Imtiaz

Redirect has to cause a postback, you are trying to "redirect" the user.

Firstly, all things inside an update panel cause a postback, they just go through some different steps, and only deal with events in the update panel, and only refresh the part of the page inside the panel.

So your button is designed to postback, which it does... then redirects, the update panel picks this up, and changes the browser page.

The functionality is correct.

If you want, instead of a button with a redirect, make a regular html button with a clientside event.

onclick="redirect();"

function redirect(){

location.herf = 'newURL.aspx';

}

If you call a client side method to change the location of the page, then there is no post back to the server

Response.Redirect from UpdatePanel causes full refresh

I noticed that when I redirect to another page from within an update panel, the page fully refreshes (may be that's by design?).

How can I prevent this from happening?

Thanks.

you can not prevent this, this is the way any web sites works. When you say response.redirect, you are instructing the browser to make a fresh call to particular aspx page.


rmaiya:

you can not prevent this, this is the way any web sites works. When you say response.redirect, you are instructing the browser to make a fresh call to particular aspx page.

that is right.

If you are trying to only update the panel then try something like, updatePanel1.update();, or if you want to load a new page inside the panel try putting an iframe inside the panel


What is considered as best practice?

For example, if you click on the above links (such as "Learn", "Downloads", "Ajax"...) on this page, how do they ensure that that the header and footer elements of the page don't "blink"?


As they are different pages, I do want to do a response.redirect to keep the URL's friendly, but at the same time, I would like my header and other static elements not refresh each time. Do they use partial page caching to achieve this?

Response.Redirect in a PostBack causes javascript error => workaround here

There's a problem in Atlas when calling a Response.Redirect on a postback (and the ScriptManager uses "EnablePartialRendering=true"). E.g. doing a Response.Redirect("otherpage.aspx") from the button-click event code.

There's a workaround, however.

Instead of doing:

Response.Redirect("otherpage.aspx");

do this:

Page.ClientScript.RegisterStartupScript(
this.GetType(), "redirect",
"window.location.href='otherpage.aspx';",true);

I wrote a custom httpmodule (acquirerequeststate event) that needed to do a response.redirect in certain cases. This threw the "unknown error" on atlas pages. I added "false" for the endReponse parameter and it works fine now. Response.Redirect("page.aspx",false).

thanks

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