Showing posts with label loads. Show all posts
Showing posts with label loads. Show all posts

Wednesday, March 28, 2012

Postbacks not working

OK so this is REALLY weird.

My atlas post backs don't work when the page fist loads, but once I refresh the page everything works great. I've compared the source for webpage when it works and when it doesn't and they are identical.

Anyone have any ideas?

Hi,

could you show us the relevant code?

Please see the following post for the code:

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


hello again.

as i said, i've loaded the page and it is working here with or without partial rendering. hum...have you tried building a new web site by using the atlas template?


When I build a new web site useing the atlas template I get the same issue (Atlas only works on reload)

Sample Atlas projects I've downloaded (AtlasControlToolkit) seems to work fine.


hello again.

there's some weird stuff!!! btw, have you used fiddler to see what's happening during a partial postback?


Yes, fiddler isn't getting anything.

Monday, March 26, 2012

Preselecting a value in the CascadingDropDown control

G'day,

I have a form that saves and loads data from a database. Creating new forms is fine however when reloading hthe form for editing I want the CascadingDropDown control to have its previously selected value displayed.

I have tried the obvious such as loading the controls data and using SelectedValue = someId but it didn't work (probably not surprising!). I also tried setting the controls Text property incase Atlas detected a non empty value and left it alone. I had a bit of a look at the source but I don't yet know enough about the architecture to answer the question myself or to write some code.

Is there a way in this version of preselecting a value when setting up a form from server data on an initial page load?

Keep up the good work guys!

Regards,
Steven.

If you put the following code into the Page_Load for the CascadingDropDown.aspx, it will initialized the first item:

CascadingDropDown1.TargetProperties[0].ClientState ="BMW (value)";

Unfortunately you can't do this for other ones because the change of the first item to the specified value will clear the subsequent items, so we'll need to make improvements here.

But in general the idea is that you should be able to set the ClientState to be the string version of thevalue you want to set (not the text label).

Thinking more about this I think there's a few things we'll do in a future release (might not make our next refresh):

1) Add a strongly typed property for this e.g. "Selected" value

2) Try to make it so the value doesn't flash before the text gets set

3) Make sure you can do more than just the top level here.

Thanks for pointing this out, it's good feedback.

Thanks,

Shawn


So, am I to understand that currently values cannot be selected in dependent lists based on data that that was retrieved from a database?

When I user selects an item to edit, I populate the form with all the existing data for that item, however, some of my dependent lists are not getting the SelectedValue set.

I have an Account list (the parent), I am able to set its SelectedValue.

Sub-Account, Contact, Network and Gateway are dependent on Account. Gateway Version is dependent on Gateway.

When I populate my form the SelectedValue is set successfully for the following lists:

Account, Gateway, Gateway Version

The other lists are disabled and show the PromptText. This would be less confusing to me if ALL dependent lists were disabled with the prompt text selected.

Is there a way to make this work? Or do I need to abandon the CascadingDropDown and find another solution?

