473,320 Members | 1,858 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,320 software developers and data experts.

Calling aspx page from htm file

Hi,
I am trying to call an aspx page from an htm file.
I have written something like this in my htm file

<script src="Test.aspx"></script?

The Test.aspx page should call a javascript function and should show an
alert.

How can i acheive it. If I call the aspx file directly it works as
expected but not from htm file.

I tried using <img src="Test.aspx"but again no luck.

Any help, appreciated.

Sep 6 '06 #1
2 2213
Hi,

Ravi wrote:
Hi,
I am trying to call an aspx page from an htm file.
I have written something like this in my htm file

<script src="Test.aspx"></script?

The Test.aspx page should call a javascript function and should show an
alert.

How can i acheive it. If I call the aspx file directly it works as
expected but not from htm file.

I tried using <img src="Test.aspx"but again no luck.

Any help, appreciated.
You need to understand how the web works. The server and the clients are
two totally different worlds, they run in different processes, under
different conditions, often on different machines.

The only thing that the server can do is send some text (and in some
cases binary files) to the client. How this text is executed is purely a
client-side matter, and the server has no idea what will happen to that
text.

In your first example, if the page Test.aspx delivers JavaScript code
(which is nothing else than text to the server), and if it delivers it
with the correct MIME type, then the browser will attempt to interprete
the script. What action it takes after that totally depends on what
script code you send back to the client. It is absolutely impossible
that the "Test.aspx page should call a javascript function and should
show an alert", because the server just sends text back to the client.
From the client's point of view, what happens here is exactly the same
than if you had set Test.js in the SRC instead of Test.aspx.

In other words, it is impossible to help you without seeing the output
of the Test.aspx page, without making sure that the MIME types are set
correctly, and without knowing more about the rest of your client-side code.

The second example worries me, because it makes no sense at all. What
kind of effect do you expect by passing some text data to an object
which expects a binary output?

HTH,
Laurent
--
Laurent Bugnion, GalaSoft
Software engineering: http://www.galasoft-LB.ch
PhotoAlbum: http://www.galasoft-LB.ch/pictures
Support children in Calcutta: http://www.calcutta-espoir.ch
Sep 6 '06 #2
as long as the asp file only returns javascript code (no html) it should
work.
<@ Page language="C#">
alert('hi');

the above page should work

-- bruce (sqlwork.com)

"Ravi" <hk*******@gmail.comwrote in message
news:11*********************@e3g2000cwe.googlegrou ps.com...
Hi,
I am trying to call an aspx page from an htm file.
I have written something like this in my htm file

<script src="Test.aspx"></script?

The Test.aspx page should call a javascript function and should show an
alert.

How can i acheive it. If I call the aspx file directly it works as
expected but not from htm file.

I tried using <img src="Test.aspx"but again no luck.

Any help, appreciated.

Sep 6 '06 #3

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

Similar topics

2
by: Christopher Ambler | last post by:
I'm wondering if there's a solution here - I have an ASPX page with a sole purpose of scaling an image. The ASPX page contains a single line with the codebehind tag, and the .cs file contains...
2
by: anoop | last post by:
Hello, I created a Public class in .aspx.vb code behind file, now I want to know can I call that functions in the class in the Scripts either client side or server side in .aspx page. also I want...
6
by: johnf401 | last post by:
I've got a VB .NET Web application that has several frames (for discussion sake, let's call them Form1.aspx and Form2.aspx). I want to be able to call a code module in Form2.aspx.vb from code...
3
by: Mike | last post by:
Timeout Calling Web Service I am calling a .NET 1.1 web service from an aspx page. The web service can take several minutes to complete its tasks before returning a message to the aspx page. ...
2
by: kbutterly | last post by:
Good afternoon, I have what appears to be a caching issue, but i'm a bit of a newbie at http headers so it may be something else. I have a small asp.net 2.0 application that is called to serve...
3
by: Shawn T | last post by:
I have an application with a page that has a web user control When I call that page that has this user control, locally (http:// localhost/ApplicationX/default.aspx) and also externally ie...
1
by: DevNll2002 | last post by:
Can it be done? ( This is a related issue to my recent post... http://groups.google.com/group/microsoft.public.dotnet.framework.aspnet/browse_thread/thread/a229a66642bedfaf/870614ae257ae699...
7
by: =?Utf-8?B?UVNJRGV2ZWxvcGVy?= | last post by:
I have a C# logging assembly with a static constructor and methods that is called from another C# Assembly that is used as a COM interface for a VB6 Application. Ideally I need to build a file...
8
by: Derek Hart | last post by:
I am unclear about what all the requirements are to call a simple vb.net application, installed in the GAC, from COM (such as writing vba in Word to call the dotnet dll). I believe I have...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.