|
Hello everybody.
These days I was looking at Ajax.NET[^]. This is a library that is used to call .NET methods from JavaScript. What impressed me so muck was how .NET types are mapped to JavaScript objects. Take a look at the following code:
[Serializable]
public class Person
{
public string FirstName;
public string FamilyName;
public int Age = 0;
public Person NewChild()
{
Person p = new Person();
p.FamilyName = FamilyName;
return p;
}
public Person[] Children = null;
} And the JavaScript part of the code:
function test12_callback(res)
{
var s = res.value.FirstName + " " + res.value.FamilyName + ":\r\n";
for(var i=0; i<res.value.Children.length; i++)
s += "\t" + res.value.Children[i].FirstName + "\r\n";
alert(s);
} How is this achieved? Is it also possible to map a PHP type to a JavaScript object? Can I create a JavaScript object using a simple XML document?
Thank you,
Stanimir.
|
|
|
|
|
when using iis i have a virtual directory with my project file it work but when i rename the virtual directory to what i wnat it called it wont work, ive tried iisreset and rebooting, it works for every other name but the name i want to be called is there anyone that ever had similar problems????
|
|
|
|
|
Try to create a new virtual directory with that name instead of renaming one.
---
b { font-weight: normal; }
|
|
|
|
|
I´m trying to read about usability but I find no much resources.
I whant to read something about usability on web and desktop applications.
If somebody know about good articles, I´ll be pleased.
Thanks.
|
|
|
|
|
google for the god:
Jakob Nielsen
|
|
|
|
|
Trenton Moss is web usability guru Search for his articles...
David
|
|
|
|
|
Hi,
I would be greatful if I could get some help regarding the following:
I'm a newbie at WebServices and I'm just setting up a simple service to get my feet web.
I used MS' web servive walkthrough as a template:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vsent7/html/vbwlkWalkthroughBuildingWebServiceWithManagedCode.asp
So, when I run the service as they say to set it up, it works fine; returns the temp conversion as expected.
However when I add some Process code to the main method, like this:
// C#
[WebMethod(Description="This method converts a temperature in " +
"degrees Fahrenheit to a temperature in degrees Celsius.")]
public double ConvertTemperature(double dFahrenheit)
{
using (Process proc1=new Process())
{
proc1.StartInfo.FileName = @"c:\folder1\folder2\testapp.exe";
proc1.start();
}
return ((dFahrenheit - 32) * 5) / 9;
}
All the testapp.exe does is create a file locally. This test app works on its own.
So when I run this, nothing happens, the testapp doesn't run and the temp isn't returned. When I tweaked it some more, the app still didn't run and IE kept coming back with a page not found because the name of the method was being appended to the end of the URL, and that obviously doesn't exit.
So, does anyone know why this is not working as expected, am I missing something? It looks simple enough and I am running this straight on the server itself.
Any help is appreciated, thank you!
--PhB.
PhrankBooth
|
|
|
|
|
The account running the web service will need permission to execute the file. It also needs permission to create a file in the folder.
---
b { font-weight: normal; }
|
|
|
|
|
Is there a way to programmatically have a select box expand its list of options? If so, how do we do this?
Thanks
|
|
|
|
|
No. How the selection is done in a select box is beyond the scope of html and javascript. To have the options expand to a list is the most common way it's implemented in browsers, but there is nothing that says it has to be done that way.
---
b { font-weight: normal; }
|
|
|
|
|
Hi All,
This might be a really silly question but I have never attempted anything like this before, so please bare with me.
We are trying to create a web page that will take input data from a few fields (e.g. text boxes, drop down lists, ...) and write them to in a file format (e.g. XML, excel, ...) on the server.
Seeing that we have never done anything like this before, can anyone suggest how to this in the simplest manner or where to start looking?
(btw, we don't have .NET and the company won't spring for that kind of expense (we have VC6 though))
regards,
Rich
"Programming today is a race between software engineers striving to build bigger and
better idiot-proff programs, and the Universe trying to produce bigger and better idiots.
So far the Universe is winning." -- Rich Cook
|
|
|
|
|
|
I would suggest tou write an html page that contains a form for the data you want to collect. When the form is submitted you need to process it in one of two ways:
1. You could use whatever server-side scripting language you have on the server to write directly to the file.
2. You could save the data to a database and then produce the file from there on a regular basis, again using the scripting language you have installed.
If you have no scripting language and you need to get up to speed with minimal cost i would suggest PHP. It totally depends on what server you are running etc etc, and how much traffic / data you need to process.
HTH
|
|
|
|
|
I created a simple web service that returns a dataset. It works fine when the service is on localhost. It properly accesses the database and returns a list of items. When the service is run on a server it returns nothing, no errors, just an empty dataset.
I have looked at the iis and the folder that contains the service is virtual and it is setup to support applications.
This is what is returned from the 'invoke' button when running the service on the servers:
<?xml version="1.0" encoding="utf-8" ?>
- <DataSet xmlns="http://tempuri.org/">
- <xs:schema id="Order" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
- <xs:element name="Order" msdata:IsDataSet="true">
- <xs:complexType>
<xs:choice maxOccurs="unbounded" />
</xs:complexType>
</xs:element>
</xs:schema>
<diffgr:diffgram xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1" />
</DataSet>
It should contain the dataset within the xml. Any ideas?
Thanks in advance.
|
|
|
|
|
There is no obvious reason why the dataset would be returned differently just because it is run on a different computer. It is more likely that the dataset actually is empty, and that you should look for the error in the code that fetches the data instead.
---
b { font-weight: normal; }
|
|
|
|
|
It wasn't empty but the was a permission problem running it on the server. I would have expected that an exception would have been thrown but it just returned.
|
|
|
|
|
Yes, an exception should have been a result. This normally results in the exception being returned as a soap exception.
Do you have any code for catching exceptions that might have caught it and ignored it?
---
b { font-weight: normal; }
|
|
|
|
|
Could anyone tell me what do u mean by dynamic web page?????
|
|
|
|
|
Dynamic is a page that changes based on input from the user or information from a database. A normal HTML page is not dynamic. It is considered static because exactly what you write in the code will be displayed on the screen. ASP, PHP, and many other languages allow you to connect to a database and retrieve information based on what the user is looking for and "make up" a page right then. This is dynamic.
|
|
|
|
|
Hi, all
I am writing a script for protecting a website by password. Here are my script, but with some problems:
<SCRIPT LANGUAGE="JavaScript"><br />
<!-- Begin<br />
var password = prompt("Please Enter Password Here:")<br />
if (password == '123456') {<br />
}<br />
else {<br />
self.location = 'WrongPassword.htm'<br />
}<br />
</SCRIPT>
The problems are:
1. When I type in the website in the browser, it already loads all the content before it pops up the prompt to type the password, that means the protection is useless.
2. I have searched on web many different kinds of codes for password security. But, their codes usually divide into 2 parts, the head and the body parts. However, I can only have one column to enter the code. Therefore, I want to know what adjustments I need to make in the above code so that I can tackle the problem 1 stated above.
Thanks.
~~~Landy
|
|
|
|
|
Your password page should redirect to another page when the password test passes. The same as you redirect to WrongPassword.htm if it fails.
However, you're sending the password to the client, which makes the whole thing futile. Your password page should work on the server, should use the database for multiple passwords, and should call a stored procedure so your code does not reveal the layout of your database with regard to password information.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I tried this code in an asp page it works fine i entered the script in the body
|
|
|
|
|
is there a way i can display a image in a webform and have scroll bars to move the image inside the page i tried putting my image control in a panel hopeing that the panel would allow the image control to scroll but it did not work can somebody help me with this
Thanks'
chad
|
|
|
|
|
Your idea is right on track. All that is missing is to tell the browser how to handle that the contents is larger than the panel.
Set the css style overflow:scroll; on the panel.
---
b { font-weight: normal; }
|
|
|
|
|
I haven written modules that generates a series XML files and a report in a number of HTML files which include and index etc. What I am having difficulty with is that we would like to be able to click on the name of one of the XML files in the report and get the browser to pop up the Save As dialog, so that it can be copied to a location other than the default.
This must be possible. I just haven't found out how as yet.
Happy programming!!
|
|
|
|