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

Calling Javascript from codebehind...

hiye people, i know this have been ask multipletimes over the past year, but i cant find any here in the new group so here goes..

in my code behind, i'm going to do some validation and use javascript to throw the msg out to them, these errors msg are query from the db
1st, how can i call a javascript function from codebehind. is there any other way besides response.write = "<script></script>" ??
2nd, can someone recommend me ways i can pass parameters from codebehind into my javascript

thanks in advance..

Zuiber
Nov 18 '05 #1
2 1949
"Ekken Zuiber" <an*******@discussions.microsoft.com> wrote in message
news:9A**********************************@microsof t.com...
hiye people, i know this have been ask multipletimes over the past year, but i cant find any here in the new group so here goes...
in my code behind, i'm going to do some validation and use javascript to throw the msg out to them, these errors msg are query from the db. 1st, how can i call a javascript function from codebehind. is there any other way besides response.write = "<script></script>" ??? 2nd, can someone recommend me ways i can pass parameters from codebehind

into my javascript?

You can't do this directly. Client-side JavaScript resides on the client,
and server-side codebehind resides on the server. The only connection
between the two is that the server code gets to write HTML to the client.
You will have to write <script/> to the client.

You can pass values to the client by placing those values in the script code
which you send to the client.
--
John Saunders
johnwsaundersiii at hotmail
Nov 18 '05 #2
thanks...
Nov 18 '05 #3

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

Similar topics

0
by: Prescott | last post by:
I want to execute a javascript function that will set a value in the parent window from the child widow where its called and then post the form to the server. I seem to be able to execute one or...
0
by: Scott Wallace | last post by:
I have a page that displays several pictures pulled from a database. I want any one of the pictures to appear in a larger main picture container when the user clicks on it. I want to do this on the...
2
by: exshige | last post by:
I read from some book that you can actually on any tag in the html page put a onClick or something and assign it with the sub/function name that is in the codebehind. I tried but it say name...
2
by: Alex | last post by:
Hi all, I'm writing a small web application which searches a database based on a date field, and populates a datagrid control with the results. The datagrid control has selection buttons added...
0
by: rahulkate | last post by:
Hello Everybod I have a problem hope you can help me out I have a treeview and on the selectedindexchange event of the treeview I want to execute some code from the vb codebehind file and a...
1
by: johnc | last post by:
Hey all, just wondering if the subject of this post is possible. I have a javascript on my asp page that detects browser onunload, and it will successfully popup a messsage box. When I try to...
7
by: =?Utf-8?B?Qw==?= | last post by:
I have a dropdown list as below. I add an onchnage attribute in my codebehind to call some Javascript. I want to get the selected text from my dropdown. What am I doing wrong below? ...
2
by: Adrian | last post by:
Hi all of the PC that will have access to the ASPX page have a COM object installed and using Codebehind I add a COM reference to it and I can call it like this: View.ViewSrv vs = new...
1
by: ahmh | last post by:
The javascript function is called getsportart2 in the codebehind page_load I have the following Page.RegisterStartupScript("MyScript3","<script type='text/javascript'...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.