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

client-side vs server-side

hey all,

i'm having trouble understanding the connection (if there is one beween)
client-side scripting and server side scripting. For example can a variable
that is defined in the code-behind be accessed by client-side code, vice
versa? Any other tips related to the subject is welcomed as well.

thanks,
rodchar
Nov 19 '05 #1
3 1308
> i'm having trouble understanding the connection (if there is one beween)
client-side scripting and server side scripting.
There really isn't a connection.
For example can a variable
that is defined in the code-behind be accessed by client-side code
The server side code can write something to to the page that the javascript
can then read. HTML has to be the 'middle man' for that, though. You can't
directly read a server-side variable from javascript on the client side.
vice
versa?


Vice Versa is harder, since javascript can't actually change the markup that
the server sees. You can have the javascript postback with a querystring, or
have javascript write to a form field, and then grab the form field value on
postback.

Just remember that there is a rendered page in the middle.

javascript <--> CLIENT COMPUTER <--> rendered html page <-->SERVER <-->
Codebehind

-Darrel
Nov 19 '05 #2
The server side code can write something to to the page that the javascript can then read. HTML has to be the 'middle man' for that, though. You can't
directly read a server-side variable from javascript on the client side.


More specifically, the server side code could actually write the javascript:

function sampleJavascriptFunction(This){
var el = <%=yourDotNetVariable%>;
}

-Darrel
Nov 19 '05 #3
Normally no, but you could create an http request in javascript, receive the
request server side with c#, pass back some data then interpret it with
javascript. Look up ajax if you are interested in this. It is a way to
call server side code from javascript.
"rodchar" <ro*****@discussions.microsoft.com> wrote in message
news:08**********************************@microsof t.com...
hey all,

i'm having trouble understanding the connection (if there is one beween)
client-side scripting and server side scripting. For example can a
variable
that is defined in the code-behind be accessed by client-side code, vice
versa? Any other tips related to the subject is welcomed as well.

thanks,
rodchar

Nov 19 '05 #4

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

Similar topics

1
by: Justin Stockton | last post by:
I recently upgraded from ActivePython 2.2.2 to ActivePython 2.3.2 and I'm running into an issue importing the win32com.client module. Before installing the new version, I made sure to properly...
2
by: Rhino | last post by:
I am trying to verify that I correctly understand something I saw in the DB2 Information Center. I am running DB2 Personal Edition V8.2.1 on Windows. I came across the following in the Info...
5
by: Paul H | last post by:
How do you folks get a reliable and complete brief of what is required before development starts? I am forever going back to a client once a project has started saying "Hang on, now that I've...
11
by: pshindle | last post by:
We have several machines currently running the DB2 V7 Run-time Client that we would like to actually be running the App Dev Client. To 'upgrade' (within the same version) this client software can...
2
by: J Huntley Palmer | last post by:
I am having a horrific time integrating uw-imap's c-client for imap support in php. The problem is a whole bunch of "Text relocation remains referenced against symbol" errors during linking....
11
by: Wayne | last post by:
I am a one man enterprise and have been asked by a prospective client what happens to their database regarding ongoing changes etc if I get hit by a bus. Obviously my databases are distributed...
1
by: WebServiceSecurity | last post by:
The issue involves the following technologies: - 1. .NET 2.0 Framework 2. WSE2.0 (WS-Security) 3. X.509 certificates 4. BEA Weblogic 8.1.5
3
by: rjha94 | last post by:
Hi I just installed the runtime client on my windows machine. when i go inside the SQLLIB\bin folder i can see db2.exe. is it possible to use this db2 bundled with runtime client for command line...
4
MMcCarthy
by: MMcCarthy | last post by:
http://bytes.com/images/howtos/projectscope_blocks.jpgAs a freelance IT consultant for over 10 years, I’ve come to appreciate well defined project scopes. A project scope is a common understanding...
11
by: Bill Davy | last post by:
I am trying to edit Contacts in Outlook. This is so I can transfer numbers from my address book which is an Excel spreadsheet to my mobile phone. I came across the following snippet of code which...
1
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: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.