Showing posts with label popup. Show all posts
Showing posts with label popup. Show all posts

Monday, March 26, 2012

ATLAS used in UserControl. DropDownList problem

Hi everybody
I just modified my existing well working UserControl to use ATLAS's PopUp control.
The User Control has a Textbox, a calendar and four DropDownLists for Year, Month, Hour and Minute.
When a user clicks into the textbox, calendar with DDL's popup. If user clicks on a date, then the textbox is populated with new date.
But I do have problems when the user clicks on a DropDownList. As soon as the DropDownList opens and mouse is moved on it's items to select a new value, the panel containing Calendar and DDL's disappears.
It looks like the Atlas PopUp Control assumes that the focus was moved outside the control, But in reality the DropDownList is a part of the PopUp control.
How can I fix this?

Thanks in advance
Raja

I have the same problem using the Collapsable Panel with loading controls dynamically in the .aspx Page_Load event. When I Reorder the list, using the ReorderList control, the dynamically loaded controls disappeared.

It sounds like you're running into a general ASP.NET pattern - if you're dynamically adding controls, you'll need to re-add them after a postback as well.


My user control does not contain any dynamic controls and it works very well without ATLAS. I just think that ATLAS assumes the opened DropDownList itema as a new layer and so it thinks that the focus was moved from it's own PopUp panel and simply disappears.

Raja


Hi Raja,

I think your problem has to do with the way thePopupControlExtender handles theblur andfocus events. If you check out the code inPopupControlBehavior.js you'll probably see where things are going wrong. The good news is that we're looking at a better way of doing this and hope to release it in the next drop. For your current scenario though, you could modify the JavaScript code to only hide the popup when something outside it or the textbox is clicked.

Thanks,
Ted


I'm seeing the same problem in HoverExtender. The behavior that I see is that if the Panel's that's loaded is larger and outside of the region of hte target control ... then depending on where you click on the panel, you get diffeerent behaviors.

If I click on the DropDownList and navigate with the keyboard, the panel stays up.
If I click on the DropDownList and click on an item it goes way.

If I change the markup (in my case I'm dynamically generating within a template ... that's another story) to instead use a collection of RadioButtons, the panel is not dismissed.

--

In another panel I've got an embedded controller (the FlashPlayer). I've configured the flash player to not autostart (play=0). The only way to start playing is to click right. Doing so dismisses the hover panel.

Hi pstanhope,

I'm not able to reproduce this problem. Could you post a complete sample the demonstrates it? That would help a lot.

Thanks,
Ted

Atlas Unknown Error Popup on Session Exipry - Requesting fix

Hi,

I did some invesitgation on the"Unknown Error" javascript popup and it does happen when the session expires and the user performs an operation on the page. I am not able to get rid of this problem, eventhough the code checks for session expiry. The page doesn't load in the first place to call the function given below. Instead the unknown error popup appears . We are looking for a fix as soon as possible as we are going live next month . This is critical as almost all the web pages in the application is using atlas updatepanel. Can anyone please provide a solution to this problem.

Thanks in Advance,

Vikram

Session Expiry Server Side Code:

privatevoid CheckSessionExpiry()

{

string appPath = Request.ApplicationPath;if (appPath !="/")

appPath = appPath +

ConfigurationManager.AppSettings["SessionExpiryPage"];else

appPath =

ConfigurationManager.AppSettings["SessionExpiryPage"];string headerval =Convert.ToString((Session.Timeout * 60) - 45) +";URL=" + appPath;Response.AppendHeader("Refresh", headerval);if (Session["sUserID"] ==null)

{

Response.Redirect(appPath);

}

}

Unfortunately, there's no adequate solution. I'm facing the problem myself and I wonder when it's going to be fixed. You can browse through the forum to see I'm right.
If you are using other Java-Script functions on your page, I have found it matters if you have your SCRIPT tag with language=javascript or language="javascript" and if it is the HEAD of your HTML or in the BODY of your HTML.

If in the HEAD of your HTML, I have found that you need to have the double quotes [ language="javascript" ]

If in the BODY of your HTML, double quotes do not seem to matter, with or with out double quotes seems to work just fine.

For more detail:
http://jblack.wordpress.com/2006/08/18/javascript-or-javascript/

Hi,

Thanks for your reply. But unfortunately I do have language="javascript" . So what else could be the problem .

We use simple javascripts for doing some client side validations. Could they sometimes cause atlas to give raise to unknown error problem ?

Example 1:btnCompareBenefits.Attributes.Add("onclick", "return CompareClick();"); CompareClick function is in a .js file.

Example 2:deleteButton.Attributes.Add("onclick", "return confirm (\"Are you sure you want to Delete? \");");

Thanks in Advance,

Vikram


Hi All,

I am also experiencing an issue where I get unknown error.

My issue only happens when I wrap asp.net 2.0 controls in an update panel. The strangest thing is that this is only happening in one of two projects that uses the same ASP.net controls. In one I get the updates working fine in the other I get unknown error. The only difference as I can see is that n the project that doesn't work correctly the controlls are nested more deeply. I have a panel surrounding a header and body panel, giving the appearance of a window and the update panel is inside the body panel so the controls are 3 panels deep in design mode. In the project where it all works the controls are one panel deep only as they are inside an update panel only.

