473,387 Members | 3,821 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

AJAX (javascript help) - ASP.NET(C#)

Please if someone can help me !!!

I need client and server code(principle based on AJAX) for next problem:

i have 3 <select> tags on html page.(it must be NO page reload(callback)
only select(controles) regeneration !!!)
In the first <select> goes countries, which must be pulled from some kind
of database (whichever you want).
after that if i select some country, second <select> must be filled with
regions of that country, and when i select some region than third <select>
must be filled with cities from that region.

conclusion: i need javascript code for html document and server .net code
which returns data based on xmlhttp request object which i send to him.

comment: please don't send links to other sites which has some solution
based on .net wrappers, or php/JAVA code !!! It's doesn't help me - I need
exactly what i wrote.
Thank you !
Nov 19 '05 #1
6 2409
Read Karl Seguin's comprehensive article on Ajax.Net,
which was just published. There's sample code in it.

http://msdn.microsoft.com/library/de...SpicedAjax.asp


Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
"Trip" <se****@hotmail.com> wrote in message
news:ou**************************@40tude.net...
Please if someone can help me !!!

I need client and server code(principle based on AJAX) for next problem:

i have 3 <select> tags on html page.(it must be NO page reload(callback)
only select(controles) regeneration !!!)
In the first <select> goes countries, which must be pulled from some kind
of database (whichever you want).
after that if i select some country, second <select> must be filled with
regions of that country, and when i select some region than third <select>
must be filled with cities from that region.

conclusion: i need javascript code for html document and server .net code
which returns data based on xmlhttp request object which i send to him.

comment: please don't send links to other sites which has some solution
based on .net wrappers, or php/JAVA code !!! It's doesn't help me - I need
exactly what i wrote.
Thank you !

Nov 19 '05 #2
Just 'Skim-Read' that article and it looks like a good one. I must try it
out when I get a chance as it seems as if this is gaining popularity given
the number of AJAX related posts and references which I've seen around of
late.

Regards - Mr N . . .
"Juan T. Llibre" <no***********@nowhere.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
Read Karl Seguin's comprehensive article on Ajax.Net,
which was just published. There's sample code in it.

http://msdn.microsoft.com/library/de...SpicedAjax.asp


Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
"Trip" <se****@hotmail.com> wrote in message
news:ou**************************@40tude.net...
Please if someone can help me !!!

I need client and server code(principle based on AJAX) for next problem:

i have 3 <select> tags on html page.(it must be NO page reload(callback)
only select(controles) regeneration !!!)
In the first <select> goes countries, which must be pulled from some kind
of database (whichever you want).
after that if i select some country, second <select> must be filled with
regions of that country, and when i select some region than third
<select>
must be filled with cities from that region.

conclusion: i need javascript code for html document and server .net code
which returns data based on xmlhttp request object which i send to him.

comment: please don't send links to other sites which has some solution
based on .net wrappers, or php/JAVA code !!! It's doesn't help me - I
need
exactly what i wrote.
Thank you !


Nov 19 '05 #3
article is good, and i already almost solve my problem with AJAX.NET
wrapper when my boss says that I MUST manualy write javascript and server
code. he doesn't want wrapper. stupid, but.. he is boss.
On Sun, 2 Oct 2005 11:36:52 -0400, Juan T. Llibre wrote:
Read Karl Seguin's comprehensive article on Ajax.Net,
which was just published. There's sample code in it.

http://msdn.microsoft.com/library/de...SpicedAjax.asp


Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
"Trip" <se****@hotmail.com> wrote in message
news:ou**************************@40tude.net...

Nov 19 '05 #4
Well there is no way I am going to write your entire solution for you, so
here is some code to make an async call using the XmlHttpRequest object so
that you can write all your own routines. The rest of the stuff like filling
in the list data, I am sure you will be able to work out.

function MakeXMLHTTPCall()
{
var xmlHttpObj = new ActiveXObject("Microsoft.XMLHTTP");
if (xmlHttpObj != null)
{
xmlHttpObj.Open("GET",http://YourServer/YourServerPage.aspx, true);

// Assign a function to be used as the callback to be called when the
async call is complete.
xmlHttpObj.onreadystatechange = function()
{
if ( xmlHttpObj.readyState == 4 )
{
alert("Your request has completed its async operation. Your data
returned was " + xmlHttpObj.responseXML);
// Or you can use the responseText property
alert("Your request has completed its async operation. Your data
returned was " + xmlHttpObj.responseText);
}
}
xmlHttpObj.send(SomeArgument); // This can be null if no arguments are
required.
}
}

This will asynchronously request the output of the "YourServerPage.aspx"
page and return it to the function defined here for your manipulation. This
would be where you fill the listbox/dropdowns based on return data.
--
- Paul Glavich
MVP ASP.NET
http://weblogs.asp.net/pglavich
ASPInsiders member - http://www.aspinsiders.com
"Trip" <se****@hotmail.com> wrote in message
news:2r****************************@40tude.net...
article is good, and i already almost solve my problem with AJAX.NET
wrapper when my boss says that I MUST manualy write javascript and server
code. he doesn't want wrapper. stupid, but.. he is boss.
On Sun, 2 Oct 2005 11:36:52 -0400, Juan T. Llibre wrote:
Read Karl Seguin's comprehensive article on Ajax.Net,
which was just published. There's sample code in it.

http://msdn.microsoft.com/library/de...SpicedAjax.asp


Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
"Trip" <se****@hotmail.com> wrote in message
news:ou**************************@40tude.net...

Nov 19 '05 #5
Thank you. This is what i need..

again thank you!
On Sun, 2 Oct 2005 22:23:25 -0700, Paul Glavich [MVP ASP.NET] wrote:
Well there is no way I am going to write your entire solution for you, so
here is some code to make an async call using the XmlHttpRequest object so
that you can write all your own routines. The rest of the stuff like filling
in the list data, I am sure you will be able to work out.

function MakeXMLHTTPCall()
{
var xmlHttpObj = new ActiveXObject("Microsoft.XMLHTTP");
if (xmlHttpObj != null)
{
xmlHttpObj.Open("GET",http://YourServer/YourServerPage.aspx, true);

// Assign a function to be used as the callback to be called when the
async call is complete.
xmlHttpObj.onreadystatechange = function()
{
if ( xmlHttpObj.readyState == 4 )
{
alert("Your request has completed its async operation. Your data
returned was " + xmlHttpObj.responseXML);
// Or you can use the responseText property
alert("Your request has completed its async operation. Your data
returned was " + xmlHttpObj.responseText);
}
}
xmlHttpObj.send(SomeArgument); // This can be null if no arguments are
required.
}
}

This will asynchronously request the output of the "YourServerPage.aspx"
page and return it to the function defined here for your manipulation. This
would be where you fill the listbox/dropdowns based on return data.

Nov 19 '05 #6
This solution will work in I.E. However if you are concerned about
Safari or Mozilla browsers you need to to get the XMLHttpObject a
different way. Its useful to write a wrapper factory function and then
access it when you need the object:

// Cross-Browser support factory function
function getHTTPObject() {
if (window.XMLHttpRequest) {
return new XMLHttpRequest();
}
else if (window.ActiveXObject) {
return new ActiveXObject("Microsoft.XMLHTTP");
}
}

// Usage
var HTTP = getHTTPObject();

Regards,

Larry

Nov 19 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: Yarco | last post by:
I want to use "Ajax" to create my web for hobby. But i don't know whether "Ajax" is mature... And what about with php? Someone have experience on it? ....
4
by: Trip | last post by:
Please if someone can help me !!! I need client and server code(principle based on AJAX) for next problem: i have 3 <select> tags on html page.(it must be NO page reload(callback) only...
4
by: bobzimuta | last post by:
I'm creating a simple AJAX library. It's an object that will return an array containing the response text or xml. I'm trying to find a way to assign the response as a property of the object, but...
31
by: Tony | last post by:
I just noticed that prototype.js is one of the files in the Ajax.NET distribution - I'm pretty concerned about this. Does anyone know if this is the same "prototype.js" that is not well-liked...
2
by: Nathan Sokalski | last post by:
I am moving my website from my machine to my webhost, and need some help with what extra files I need to include due to the fact that I used AJAX in my site. Everything on the site is obviously...
10
by: paulie | last post by:
Hi, I have been experiencing an issue when trying to use AJAX to reload a DIV area using a timer of 2000ms, which contains a html page with another DIV and javascript. Scenario -------------...
4
by: Peter | last post by:
ASP.NET I have an application which use ASP.NET Autocomplete extender which works great. But I have a question how to update all the fields on the screen using Ajax. Users starts typing in a...
3
by: NetWave | last post by:
Hi, For my next project I'm going to need Ajax, so I'm in about to read some books on ASP.NET Ajax. While reading Rick Strahl's blog I stumbled upon jQuery. I've been to the website and seen...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.