.NET, calling an AJAX postback from JS

Associate
Joined
28 Nov 2004
Posts
1,237
Location
Birmingham
Hi all,
I have an address user control on my page. Part of this control is an AJAX driven drill down list of country, region, location selectors.

On my page I have 2 instances of my control - one for postal address, one for billing.
This means I'm using a function to copy one address to the other using JavaScript if they are the same. Pretty standard feature. The only problem is, I need to trigger my drill down's callback to get the next level when I copy the value over. How can I do this using the code below???

Code:
[SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]string[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] MyScript = [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"<script type='text/javascript'>"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2];
MyScript += [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"function copyAddress() { "[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2];
[/SIZE][SIZE=2]MyScript += [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]" document.getElementById('"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] + address2.countryClientID + [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"').selectedIndex=document.getElementById('"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] + address1.countryClientID + [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"').selectedIndex;"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2];
MyScript += [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"}"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2];
MyScript += [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"</script>"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2];[/SIZE]
[SIZE=2]ClientScript.RegisterClientScriptBlock([/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]this[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2].GetType(), [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"copyAddress"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2], MyScript);
[/SIZE]
 
Back
Top Bottom