Showing posts with label user. Show all posts
Showing posts with label user. Show all posts

Wednesday, March 28, 2012

ATLAS with Session

Hi, got a question about how atlas handle the serverside session?After user login, I put the user information into a session.

then, in the UI, there is a client javascript event calling the backend web service, and the web service needs to access the user information from session,

but it seems HttpContext.Current.Session is always null value..

understand, ajax actually initiate a new connection via xml http to the server, but can they access the session variable?

Make sure you enable session state in your Web Service:

[WebMethod(true,EnableSession=true)]
publicstring GetMessages(string ChatId,string Username)
{

}

+++ Rick --

Atlas with multiple GridViews

I have a page which needs to allow user to populate fields by selecting rows from Gridviews. I would like to temporarily display a GridView with search field to locate a row, then populate the associated field with a value from GridView row and move on to the next field with it's own associated GridView.

Is it possible to do true Ajax with Atlas, e.g. load content dynamically? It would be nice if the GridViews didn't load their corresponding data sources until acutally needed for a given field. I thought I might use the Atlas Control Toolkit's collapsible panel component but not sure if this is the best way to only render a GridView when it's needed.

Any suggestions on how to go about this would be appreciated.

hello.

though i haven't understood your scenario very well, i think that atlas can help you accomplish this. since you've spoken about gridviews, i think you'll want to use the server side approach, where you use an updatepanel to have a partial update zone on the page.

in these situations, you can have a placeholder and add controls dinamically to that control during postbacks (partial or complete).


Hi Luis

I'm not sure I understand my scenario completely either ;)

But suppose I have a drive name field. If a user clicks on choose button, a panel with search field and GridView pops up, allowing the user to select a driver from the user database. The driver name field is populated and the GridView disappears. Since I have a number of fields I need to allow the user to fill by choosing from a GridView I don't want to populate the page with GridViews at the outset.

Your idea sounds like it could work, but I'm unclear on what events I should use to dynamically add the GridView and search field. It would be great if you could direct me to a sample where someone uses Atals to replace content dynamically (would be great if it was with a GridView ;).

Thanks much!

hello.