I have tried th javascript "javascript" fix as well and the ampersand fix and validaterequest="false" in the page tag... none work, the only way to stop the error is to avoid placing any asp.net control inside an update panel.. Then I get a postback :0(

This issue is crippling us at the moment.


My issue was totally the reverse! I have an ScriptManager on my masterpage. The "Unknown Error" popup was occuring on a page with no UpdatePanel. When I wrapped the asp.net 2 control on the page in an UpdatePanel the popup went away.

Bump.

I am also having this problem


I had this issue as well. I did find an acceptable work arround. Create and<ErrorTemplate> section within the ScriptManager tag. This will eliminate the JavaScript popup alert. Then you can have a firendly erro message asking the user to relogin and provide a link to the login page. Something like this:

<atlas:ScriptManagerID="ScriptManager1"EnablePartialRendering="true"OnPageError="Page_ErrorHandler"runat="server">
<ErrorTemplate>
<divclass="ErrorDialog">
<div>
<asp:ImageID="Image1"ImageUrl="~/images/error.gif"ImageAlign="AbsMiddle"runat="server"/>
<spanstyle="font-size: 16pt; font-weight: bolder;">Server Error</span>
</div>
<div>
You encountered an unexpected error. The error has been logged and will be investigated.
</div>
<div>
<ahref="login.aspx">click here to re-login.</a>
</div>
</div>
</ErrorTemplate>
</atlas:ScriptManager>

See ErrorTemplate doc for more info:http://atlas.asp.net/docs/Server/Microsoft.Web.UI/ScriptManager/P_ErrorTemplate.aspx

Hope this helps,
Perry


Remove lineResponse.AppendHeader("Refresh", headerval); & try again with correct session timeout methods.

remove any response.write statements & replace them with this.page.clientscript.registerclientscriptblock();

we have no problems with session timeout.Updatepanel works even if session is expired

Amit Lohogaonkar

mcp,mcad

lohogaonkaramit@.yahoo.com


Hi,
I have found this problem several times. finally I was able to corner it in my case.
I was using several UpdatePanels on my page and have few javascript functions within SCript tag in HEAD section of page.
It is important to note that whnever javascript function contains "postfix increment operator" i.e ++ or "postfix decrement operator" i.e. --, it will throw "Unknown Error".

Similarly whenever javascript function contains "logical AND operator " i.e. && "logical OR operator" i.e. ||, it throws the "Unknown Error".
However, if these functions are inside "BODY" tag then it works just great. Or if they are moved to a separate JS file and then include it in HEAD tag, it all works fine.

Hope this helps.
Mayur


Hi

still face same problem,

Regards,

Sarfaraj Sayyad


I'm guessing you guys are using ASP.NET Forms Auth - and the login cookie is expiring.

From what I can tell, ASP.NET Ajax throws an "Unknown Error" when it makes a XmlHttp call and gets a response which isn't what it was expecting.

In the case of a session expiry, instead of the page fragment it was expecting it suddenly gets back a "You need to login" page, or a 500 error, or a 404.

It doesn't know what to do, and dies with an "Unknown Error".

I'm going to try out that ErrorTemplate example pasted in one of the replies above and see if that does it for me.


I'm also getting the same 'Unknown error' alert when the session expires. Without Atlas on the page there is no problem. I can trap errors and modify the ErrorMessages of other page errors with with the 'OnPageError' event of the script manager but it won't trap the 'Unknown error'. I assume this is because the server code is not executed as Atlas is not able to deal with the expired session. My page continues after the alert and renews the session but I would like to avoid this error or at least be able to modify it.
I've discovered since my last post that the "Unknown error" only occurrs when the new session trys to redirect to a different page. In my app when the session starts it checks certain conditions and may redirect. If there is no redirect it renews the session without error.

I'm facing the same problem.

As I'm not using any other client side javascript than the one built in the atlas controls I can eliminate script specific error reasons.

Saturday, March 24, 2012

Atlas to AJAX- Open Modal Popup from Javascript

Hi,

I know that i can now show the modal popup server side but I have a case where i dont want or need a postback to show the popup. I have buttons in a repeater that and i simply show the modal on click...so in 'Atlas' i did this in javascript..

aspx..

<atlasT:ModalPopupExtenderID="ModalPopupExtender1"runat="server">

<atlasT:ModalPopupPropertiesID="MyPopup"

TargetControlID="Button1"PopupControlID="panModal"CancelControlID="btnCancel"

BackgroundCssClass="modalBackground"DropShadow="True"OkControlID="btnHiddenOK"/>

</atlasT:ModalPopupExtender>


Then in .js

$object("MyPopup")._show();


------AJAX-------

<ajaxT:ModalPopupExtenderID="ModalPopupExtender1"runat="server"

TargetControlID="Button1"PopupControlID="panModalPopup"CancelControlID="btnCancel"

BackgroundCssClass="modalBackground"DropShadow="True"OkControlID="btnHiddenOK"/>


And in .js...

$find("ModalPopupExtender1")._show();


Which doesn't work....Any ideas?

Also, I see properties in the control called Dynamic*; what are they for? Databinding?

Thx
Steve

bump... Anyone got a resolution for this?

Thx
Steve


I thnk that you need to use the show method instead of _show:

$find("ModalPopupExtender1").show();

The dynamic* properties appear to be related to dynamic population. See:


http://ajax.asp.net/ajaxtoolkit/Walkthrough/OtherNeatStuff.aspx

and search for "Easily adding dynamic population"



Thx
Thx cti.