Showing posts with label variable. Show all posts
Showing posts with label variable. Show all posts

Monday, March 26, 2012

Certain events not firing on server (but they are in dev)

I have a small web app that uses an update panel. Its asyncpostback event fires and updates a session variable. In the process, the pageload event fires and repopulates the elements within my update panel. This works in my dev environment, but doesn't work when I publish the site to my website.

The session variable is updated like it should via asyncpostback, but the pageload event isn't fired. Thus my chart within the updatepanel isn't redrawn. I have ajax installed on the server and the appropriate dll's are in the bin folder.

Any idea why this is happening?

The only thing I can think of is there are differences in your web.config file.


The web.config goes along with the publish (I've even manually copied the file over)


hello.

that is strange because the load event will always fire during a postback. have you tried hosting the app in IIS in your development environment?


Yeah I knew the web.config file went though with the Publish, but I wans't sure if you were using the Publish option in Visual Studio or if you were manually publishing it by copying the dll and aspx files. I had a few ideas as to what might be causing the problem but I keep throwing those ideas out because it is working in your test environment. At this point, I can only take guesses. I dont think AJAX.net is the problem because your session is getting updated aysnc. Since all the code is the same in both environments, that ww know of, I would next try to figure out what is different. Are the dll files different in any way, specifically the ajax dll's. Also try manually deploying the site. I have had some publshing problems with Visual Studio 2005 when publishing to ftp (The host I was using had users experieincing problems with the publish not publishing correctly.) Although the problem I and my host had was more to deal with Visual Studio stopming over some security permssions.. dont ask me how, it just did.


I have manually copied the files to the server as well (it is sitting right next to my desktop on the same domain).


hum...well, not sure on the response your chart is returning from the server. there shoudln't be any problems with it since you're seeing it work on the dev machine. anyway, how about using fiddler to see the response returned from the server ?


fiddler.. hmmm... thats a new one on me. I'll check it out.


it's an http proxy. really good to see the contents sent to and from the browser:

http://www.fiddlertool.com/


It is weird, Have you fixed it?


No, not yet. It's strange that the async call works but the page load isn't firing.

Cascasding Drop Down Page method custom variable

Hi

I have page method populating the first of my drop downs and the reason being is that i need a variable that will be specific to user.
Currently this is stored in the session...How can i use this variable in the Page Method that is static...I cant really use a static variable as they are shared between all users.

Thanks.

Steve

Hi Steve,

Unfortunately I don't know of a good way to do this anymore. When we first wrote CascadingDropDown page methods weren't required to be static so there was an easy solution. Could you create a work item on CodePlex for this? Perhaps we could modify the web service signature to include optional tag info.

Thanks,
Ted

AAAAAHHHHH!!!!!

Well i have found a solution that works for me and may well for others.....
I have a web method that has Sessions enabled that i can call to get the value from...of course this method cannot be on the page as Sessions arent static.

[

WebMethod(EnableSession =true)]
publicCascadingDropDownNameValue[] GetDivisionsBySessionIdAccount(string knownCategoryValues,string category)
{
SessionCollection oSC; if (Session["UserObj"] !=null) {
oSC = (SessionCollection)Session["UserObj"];
// Calling another method to get my array - the same one i used from the page method.
CascadingDropDownNameValue[] retArray = GetDivisionsByIdAccount(oSC.idAccount);
return retArray;
}
else {
thrownewException("Your Session Has Expired");
}
}

I have created a work item number7579 for this.

---

I have just updated to the release toolkit and now my CCDD have stopped working! The top drop down loads fine from the method above but none of the others below. I have a debug error in jsSys.Debug is null or not an object.??

ARGH!


Here's more on the typical cause of Sys.Debug is null:http://forums.asp.net/thread/1546990.aspx

Saturday, March 24, 2012

CascadingDropDown SelectedValue

Is there a way to set this to a variable such as a Session variable, or must this value be known at compile time? Thanks!

Michael LaneI found the answer indirectly in the FAQ. This works:

CascadingDropDown1.TargetProperties[0].SelectedValue = "1";