PDA

View Full Version : _DoPostBack to new URL


suzannamari
01-09-2011, 11:01 PM
Hi,

I am building a website, for example called www.mySiteA.com I retrieve data from another website www.mySiteB.com and then want to post it back into my new site www.mySiteA.com using a _DoPostBack function.

The site B is already complete and I can not change any data, in A I have

<form name="form1" method="post"

action="http://mySiteB/Homes.aspx?tabid=163206"

language="javascript" onsubmit="javascript:return WebForm_OnSubmit();"

id="form1" class="aspnetform">
<input type="hidden" name="__EVENTTARGET" id="__EVENTTARGET" value="" />
<input type="hidden" name="__EVENTARGUMENT" id="__EVENTARGUMENT" value="" />


<script type="text/javascript">
<!--
var theForm = document.forms['form1'];
if (!theForm) {
theForm = document.form1;
}
function __doPostBack(eventTarget, eventArgument) {
if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
theForm.__EVENTTARGET.value = eventTarget;
theForm.__EVENTARGUMENT.value = eventArgument;
theForm.submit();
}
}
// -->
</script>

Then later on I have
<a href="javascript:__doPostBack('_ctl2$_ctl8$_ctl0$ct$4267662$4267662$lsp

$shortGrid$_ctl1$_ctl0$_ctl5','')">2</a>&nbsp;&nbsp;

This all works fine, except when I do the postback to retreive the asp for page 2 it won't work. So how do I get the postback function to put the data into my site???

Sorry if this is confusing, but any help would be great,

Thanks

Old Pedant
01-10-2011, 08:44 PM
Wrong forum. This belongs in the ASP.NET forum, not the ASP forum.