Calling a javascript/jQuery from ASP.NET C#?

P

Peter

Hello,

Thanks for reviewing my question. I would like to know if its possible or
how to call a Javascript/jQuery function from my ASP.NET C# function?

Many Thanks
Peter
 
B

Bob Barrows

Peter said:
Hello,

Thanks for reviewing my question. I would like to know if its
possible or how to call a Javascript/jQuery function from my ASP.NET
C# function?
Do you mean calling a client-side function from the C# server-side code?
No. Not directly. You can cause a script block containing a call to the
function to be written to Response.

***canned wrong-newsgroup reply************************
There was no way for you to know it (except maybe by browsing through some
of the previous questions in this newsgroup before posting yours - always a
recommended practice) , but this is a classic (COM-based) asp newsgroup.
ASP.Net bears very little resemblance to classic ASP so, while you may be
lucky enough to find a dotnet-knowledgeable person here who can answer your
question, you can eliminate the luck factor by posting your question to a
group where those dotnet-knowledgeable people hang out. I suggest
microsoft.public.dotnet.framework.aspnet or the forums at www.asp.net.
******************************************************************
 
S

ssundar

Hello,

Thanks for reviewing my question.  I would like to know if its possibleor
how to call a Javascript/jQuery function from my ASP.NET C# function?

Many Thanks
Peter

Hi preter ,

Use <script> tag and write function and called that one
 
H

Hal Rosser

"> Thanks for reviewing my question. I would like to know if its possible
or
how to call a Javascript/jQuery function from my ASP.NET C# function?

Many Thanks
Peter

Peter - the ASP is executed on the server, and the javascript is executed in
the user's browser.
Given that restraint, maybe you can have your asp to add an onload event
handler in the body tag of your page so your javascript function can be
called by the page loading into the browser.
 
E

Evertjan.

Hal Rosser wrote on 13 mei 2009 in
microsoft.public.inetserver.asp.general:
"> Thanks for reviewing my question. I would like to know if its
possible or

Peter - the ASP is executed on the server, and the javascript is
executed in the user's browser.
Given that restraint, maybe you can have your asp to add an onload
event handler in the body tag of your page so your javascript function
can be called by the page loading into the browser.

Javascript can also be executed on the server,
I do not know about jquery [and I doubt I want to know].

This is a classic asp group.
Dotnet questions c/should be asked in
<microsoft.public.dotnet.framework.aspnet>
 
H

Hal Rosser

Evertjan. said:
Hal Rosser wrote on 13 mei 2009 in
microsoft.public.inetserver.asp.general:
"> Thanks for reviewing my question. I would like to know if its
possible or

Peter - the ASP is executed on the server, and the javascript is
executed in the user's browser.
Given that restraint, maybe you can have your asp to add an onload
event handler in the body tag of your page so your javascript function
can be called by the page loading into the browser.

Javascript can also be executed on the server,
I do not know about jquery [and I doubt I want to know].

Even when the 2 languages are on the same page?
I didn't know that.
 
E

Evertjan.

Hal Rosser wrote on 16 mei 2009 in microsoft.public.inetserver.asp.general:
Evertjan. said:
Hal Rosser wrote on 13 mei 2009 in
microsoft.public.inetserver.asp.general:
"> Thanks for reviewing my question. I would like to know if its
possible or
how to call a Javascript/jQuery function from my ASP.NET C# function?

Many Thanks
Peter

Peter - the ASP is executed on the server, and the javascript is
executed in the user's browser.
Given that restraint, maybe you can have your asp to add an onload
event handler in the body tag of your page so your javascript function
can be called by the page loading into the browser.

Javascript can also be executed on the server,
I do not know about jquery [and I doubt I want to know].

Even when the 2 languages are on the same page?
I didn't know that.

Which two languages?

ASP can use VBS or Jscript [or C++, I think] as primary language,
and can use the others as secondary ones.

On the same "page" you can also use a clientside language,
javascript or even [also] VBS in IE only applications.

So 4 languages are not even out of the question on a page.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,262
Messages
2,571,056
Members
48,769
Latest member
Clifft

Latest Threads

Top