Showing posts with label app. Show all posts
Showing posts with label app. Show all posts

Wednesday, March 28, 2012

Updated to latest release - profile now broken

I just upgraded my web application to the latest release of Ajax and now the app hangs on the login. I paused the code and it is hanging on getting a profile property. I even tried creating an entierly new membership database and it still does the same thing. The Website Configuration Tool still connects to the membership database, so I know its not a problem with the users or roles. Any help would be greatly appreciated.

MORE INFO -

When I pause the app, it always stops on one of two lines:

The first is in a generated code file -

ReturnCType(Me.GetPropertyValue("LastName"),String)

This is what lead me to believe it is a profile issue - this generated code file has all of my profile properties in it. When I set a watch on Me.getPropertyValue("LastName"), its value is "Cannot evaluate expression because we are stopped in a place where garbage collection is impossible...etc"

If I start running and then pause again, it stops on a line that begins:

IfNotMy.User.IsInRole("Administration")

So, naturally I set a watch on My.User - which yields a value of "error: cannot obtain value"

I have NO IDEA what to do next? Anybody?

We upgraded to the latest version of the toolkit a few days ago, and now are seeing a lot of things either not working, or working sometimes and sometimes not. I almost suspect there is a problem in this version, but I cannot find the old version to go back to...

TIA,

Bill


Figured it out...had an error infinite loop going. Had nothing to do with membership.

Saturday, March 24, 2012

UpdatePanel and __doPostBack

My app loads one of several dynamically generated reports, implemented as user Controls, (*.ascx files) into an Update Panel. I am trying to do this without a page postback. However, client side code needs to validate several things before issuing the asynchronous request. In IE, I was using an ASP.Net custom Validator control hooked to a client side script
(GenerateReport(sender, e) {...}
to control this, (usinge.valid = true/false; to control whether the asynchronous request to update the content in the UpdatePanel was sent or not, but I have discovered that Firefox does not implement ASP.Net Validators properly.

So now I am trying to accomplish the same functionality simply using a client side script that calls __doPostBack(eventTarget, eventArgs);
But I can't seem to get the __doPostBack to call the Microsoft AJAX asynhcronous call, instead of doing a complete page postback.

How do I do that? Or is there a better way to do this.

Another option I have considered is to put the user control into a web service, that somehow just returns the innerHTML of the user5 control rendering process, but I can;t seem to figure that out either..

ideas anyone?

I've been fighting the same problem the last couple of days. Here is what I just finally came up with...

I write the __doPostBack on the server side and insert it into an onClick event on a control.

String sOnClick

="__doPostBack('" +this.UpdatePanel1.UniqueID +"','eventarg1$eventarg2');"; // the Update Panel's UniqueID will call the asynchronous request and pass the event argument string

e.Row.Attributes.Add("onClick",sOnClick); // I'm adding this to a gridview, I'm guessing this will work elsewhere too.

Then in the Page_Load I parse the event arguments and call the appropriate function

StringsEventArguments =this.Request.Params["__EVENTARGUMENT"];if(sEventArguments !=null)

{

Int32iDelimiter =sEventArguments.IndexOf('$');

StringsArgument =sEventArguments.Substring(iDelimiter + 1);

if (sEventArguments.StartsWith("eventarg1")) EventFunction(sArgument);

}

I hope this helps.

G


You canuse __doPostBack() to refresh an UpdatePanel, if you target the UpdatePanel itself.

UpdatePanel and control state

Greetings,

I am currently working on my place of employments first .NET 2.0 enterprise app, and we are toying with the idea of implementing Atlas. From my first run through, it seems quite powerful, but I have either found a limitation or a problem that I hoped I could receive guidance on.

I have an update panel that contains nothing more than a label inside. Upon clicking a linkbutton, I display a ModalPopUp, with two server side buttons. Upon clicking the OK button, I am making a trip to my code behind, and populating the label with the text "OK". Herein lies the issue.

If I enable partial rendering and refresh the screen, voila, the label is now empty. If partial rendering is disabled and I refresh the screen, the control maintains state as it was a classic styled postback.

Any guidance on how I can keep the state of my controls using partial rendering, as this page I am working on will contain numerous post backs similar to this, and can't rely on the fact that a user will not ever refresh the page, thus losing everything?

All in all though, Atlas looks pretty cool.

Thanks,
Ryan

hello.

can you show us a very simple page that reproduces this issue?