views:

1767

answers:

2

I'm trying to get string data from a web service and populate a thickbox with this data. I feel like this should be the easiest part of the task but so far this is where I'm stuck.

Here is the code in question...


function AjaxRequestHandler(layerName) {
    PageMethods.AjaxRequestHandler(layerName, OnSucceeded);
}

function OnSucceeded(result) {
    // need to display result to the thickbox here...
    alert(result);
}

If I alert as I have above, the text from result is exactly what I want to display in the thickbox. The thickbox also appears but everything I've tried just brings it up empty. My initial gut instinct was to do a document.write, but I can't do that because I get a permission denied error.

Any ideas?

EDIT: I should note that the link with the onclick event running the thickbox is being built up from C# code behind then injected into a GridView. I've tried doing something like what slf has suggested below, but it just shoves data below the link, not into the thickbox.

+1  A: 

The thickbox just displays the content that it wraps. I haven't tried it, but if you give the <a href and id="myupdatablecontent"> and then do something like this:

$("#myupdatablecontent").html("foo");

it should work like magic

slf
Hmm, thanks but no luck. It crashed at first one me saying the key (I'm assuming this is the id) was not present in the dictionary. It runs now but just shoves the results underneath the link and still gives a blank thickbox.
Carter
A: 
Carter
Glad to hear it! learned something new :)
slf