You may have come across the situation where you are making a jQuery AJAX GET request to update part of your page with changing content, but it never updates or just returns blank content.
This issue has been around a long time, since first use of Ajax calls via XMLHTTP, but still causes headaches for people trying to debug the problem now.
What it actually comes down to is that the ‘Get’ call is working correctly, but Internet
Explorer (IE) caches the response, so you never get the updated results from the server.
What are the options:
I have always been a fan of Firefox and encouraged other developers to use it, addons such as Firebug and YSlow are simply essential tools for anything more than your most basic web page, and will even help with those. Neither the developer tools in Chrome, Safari or IE can really compete.
There certainly does seem to be an issue with the latest version of Firefox though regarding Continue reading
I wondered where my intellisense had gone for jQuery with MVC3 and Razor. Anyway there is a fix for it:
Add the following to your view (with the jQuery vsdoc version you have:
The if-statement prevents the script tag from being rendered into the html source code.
Grab jQuery 1.5.0 vsdoc from here -> http://damianedwards.com/files/jquery/jquery-1.5-vsdoc.js
I have bumped into this quite a few times. Every time I have it has turned out to be a path problem, always check this first.
If you can, stick a breakpoint on the save call and look at the path your are saving, follow the exact path and check it precisely using windows explorer.
Nasty problem. Lesson learnt.
I could not figure out why I was seeing this error, clearselection, setting index -1 etc, nothing worked when trying to set a dropdownlist selected value from code behind.
Turns out it was because I was adding a ListItem to multiple dropdownlists without instantiating a new one for each dropdownlist. This caused all the problems I was seeing.
For every Dropdownlist, create a new instance of the ListItem object before adding it – do not share it accross controls.
I had a bizzare problem. From a completely unrelated aspx page I was finding myself jumping into the page_load of my default.aspx page.
Turns out this was because I had an ‘<asp:image’ tag with the image url not set (rendered as src=””).
Tricky problem to identify.
I had a page which uses codebehind Page_Load and (!IsPostBack) to setup all the controls on the page depending on what was being loaded. This worked fine, apart from when I refreshed the page (F5) in Firefox 3.5 – IE was okay.
Firefox seems to retain all the input selections – eventhough from the code behind I was ressetting them.
The only way I found to resolve this was to call a reset on the form (actually in my Master page) in the document ready function of JQuery which solves the problem.
$(“#<%= (form1.ClientID) %>”).reset();
RadioButtons place on a page inside a repeating control (repeater/datalist/datagrid), you set the group but they are still all individually selectable.
I have come across this problem before, which was fixed using some client side script added to the radiobuttons, but this had to be done for each radiobutton group as I added them and was a bit of a pain.
I have recently found a much better solution here -> http://www.codeproject.com/KB/webforms/How_group_RButtons.aspx
Works perfectly well. Unstructions:
1) Just download the zip file at the top of the page.
2) Unzip and place the file (GroupRadioButton.dll) into your bin folder.
3) Add a reference to the assembly into your web.config or .aspx page as below:
<%@ Register TagPrefix=”vs” Namespace=”Vladsm.Web.UI.WebControls” Assembly=”GroupRadioButton” %>
Use the control on your page as you would a RadioButton
<vs:GroupRadioButton id=”MyRbn” runat=”server” GroupName=”MyRbnGrp” />
Thats it. Brilliant
Kudos to Vladimir Smirnov.
I have used 2 solutions for this, one is JQuery Live Query. You can use this to simply rebind to any item reloaded for example I used this to rebind the elements I had previously set for Slimbox and set the rel=lightbox attribute for them:
This finds any anchor element with the rel=”lightbox” tag and binds the slimbox function.
Alternativly to this you can replace the
// do stuff
function pageLoad(sender, args)
// do stuff
//Specific code for partial postbacks can go in here.
But be aware this can only be used once on the document, if you need to do this in multiple places use:
// do stuff
I had this problem where I wanted to attach my Visual Studio debugger to and already running website on local host.
From a bit of Googleing I found the process I needed to attach to was the IIS worker process called w3wp.exe, but this was not in my list. I noticed if I refreshed the site and then looked quickly in the process list it was there but then dissapeared shortly after – so a timeout I guessed.
This is what was happening, so I needed to stop it from timing out or at least delay it.
The answer was to change a setting in the applicaiton pool – ‘Shutdown Time Limit’.
– Goto IIS and find the website or application you want to modify.
– Click advanced settings to find the applicaiton pool it is using (or as I did create a new application pool and assign this website to use it)
– Goto your application pool list – selected advanced settings
– Change the ‘Shutdown Time Limit’ to something like 1000 (seconds) its default is 90
w3wp.exe should now hang around long enough to attach to it with the debugger