I wanted a solution that enabled me to allow the page I was doing the post on to be run through sitecores context. If you don't mind the page ignoring the context look at Mark Ursino answer it will work like a charm.
My answer does the following:
Javascript:
function MySuperCoolFunction() {
strUser1 = document.getElementById("Symbol1").innerHTML;
strUser2 = document.getElementById("Symbol2").innerHTML;
var join = strUser1 + "," + strUser2;
__doPostBack('upCurrencyCharts', join);
}
.ascx/.aspx:
// My Content Here
.cs:
protected void upCurrencyCharts_onload(object sender, EventArgs e)
{
string item1 = null;
string item2 = null;
if (IsPostBack)
{
string items = Request["__EVENTARGUMENT"];
string[] partsArray = items.Split(',');
for (int i = 0; i < partsArray.Length; i++)
{
if (i == 0)
{
item1 = partsArray[i];
}
if (i == 1)
{
item2 = partsArray[i];
}
}
}
// do something with item1 and 2 here.. in mycase feed to database.
The javascript forces a postback event on my update panel, and parses a string of parameters I am sending through to the backend of my website. Onload event triggers on postback and fires anything I do in my onload event in this case puts the items into an array to split them and then puts them into a database. Simples. Thanks everyone for there help in this. :D