C++/VB - ASP function question.

Asked By Marian Henna
05-Feb-10 09:22 PM
I hope I am in the right spot. Our developer moved this week and we have a
small problem. We have an app that uses asp pages to update a database. They
work fine and there is no problem there.

What we now need to do is to place the return value from one of these asp
functions in an htm page. So I guess I have two questions:
1) how do we include the reference to the asp page in our html page? We've
tried this: <!--#include file="path to file/our-asp-file.asp"-->. That
does not seem to work,
2) How to call the function from an htm page. I suppose that it is dependant
on #1 above working.

Admittedly I am not upto speed on this, used to be but more into management
now. If we have to, we can wait until we hire a replacement, but that
process can take a few weeks, and we need something sooner than later.

Hope someone can help.

Thanks.

Marian
Outlook
(1)
Linux
(1)
SendHTTP
(1)
ASP.NET
(1)
IIS
(1)
Response.Write
(1)
InnerHTML
(1)
Database
(1)
  Al Dunbar replied to Marian Henna
06-Feb-10 02:05 AM
the include directive allows the content of one ASP file to be inserted into
another. It is an ASP construct, not an HTML one.


I don`t think that client-side script actually can call script stored in an
ASP file. The scope of the client-side script is what is seen in the
browser. html code generated by script in an ASP file can be viewed in the
browser and processed by client-side script.


Rather than explaining how you want to accomplish what it is you want to
accomplish, perhaps you could explain what it is you want to accomplish, as
there still might be a way to do that.

/Al
  mayayana replied to Marian Henna
06-Feb-10 10:40 AM
Microsoft has a number of ASP groups. You
appear to be using Outlook Express. In that case
you can check the list with the menu bar Newsgroups
button. Search the msnews server for "asp". It
should turn up 15-20 groups.
  Dave \Crash\ Dummy replied to Marian Henna
06-Feb-10 11:14 AM
This is not the sort of question that can be answered in 25 words or
less, but I will give it my best shot. The way to put the result of a
server side ASP script in a client side HTML file is to have the HTML
page included in the ASP page and include the results of the ASP
function within it. A simple(minded) example:

--------------------------page.asp---------------------------------
var1=somefunction()
%>
-----------------------------------------------------------------------

When this is loaded by a browser from the server, the server side script
is run computes "var1,"  which is then included in the HTML page before
it is sent to the browser. The only thing the browser will see is the
HTML section with the value filled in. For example, if "var1" resolves
to 99, then the browser will see:


If you want to enter variables to be computed from the browser, they
will have to be submitted in a form, processed on the server, and resent
to the browser as a new page.
--
Crash

Committed to the search for intraterrestrial intelligence.
  Hz replied to Marian Henna
06-Feb-10 02:38 PM
You're going the wrong way around trying to call an ASP page from a HTML
page. Make a ASP page do what you want it to do and output the result,
if you want a result.

--
.::[ Hz ]::.
  Marian Henna replied to Al Dunbar
06-Feb-10 02:56 PM
Thanks for the reply al. Here (in a nutshell) is what we have and what we
need:

1) Over the years, we developed an app for an Oil and Gas marketing company.
Essentially they sell gas pipeline data to such orgs as Communities, Cities
Governments etc. As a requirement of access to this data, it is important
that the visitor (ultimately the client login) is tracked at every step.
They first hit a Login Page (tracked) then they are sent to a Validation
Page (tracked), then ultimately to the Pricing/Buying/Selling areas,
2) During this login/validation process, they get a cookies (it contains IP,
reverse DNS lookup data and some other items that are hashed) at every step
(security requirements dictate that we must track every step for Government
Reporting purposes),
3) The user will have a random number of login attempts (from 2-5). They do
not ever know how many attempts they have. This changes every time a user
(new or existing session) hits the login or validate pages. This is in case
they use the Back/Forward buttons,
4) Once they have logged in, the data that is stored in cookie(s) is put into
a DB, the cookie(s) is/are recreated with garbage data, then removed.

So the end result we need (and was supposed to have been built) is the
following (this is for Management Purposes):
1) Good morning/afternoon etc Bob,
2) You have logged in: X times,
3) There have been: X Total logins.

We know that there is some asp on this site, becuase we populate the DB. We
also have an asp page the does retrieve the data from the db and generates a
very basic page with the above data. But we need it to be displayed in the
HTML page for the currenly logged in Management type.

Now the difficult part, the site uses HTML to render everything to the
client (no asp pages except for the db inserts/updates and as mentioned
above). One of the reasons is that some of our clients have remote sites
(Nunavit, Bahamas, Nigeria etc - pretty much anywhere). So we cannot dictate
what desktop technology they must use. In fact some still use Windows
98SE/ME (I.E. 5 in some cases), some use Linux deriviates, some use Macs
etc. Thus (I beleive) the reason for the site using all HTML pages with no
scripting tech except where absolutely required.

I am thinking (from what I am finding) that this is probably not possible
without using the code in ASP/PHP pages etc. The powers that be in the white
towers are old school at it is going to take time to convince them that
newer technologies are better suited to what we need, but alas that will
take time and we still have to remember the client side technologies
available.

Sorry for rambling, but I am trying to give everyone as best a picture of
what is required without (hopefully) plugging this up with tons of posts.

Thanks again,

Marian
  Marian Henna replied to mayayana
06-Feb-10 02:57 PM
Thank you mayayana. I did this prior to the post, but many of them are .NET
or other language areas.

Marian
  Marian Henna replied to Dave \Crash\ Dummy
06-Feb-10 03:01 PM
Dave, please see my first reply. I understand that ASP (as you outline) does
the trick, but we cannot do this (see my post). So we need the results from
the ASP page to be populated into an HTML page that already exists.
Basically, we cannot change the underlying pages from HTML to ASP on this
site.

I do however have one question. When I did this (similar to the below) it
worked fine and we thought we have it beat. But of course the file had an
ASP extension, When I changed the extension to HTML - OOPS!

So why does the extension dictate what/how the page is rendered?

Thanks however for the reply. have a good weekend.

Marian.
  Dave \Crash\ Dummy replied to Marian Henna
06-Feb-10 03:58 PM
Because those are the rules. :-)

The ASP extension tells the server to look for a script to execute. If a
page has a HTM/HTML extension, it is just sent to the browser as is,
without server side action.

--
Crash

~ Robert Frost ~
  Mike B replied to Marian Henna
06-Feb-10 04:47 PM
FWIW,

You will send your request from a FORM object on your HTML page using a HTTP
Request Object.

That is the way to get data back to the HTML page instantiated in your
browser.
I know there are guys here with a greater depth of knowledge than myself,
but I have made this work pretty good for me.
The nuts and bolts of my mess is to have an INPUT type of HIDDEN with
sufficient SIZE to contain any text value returned from the server.  This
makes it possible to recycle this deal to accomodate string values as well
as comma delimited that can be readily converted to array if needed.

The function that you would call on the ASP would be dictated by part of the
name value pairs you send to the server.  Once you target the function in
the ASP page, you return your value with Response.Write which is what the
HTTP Request object is waiting for and once received, is available for your
client side scripting.

You will find a great deal about HTTP Request object, so it should not be
belabored here.

below is the universal function header I use to call the HTTP Request
object.  Target is the URL of the ASP.  The strToSend contains the name
value pairs, which contain the function name to target on the ASP side.



// target Element to the args so innerHTML and recieve return vals also
//  ElAction is null when oEl is null, valid REPLACE or ADDTO
// valid syntax: [STRING] , ['post or get'], [URL], [true/false], [ obj or
false], [REPLACE]
//SendHTTP(strToSend ,    Method ,    Target ,   Async  ,    oEl  ,
elProperty,    ElAction )
  Bob Barrows replied to Marian Henna
06-Feb-10 04:59 PM
You will need to use client-side code to instantiate an xmlhttprequest
object to make a request to the asp page and retrieve the result. I believe
those clues should enable you to google for examples.

Incidently, for classic asp, the groups in the .inetserver.asp hierarchy are
the relevant ones.

--
Microsoft MVP - ASP/ASP.NET - 2004-2007
Please reply to the newsgroup. This email account is my spam trap so I
do not check it very often. If you must reply off-line, then remove the
  Tim Williams replied to Marian Henna
07-Feb-10 12:32 AM
There is *no difference* in what arrives at the client, whether from an
ASP/PHP page or "plain" HTML.  Since any processing to create the content is
done on the server before the contents get sent, there are no more
requirements for a client to render an ASP page than there are for a HTML
page.

The only function of the .asp extension is to tell the server to process the
page as a script: if you so wished, you could tell it to process .html pages
in the same way.

I think your "requirement" for html-only is wrong (unless there is something
else you have not told us)

Tim
  Evertjan. replied to Dave \Crash\ Dummy
07-Feb-10 10:39 AM
Dave "Crash" Dummy wrote on 06 feb 2010 in
microsoft.public.scripting.vbscript:


The rules and the default setting.

IIS could be set to have .html extension be rendered bij the ASP-engine,
and the .asp extension not.




--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
  Marian Henna replied to Tim Williams
07-Feb-10 04:40 PM
No, nothing "Incorrect", and nothing withheld. You might want to understand
and perhaps be exposed to other environments that are not "seemingly" pure
in your mind.

But thanks anyways.
  Marian Henna replied to Marian Henna
07-Feb-10 04:46 PM
I want to thank everyone (including Tim Williams - even tho I was a little
offended by his comment), for all the help and pointers.

Once I chose to follow the advice here and inform the powers that be that
there ishould be no impact to any clients, I made an ASP page, included our
function file and voila all is as we need it to be.

I appreciate that this is a "Free Forum" and you all give your time and
advice freely and willingly.

it is refreshing to see that this sort of collaboration and sharing of
knowledge is still out there.

Keep up the great work everyone.

Again, many thanks.

Marian :)
  Al Dunbar replied to Marian Henna
07-Feb-10 07:38 PM
You are welcome.

It is unfortunate that you felt a little offended by Tim's contribution - I
did not see it as offensive at all. When he wrote this:

[I think your "requirement" for html-only is wrong (unless there is
something else you have not told us)]

I think he was really saying basically what I had said, but in a different
manner:

[Rather than explaining how you want to accomplish what it is you want
to accomplish, perhaps you could explain what it is you want to accomplish,
as there istill might be a way to do that.]

I do not think he was suggesting any sort of dishonesty or ill motive on your
part. People often inadvertently "withhold" the parts of the problem that we
need to see.  And one of the things most often withheld is what the actual
requirement is, as people often confuse that with what they think might be
the nature of the solution of their problem.


/Al
  Tim Williams replied to Marian Henna
08-Feb-10 03:39 PM
No offense intended - since this is a technical forum, I was answering
what seemed to be the technical question.

However, if the reluctance to use ASP pages was purely based on a lack
of "management" understanding, then simply having the server to
process pages with .html extensions through the ASP engine would
acheive your goal without requiring any re-education.  It would mean a
slight performance hit for *.html pages with no coding, but any code
that was found would be processed as if it were an ASP page.

Tim




nd
e
we
d
es
e
e
em
at
ies
tent
ML
s
tml
  Marian Henna replied to Marian Henna
07-Feb-10 04:46 PM
I want to thank everyone (including Tim Williams - even tho I was a little
offended by his comment), for all the help and pointers.

Once I chose to follow the advice here and inform the powers that be that
there ishould be no impact to any clients, I made an ASP page, included our
function file and voila all is as we need it to be.

I appreciate that this is a "Free Forum" and you all give your time and
advice freely and willingly.

it is refreshing to see that this sort of collaboration and sharing of
knowledge is still out there.

Keep up the great work everyone.

Again, many thanks.

Marian :)
Create New Account
help
our custom message classes and would like to do specific tasks for those messages in Outlook. The task is like modifying few MAPI properties before sending the message. To get a MAPI IMessage object from currently selected mail, I am using the API get_MAPIOBJECT of Outlook::_MailItem interface. For this API, I am getting the error 0x80010105 (The server threw an properties propperly. We cannot use Exchange Client Extension interfaces, since Microsoft has deprecated them from Outlook 2010 onwards, so now dependant on OOM for handling UI events. Here is my code snippet: . . CComPtr<Outlook::Selection> olSel; hRes = m_spExplorer-> get_Selection(&olSel); if ( FAILED (hRes) ) return; long count; hRes = olSel-> get_Count count); if ( FAILED (hRes) ) return; LPDISPATCH olSelectedItem = NULL; CComQIPtr <Outlook::_MailItem> pMailItem; CComVariant covIndex; covIndex.vt = VT_I4; covIndex.lVal = 1; olSel-> Item(covIndex, &olSelectedItem); / / Get from Dmitry that the error 0x80010105 (RPC_E_SERVERFAULT) is something to do with the COM Server (Outlook.exe in our case). Dmitry could you please elaborate about the possible cause, I did custom message class. Please suggest if there is another approach to get MAPI object from Outlook UI? Thanks in advance! ~Aditya Gupta Win32 Messaging Discussions Outlook 2010 (1) Outlook (1) Error (1) MAPI properties (1) Exception (1) Class (1) Macro (1
Outlook and CRM integration C++ / VB Hi friends, I am curretly working on the CTI Application and using TAPI2.2 for it. Now, Iam struct at the point of integrating the Outlook (and other softwares like CRM, MS ACCESS, etc). Can any one tell me how to such softwares with the CTI Application? Do I have to go through the architecture of Outlook to integrate my CTI application with it or there is any other way for it? Also, if I am integrating Outlook (or other CRM or MS softwares) then do I have to take the permission from them and pay them? Thanks, Mohit Win32 TAPI Discussions Outlook (1) CTI Application (1) Mohit Soni Outlook (1) Application (1) Visual (1) Andreas Marschall (1) Microsoft Outlook (1) Mohit Mohit (1) Am 17.08.2010 06:21, schrieb Mohit Soni: Outlook has TAPI support - but only for outgoing calls. It does not indicate incoming calls. But
right forum? How would I go about doing this? Sincerely, Doug VBScript Discussions Excel (1) ASP.NET (1) OpenTextFile (1) DTDs (1) Xmldoc.validateOnParse (1) SelectionLanguage (1) ReadAll (1) XPath (1) This documentation that you can obtain via this link: http: / / tinyurl.com / 7rk6 - - Microsoft MVP - ASP / ASP.NET - 2004-2007 Please reply to the newsgroup. This email account is my spam trap so if you need more specific help, you need to provide more information. - - Microsoft MVP - ASP / ASP.NET - 2004-2007 Please reply to the newsgroup. This email account is my spam trap so posted and found nothing that stands out, but I am only human. :-) - - Microsoft MVP - ASP / ASP.NET - 2004-2007 Please reply to the newsgroup. This email account is my spam trap so
CR 8.5 / ASP.NET 3.5 / SQL2K Boolean Parameter C++ / VB I have a crystal report (8.5) based this operational would be appreciated. Thanks in advance. bh VB Crystal Discussions DataDefinition.ParameterFields (1) ASP.NET (1) ParameterDiscreteValue (1) Database (1) Report (1) ParameterField (1) DscVal.Value (1) ParamField (1) Not report, and realize, the stored procedure is not recognizing any value passed in through vb / asp.net. The report is accepting that a value has been passed, and I have tested that help from anyone who ise experience / resolved this issue. Thank you. keywords: CR, 8.5, / , ASP.NET, 3.5, / , SQL2K, Boolean, Parameter description: I have a crystal report (8.5) based on
and .asp file and having Option Explicit working in both? Regards, Michael Larsen VBScript Discussions ASP.NET (1) GuessASP (1) Explict (1) ClsC1 (1) Ummmm (1) Vbs (1) Wsf (1) No - - HTH needed while the code is being written and debugged, as you say. - - Microsoft MVP - ASP / ASP.NET - 2004-2007 Please reply to the newsgroup. This email account is my spam trap so that Option Explicit would "catch" occur if the code is not changed? - - Microsoft MVP - ASP / ASP.NET - 2004-2007 Please reply to the newsgroup. This email account is my spam trap so