hum...i think that basically we're talking about dynamic replacement of a portion of the page. you may use usercontrols to encapsulate both parts (on has the textbox and the search button and the other user control has the grid) and you'll need to work with the params collection in order to replace the controls dynamically (search the forums because one or two days ago i've wrote a small sample that shows how to replace the usercontrols dynamically in an updatepanel).

Atlas with Caching

Hi,

I would like to cache the output from a user control. I have a user control in which a grid appears and some links to reload the grid. The grid and the links are a part of atlas update panel.

I use<%@dotnet.itags.org.OutputCacheDuration="60"VaryByParam="None" %> on the control and this gives me a alert saying 'Unknown error' when i click on the links to reload the datagrid.

Can some one assist please?

Regards

Raj

hello.

there was a bug when updatepanels were used with caching:

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

atlas website or aspnet

Hello there,

I was wondering if it is necessary to create an atlas website to use atlas controls. I was thinking of creating aspnet website and user atlas controls in few pages. What's is the difference between atlas template and aspnet template?

many thanks!

kushpaw

You don't need a atlas website for atlas controls. You just need a Asp.Net website with the Atlas Dll referenced. Also you should run the Atlas .msi so that it registers the .asbx extension. Read this for more info.

http://atlas.asp.net/docs/Overview/Install.aspx


Hi,

you also need to make some changes to the web.config file. The quickest way to do this is to compare the atlas website's one with the web.config in the aspnet website.


thnx guys!

ATLAS Web User Control using AutoCompleteTextextender

hi friends

I have made to web User Controls. one is for Project selection and other is for Resource Selection. I have made is using ATLAS AutoCompleteTextExtender. Actually I want that when a user selects a project then according to this the Resource should should be come.

Actually I want that when user selects a project then I set the Project Id in my query , according to this Resource sholud be come.But I am unable to find the place , where I will write this. please reply this.

manish

Hi Manish,

The way that i see your problem you don't need an autocompletetextextender but just an update panel that will be trigger when you enter your project name. something like this:

<atlas:UpdatePanelID="upResults"runat="server"Mode="conditional">

<ContentTemplate>

<asp:TextBoxID="TextBoxResource"runat="server"></asp:TextBox>

</ContentTemplate>

<Triggers>

<atlas:ControlEventTriggerControlID="DropDownListProjects"EventName="SelectedIndexChanged"/>

</Triggers>

</atlas:UpdatePanel>

Hope this helps

Regards,


hiDennis

First thanks for reply. Deniss I think U have not got my actual problem. Actually I have made two controls using AutoCompleteTextExtender , this is in two pages and I am using both in third page. Suppose anyone selecting a project in one textbox then I want to store the current Project in session , which I can use in the WebService of another autocomplete Extender that is for Resource selection. My problem is that after selecting a Project I am not able to find the way to store the current project in session or anywhere. And I cannot use this value directly in another webservice bcz all r in different pages.I want a way to fire a postback of only the project selector, by which on lostfocus , I can store this value.

please reply .

Regards

Manish

Monday, March 26, 2012

Atlas User Control transparence

Hello.

When using Atlas UpdatePanel in User Control, then is this User Control transparent. Why?

hello.

what do you mean by transparent?


This is code of Web User Control:

<asp:TextBoxID="txtDate"runat="server"></asp:TextBox>

<asp:PanelID="Panel1"runat="server"Height="50px"Width="125px">

<atlas:UpdatePanelID="AtlasPanel1"runat="server">

<ContentTemplate>

<asp:CalendarID="cldCalendar"runat="server">

</asp:Calendar>

</ContentTemplate>

</atlas:UpdatePanel>

</asp:Panel>

<atlasc1:PopupControlExtenderID="PopupControlExtender1"runat="server">

<atlasc1:PopupControlPropertiesPopupControlID="Panel1"Position="Bottom"TargetControlID="txtDate"/>

</atlasc1:PopupControlExtender>

If I put this UC on Web Form and pick the date the Calendar is translucent.

Solution I found (not to say to a "problem"): Calendar needs some styling or it must be put into <DIV>, …

Atlas User Control bug Error rendering control

Hello

Help me with this two:

1. I'm using the latest Atlas July version and I'm getting error 'Error rendering control' in design when I want to use Atlas UpdatePanel in user control. After starting the application the control work fine.

2. If UpdatePanel is passing value from Calendar control to the TextBox control and TextBox property is read only – the value could not be read and vanish after postback.

Thanks for answer and keep up the good work and try with less bugs.

Hi Filip, for #2

As a workaround, you can trap event "Calendar_SelectionChanged" and save the value somewhere else. Also in this method, you can call

popCalendarPanel.Commit(txtDate, currentCal.SelectedDate);

which is how you can do something custom with the pop up result itself.


Thanks

I will try thisand post it back the results.

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 updatepanel with datalist issue

I have a datalist contained within an atlas updatepanel and that all works fine.

The idea is that the user can create a subset from the items in the datalist, so I would like them to be able to click a button or link for a given item in the datalist and this will then appear in the subset which is contained within its own updatepanel.

The problem I am having is that using the OnItemCommand method and a select linkbutton in the datalist does not work with the updatepanel - the method does not fire on the server. Without the updatepanel it works as expected.

So my question is : what method should I use to create a per item link that will fire the server method, and update the second updatepanel.

Thanks

John

This may or may not be the correct solution, but it worked for me. Try adding a control event trigger to your update panel that references your datalist and the ItemCommand event. Hope this helps!

Atlas updatepanel triggered by user control event

I created a user control which has a imagebuttton in it, I then exposed the click event of the button to the page the user control was placed on using the following code:

Public Event ImageButton1_Click(ByVal senderAs Object,ByVal eAs EventArgs)Private Sub eventXYZ(ByVal senderAs Object,ByVal eAs System.Web.UI.ImageClickEventArgs)Handles ImageButton1.ClickRaiseEvent ImageButton1_Click(sender, e)End Sub

I can use this event from the ASPX page with no problems, however when I use the event as an Atlas trigger for the updatepanel the page always posts back. Is there any way to wire this event up to the upatepanel and avoid the postback (btw the user control was not added dynamically).

Any chance you've found a resolution to this? I'm having the same issue but with a dropdown in a user control....

Thanks.


hello.

well, not something supported out of the box...maybe this tip will help you:

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

Atlas update progress

I have page with large execution time, so I use updateProgress to show the user, taht the page is still calculating:

<atlas:UpdateProgress ID="up" runat="server">
<ProgressTemplate>
<div class="progress">
<img src="http://pics.10026.com/?src=../images/indicator.gif" />
Calculating...
</div>
</ProgressTemplate>
</atlas:UpdateProgress
I would like that user see the indicator as long as the server is calculating results .
But when 90 seconds is passed, my indicator is gone and user thinks that
calculation is done.
If I remove atlas, than page is generating 3 minutes(server.scriptTimeout is setted to 1000 seconds).
Any idea how to enlarge execution time of atlas update progress?

Regards,S

Hi there,

The timeout period for async postbacks with UpdatePanels is currently hard-coded to be 90 seconds. I don't know of any workaround in the CTPs, though this issue will be addressed in Atlas 1.0.

Thanks,

Eilon

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.

Wednesday, March 21, 2012

Atlas script not working after partial postback

I have a DetailsView in my page for inserting new data (wich has the "Insert" mode as default) , but it only shows up when the user clics a "new" link (outside the DetailsView). The "new" link and the "cancel" link (this one as a command field inside the DetailsView) are setting the visible property of the DetailsView using an Atlas script:

The link button is declared as follows:

<

asp:LinkButtonID="linkButtonNuevo"runat="server"CausesValidation="False"EnableViewState="False"OnClientClick="javascript:return false">Crear nuevo tipo</asp:LinkButton>

(I'm usingOnClientClick="javascript:return false"to prevent a postBack)

The cancel link (inside the DetailsView command field) is set by this code in the DetailsView DataBound event handler:

link.ID =

"linkButtonCancelarNuevo";

link.Attributes[

"onClick"] ="javascript:return false";

The Atlas Script is:

<control id="ctl00_ContentPlaceHolder1_detailsViewNuevo" cssClass="HiddenElement" />

<hyperLink id="ctl00_ContentPlaceHolder1_linkButtonNuevo">

<click>

<setProperty target="ctl00_ContentPlaceHolder1_detailsViewNuevo" property="cssClass" value="VisibleElement" />

</click>

</hyperLink>

<hyperLink id="ctl00_ContentPlaceHolder1_detailsViewNuevo_linkButtonCancelarNuevo">

<click>

<setProperty target="ctl00_ContentPlaceHolder1_detailsViewNuevo" property="cssClass"value="HiddenElement" />

</click>

</hyperLink>

By the way... I'm using a MasterPage, and this things (the link and the DetailsView) are inside an UpdatePanel.

So, I can keep showing/hiding the detailsView perfectly as long as I want (clicking new / cancel)... However, when I click the insert button in the DetailsView to save the data, it saves the data (calling a server-side method) and makes a partial postBack. After that, the Atlas script does not work anymore!!! I click the new link, but absolutely nothing happens... In fact, this happens after a partial postback caused everywhere else in the page...

I don't know if there is something I'm missing about the script or the UpatePanel and the partial postback... so, can anyone tell me what is happening here?

Thanks for any help

AlexPhi

hello.

well, i'm assuming that you've placed the links inside the updatepanel...in that case, the xml-script will be discarded since those objects will be destroyed (ie, replaced), when the client receives the new html sent from the server. if this is your scenario, then you must introduce the xml-script during all the postbacks (i think that you might have to build an extender that adds this code to the page during all the postbacks).

Atlas quirk in IE 6

Hello all,
First time Atlas user over here, and I just wanted to say that I'm damn impressed with the toolkit.. that and I've noticed a graphical quirk in IE when using Atlas.

I currently have a master page with everything positioned in CSS (menus, background, content etc). I have a small section of my default webpage use atlas to update a a label from a textbox after I click a submit button (basically: lblChat.text=TextBox1.text;). The thing works fine in firefox, however, in IE 6 when I click on the submit button the background of the webpage flashes to grey for a second (the page doesn't refresh though, just the background disappears for a second).

I have set the background of the webpage in a CSS file as follows:
body
{
background-image: url(Images/background.jpg);
background-attachment: fixed;
}

Any idea why this is happening?

Thanks.

Styles are re-sent to the page on any callback, to enable the serv-erside processing to change the stylesheet as well as the data. So if the background is set via CSS, this will refresh, and may cause a flicker as the browser re-paints.

It does seem like a pain in situations like yours, but it is really handy being able to change the styles for the whole page without having to re-query the data for the whole thing (when you want that behaviour).

Richard.