C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Forums » .NET » ASP.NET »

What is wrong with this code?


Posted Date: 17 Oct 2008      Posted By: Cathrin      Member Level: Gold     Points: 1   Responses: 1



Hi all,
Could you tell me what is wrong with this code?
I am not able to get the responsetext from the GetQuestion.aspx....
<input id="txtEmployeeId" type="text" onblur="getAnswer()"/>
Following Script is in MasterPage
function getAnswer()
{
alert("getAnswer");
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
xmlhttp.onreadystachange=question();
xmlhttp.open("GET","GetQuestion.aspx",true);
xmlhttp.send(null);
}
function question()
{
alert("Question");
if(xmlhttp.readyState==4)
{
document.getElementById("txtQuestion").innerHTML= xmlhttp.responseText;
}
}


GetQuestion.aspx

protected string Page_Load(object sender, EventArgs e)
{
TextBox1.Text = "Success";
Response.Write("Success");
Response.End();
string result ="Success";
return result;
}






Responses

Author: Pavan Ravi    17 Oct 2008Member Level: GoldRating: 1 out of 5     Points: 1

see the function ends here ...

function getAnswer()
{
alert("getAnswer");
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
xmlhttp.onreadystachange=question();
xmlhttp.open("GET","GetQuestion.aspx",true);
xmlhttp.send(null);
}

it just create a xmlhttp object only .... the rest is id another function ....

Regards,
Pavan Ravi Kumar.

"Complex problems have simple, easy to understand wrong answers."
Ravi's Blog



Post Reply

 This thread is locked for new responses. Please post your comments and questions as a separate thread.
If required, refer to the URL of this page in your new post.


Next : plz telme any
Previous : disable title bar in child window
Return to Discussion Forum
Post New Message
Category: ASP.NET

Related Messages



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use