FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister  MasterVB.NET
Visual Basic 2005 .NET Forum
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
Newbie, I am having some trouble with an apparently simple r
 
Post new topic   Reply to topic    MasterVB.NET Forum Index -> Web Forms
View previous topic :: View next topic  
Message
Author
barclaymichael
Newbie
Joined: 27 Jul 2006
Posts: 1

PostPosted: Thu Jul 27, 2006 4:00 am    
Post subject: Newbie, I am having some trouble with an apparently simple request
Reply with quote

Hello, thanks in advance for reading this. I was trying to do an excercise from a book I was reading (although i've striped away most of the code to find my unfindable problem) and have ended up with this:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>index</title>
<meta name="vs_defaultClientScript" content="JavaScript">
<meta name="vs_targetSchema"
content="http://schemas.microsoft.com/intellisense/ie5">
<meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
<meta name="ProgId" content="VisualStudio.HTML">
<meta name="Originator" content="Microsoft Visual Studio .NET 7.1">
<script language="javascript">

//

var XHRO = false;
var options;

if (window.XMLHttpRequest)
{
XHRO = new XMLHttpRequest();
} else if (window.ActiveXObject)
{
XHRO = new ActiveXObject("Microsoft.XMLHTTP");
}

function getOptions(scheme)
{
if(XHRO)
{
XHRO.open("POST", "postasp.aspx", true);
XHRO.setRequestHeader('ContentType',
'application/x-www-form-urlencoded; charset=utf-8');
XHRO.send('h=1');
XHRO.onreadystatechange = function()
{

if(XHRO.status == 200 && XHRO.readyState == 4)
{
alert(XHRO.responseText);
}
}


}

}

</script>
</head>
<body MS_POSITIONING="GridLayout">
<form ID="Form1">
<select size="1" id="optionList" onchange="setOption()"
NAME="optionList">
<option selected>Apreta el botón</option>
</select>
<input type="button" value="Aprétame" onclick="getOptions('1')"
ID="btn_ColorScheme1"
NAME="btn_ColorScheme1">
<br />
<br />
</form>
</body>
</html>
*************************************************************************
*************************************************************************
And this:

postasp.aspx
<%@ Page Language="VB" AutoEventWireup="false"
CodeFile="postasp.aspx.vb" Inherits="postasp" %>

postasp.aspx.vb

Partial Class postasp
Inherits System.Web.UI.Page

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

Response.ContentType = "text/xml"

If Request.Form("h") <> "" Then
Response.Write(Request.Form("h"))
Else
Response.Write("Nada")

End If


End Sub

End Class

Somehow it worked once on another pc, but i cant make it work here,
maybe its something obvious (i hope it is), but i am new to this
(disclaimer Razz) and have been troubled by this problem for about a week.

Thanks,
Michael B



 

Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    MasterVB.NET Forum Index -> Web Forms All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Archieve

Powered by phpBB © 2001, 2002 phpBB Group, used in Visual Basic 2005 .NET Forum

| Visual Basic .NET Forum | Online Recipe Archiver | Shareware Freeware PAD | Lowongan Kerja | Kamus Online | Health Supply | Digital Camera Review |
Orang Paling Keren

RSS