(My original post:http://forums.asp.net/thread/1383830.aspx)


It sounds like you have a 1:many parent:child relationship going on here. If so, then I think I fixed the problem withwork item 1704. Please trya recent development release and let us know if it's still not working.

(My app is a ticketing system)

I downloaded the Wed, 30 Aug 2006 17:53:43 GMT version and it solved my issue with the values of the "child" lists not getting selected when viewing/editing an existing ticket. However, now when I go to add a new ticket, my page hangs when it loads the CascadingDropDowns. My cursor becomes an hour glass and my browser becomes unresponsive. My lists never get populated, not even the "parent".

Eventually I get this error: "A script on this page is causing Internet Explorer to run slowly. If it continues to run, your computer may become unresponsive. Do you want to abort the script?"

I'll download a different development release while I wait for a response and see if that makes a difference.

(Side note: I was going to upload a screen shot of the error, but I don't have permission to perform uploads.)


It sounds like either you have a circular reference in your page - or CascadingDropDown is adding one. :) If nothing stands out for you, please post a simple sample so we can have a look. Thanks!

If I add the CascadingDropDownProperties like this (below) the "Add New Ticket" pages hangs on load. However, the "Edit Existing Ticket" page will load/populate just fine - including all of the "child" lists.

<atlasToolkit:CascadingDropDownID="CascadingDropDown1"runat="server">

<atlasToolkit:CascadingDropDownProperties

TargetControlID="AccountList"

Category="Account"

PromptText="-- Select Account --"

ServiceMethod="GetAccountList"

ServicePath="CascadingListService.asmx"/>

<atlasToolkit:CascadingDropDownProperties

TargetControlID="ExchangeList"

PromptText="-- Select Exchange --"

Category="Exchange"

ServiceMethod="GetExchangeList"

ServicePath="CascadingListService.asmx"/>

</atlasToolkit:CascadingDropDown>

<atlasToolkit:CascadingDropDownID="CascadingDropDown2"runat="server">

<atlasToolkit:CascadingDropDownProperties

TargetControlID="ContactList"

ParentControlID="AccountList"

PromptText="-- Select Contact --"

Category="Contact"

ServiceMethod="GetContactList"

ServicePath="CascadingListService.asmx"/>

</atlasToolkit:CascadingDropDown>

<atlasToolkit:CascadingDropDownID="CascadingDropDown3"runat="server">

<atlasToolkit:CascadingDropDownProperties

TargetControlID="SubAccountList"

ParentControlID="AccountList"

PromptText="-- Select Sub-Account --"

Category="SubAccount"

ServiceMethod="GetSubAccountList"

ServicePath="CascadingListService.asmx"/>

</atlasToolkit:CascadingDropDown>

<atlasToolkit:CascadingDropDownID="CascadingDropDown4"runat="server">

<atlasToolkit:CascadingDropDownProperties

TargetControlID="NetworkList"

ParentControlID="AccountList"

PromptText="-- Select Network --"

Category="Network"

ServiceMethod="GetNetworkList"

ServicePath="CascadingListService.asmx"/>

</atlasToolkit:CascadingDropDown>

<atlasToolkit:CascadingDropDownID="CascadingDropDown5"runat="server">

<atlasToolkit:CascadingDropDownProperties

TargetControlID="GatewayList"

ParentControlID="AccountList"

PromptText="-- Select Gateway --"

Category="Gateway"

ServiceMethod="GetGatewayList"

ServicePath="CascadingListService.asmx"/>

</atlasToolkit:CascadingDropDown>

<atlasToolkit:CascadingDropDownID="CascadingDropDown6"runat="server">

<atlasToolkit:CascadingDropDownProperties

TargetControlID="GatewayVersionList"

ParentControlID="GatewayList"

PromptText="-- Select Gateway Version --"

Category="GatewayVersion"

ServiceMethod="GetGatewayVersionList"

ServicePath="CascadingListService.asmx"/>

</atlasToolkit:CascadingDropDown>

____________________________________________________________________________________________________

If I add the CascadingDropDownProperties like this (below) the "Add New Ticket" page loads just fine, however, the "Edit Existing Ticket" page doesn't populate the "child" lists properly - only Account, Gateway, and GatewayVersion have the correct values selected.

<atlasToolkit:CascadingDropDownID="CascadingDropDown1"runat="server">

<atlasToolkit:CascadingDropDownProperties

TargetControlID="AccountList"

Category="Account"

PromptText="-- Select Account --"

ServiceMethod="GetAccountList"

ServicePath="CascadingListService.asmx"/>

<atlasToolkit:CascadingDropDownProperties

TargetControlID="ExchangeList"

PromptText="-- Select Exchange --"

Category="Exchange"

ServiceMethod="GetExchangeList"

ServicePath="CascadingListService.asmx"/>

<atlasToolkit:CascadingDropDownProperties

TargetControlID="ContactList"

ParentControlID="AccountList"

PromptText="-- Select Contact --"

Category="Contact"

ServiceMethod="GetContactList"

ServicePath="CascadingListService.asmx"/>

<atlasToolkit:CascadingDropDownProperties

TargetControlID="SubAccountList"

ParentControlID="AccountList"

PromptText="-- Select Sub-Account --"

Category="SubAccount"

ServiceMethod="GetSubAccountList"

ServicePath="CascadingListService.asmx"/>

<atlasToolkit:CascadingDropDownProperties

TargetControlID="NetworkList"

ParentControlID="AccountList"

PromptText="-- Select Network --"

Category="Network"

ServiceMethod="GetNetworkList"

ServicePath="CascadingListService.asmx"/>

<atlasToolkit:CascadingDropDownProperties

TargetControlID="GatewayList"

ParentControlID="AccountList"

PromptText="-- Select Gateway --"

Category="Gateway"

ServiceMethod="GetGatewayList"

ServicePath="CascadingListService.asmx"/>

</atlasToolkit:CascadingDropDown>

<atlasToolkit:CascadingDropDownID="CascadingDropDown3"runat="server">

<atlasToolkit:CascadingDropDownProperties

TargetControlID="GatewayVersionList"

ParentControlID="GatewayList"

PromptText="-- Select Gateway Version --"

Category="GatewayVersion"

ServiceMethod="GetGatewayVersionList"

ServicePath="CascadingListService.asmx"/>

</atlasToolkit:CascadingDropDown>


We'll probably need the corresponding web service (or one that returns close enough data to reproduce the problem), too, please. If this can be reproduced with the SampleWebSite's web service, a demonstration using that is also fine.

Saturday, March 24, 2012

Problem Getting Atlas Wiki to Work

Help!

I've installed the wiki template and created a project. When I run it the first time, the page loads and all is well. However, when I go to click on links to some of the other pages like "Membership in the Wiki", the URL shows "default.aspx?page=membership%20in%20the%20wiki" as expected, however, the homepage is what is displayed. Other curious behavior:

If I attempt to create a user, that user does in fact get written to the database and I am able to grant it roles in the website configuration, however, if I go back to the wiki to log in, it is stuck on "Validating Credentials"Clicking on either "Comments" or "Contents" gives me a stuck "Loading" message.I have verified the following:
I do have ASPNET & Annonymous internet users with write access to the App_data directoryDatabase connection strings work.Does anyone have any suggestions? I'm about to give up.Update: If I create the Wiki using the "local filesystem" option it works fine. If I try to use the copy tool and copy it to my IIS directory (same machine), I get the bad behavior. Sounds like an IIS problem. Is it configuration? Is it buggy IIS? I'm using 5.1 on XP.

I'm new to the "ajax" world, also to the Atlas Wiki and am having the same issue with the linking.

When creating and article and saving, directly afterwards, the article is displayed correctly.

Yet if I navigate to the contents menu, then to that or any other article currently in the wiki, it routes me to this URL: "default.aspx?page=" then the article's name, but it does not display the article. The contents of that page are always the same.

Wednesday, March 21, 2012

Problem in finding dynamically loaded user control in javascript when using ASP.Net AJAX

Hi,
I am loading user controls dynamically in an update panel. User control loads smoothly, but when i viewsource the page, the current loaded user control can't be found there. What I found is old user control which loads when page is loaded for the first time. I have a grid view control in that user control which i want to validate using javascript, but this grid view control can't be found by javascript 'getElementById' function. How can i access grid view and other controls in javascript?

Thanks in advance.
Regards

Amjad Paracha, MCP
Software Engineer.

Seehttp://forums.asp.net/t/1149634.aspx

My guess is that your ID is incorrect when you are trying to access the control.

-Damien


amjad.paracha:

Hi,
I am loading user controls dynamically in an update panel. User control loads smoothly, but when i viewsource the page, the current loaded user control can't be found there. What I found is old user control which loads when page is loaded for the first time. I have a grid view control in that user control which i want to validate using javascript, but this grid view control can't be found by javascript 'getElementById' function. How can i access grid view and other controls in javascript?

Thanks in advance.
Regards

Amjad Paracha, MCP
Software Engineer.

What you are experiencing is the reality of how a browser actually works. The source code that you download on page load is not fixed. Its image in browser computer memory can be altered dynamically (especially by Ajax updates) and that is why the source does not reflect it. If you want to see much more closely what is going on in the page, download and install the IE Developer Toolbar (or another browser DOM viewer). This will show the current DOM and you may in fact find that the Id you are looking for is either not there or it is set as a ClientID (a property of most controls) which does not match the original ID. This would be true for instance of any ordinary control in a tab panel. They will not have the same ID you assigned on the server. As well any control in a repeating control will be assigned a new client id.

AFAIAC every develper that develops without a tool that can see the DOM as it exists is working blind. As a bonus, the IE Developer Toolbar has the ability to modify styles on the fly so you can see what they do, trace styles and a few other things.