OlympicTelecom
پنج شنبه 08 آذر 1386, 18:36 عصر
سلام دوستان:
من می خواهم اطلاعاتی را با queyString به یک صفحه ارسال کنم مثلا
Default.aspx?User=ali
حالا اون صفحه فرضا یک OK را چاپ می کنه یعنی UserName رو دریافت می کنه و بعد با Response.Write یک OK چاپ می کنه!
حالا من چطور به اون OK دسترسی داشته باشم توی صفحه مبدا!!
با آژاکس تونستم بوسیله جاوا اسکریپت OK رو بگیرم ولی چند تا مشکل دارم اول اینکه صفحه مقصد مال یک سایت دیگه است و IE یک اخطار میده که حتما باید OK کنی اش و الا عملیات انجام نمیشه که من نمی خوام اینجوری باشه ، دوم هم وقتی OK را با جاوا اسکریپت می گیرم نمی دونم چطور توی برنامه ازش استفاده کنم !!؟؟ من با اینا رو نوشتم با آژاکس :
<script language="javascript">
var xmlhttp=null;
function Create(){
if (window.ActiveXObject){
xmlhttp = new ActiveXObject('Microsoft.XMLHTTP');
}else{
xmlhttp = new XMLHttpRequest();
}
return xmlhttp;
}
function GetStr(){
Create();
xmlhttp.open('GET','default.aspx?username=ali',tru e);
xmlhttp.onreadystatechange = update;
xmlhttp.send(null);
}
function update(){
if (xmlhttp.readyState == 4){
if (xmlhttp.status == 200){
var message = xmlhttp.responseText;
document.getElementById("mdiv").innerHTML = message;
}else{
alert("Error");
}
}
}
</script>
اگر دقت کنید من با متغیر message چیزی رو که صفحه مقصد بر میگردونه گرفتم فقط موندم چطور ازش توی مثلا Page_Load برنامم استفاده کنم !!
خواهشا کمک کنید که موضوع ناموسی ! (سر کل کل)
من می خواهم اطلاعاتی را با queyString به یک صفحه ارسال کنم مثلا
Default.aspx?User=ali
حالا اون صفحه فرضا یک OK را چاپ می کنه یعنی UserName رو دریافت می کنه و بعد با Response.Write یک OK چاپ می کنه!
حالا من چطور به اون OK دسترسی داشته باشم توی صفحه مبدا!!
با آژاکس تونستم بوسیله جاوا اسکریپت OK رو بگیرم ولی چند تا مشکل دارم اول اینکه صفحه مقصد مال یک سایت دیگه است و IE یک اخطار میده که حتما باید OK کنی اش و الا عملیات انجام نمیشه که من نمی خوام اینجوری باشه ، دوم هم وقتی OK را با جاوا اسکریپت می گیرم نمی دونم چطور توی برنامه ازش استفاده کنم !!؟؟ من با اینا رو نوشتم با آژاکس :
<script language="javascript">
var xmlhttp=null;
function Create(){
if (window.ActiveXObject){
xmlhttp = new ActiveXObject('Microsoft.XMLHTTP');
}else{
xmlhttp = new XMLHttpRequest();
}
return xmlhttp;
}
function GetStr(){
Create();
xmlhttp.open('GET','default.aspx?username=ali',tru e);
xmlhttp.onreadystatechange = update;
xmlhttp.send(null);
}
function update(){
if (xmlhttp.readyState == 4){
if (xmlhttp.status == 200){
var message = xmlhttp.responseText;
document.getElementById("mdiv").innerHTML = message;
}else{
alert("Error");
}
}
}
</script>
اگر دقت کنید من با متغیر message چیزی رو که صفحه مقصد بر میگردونه گرفتم فقط موندم چطور ازش توی مثلا Page_Load برنامم استفاده کنم !!
خواهشا کمک کنید که موضوع ناموسی ! (سر کل کل)