472,969 Members | 1,874 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,969 software developers and data experts.

Server-side command included in javascritp inside codebehind??

al
Greetings,

I'm having a problem trying to execute server-side command included in
javascript inside codebehind file (VB.net).
'*****code sample
Button1.attributes.add("onclick"," '" & <%response.write(""test"")%>
& "' ")

This gives me javascript error?!?!?!??

Any help with the syntax of such case???

MTIA,
Grawsha
Nov 18 '05 #1
3 1236
Hi,
Lose the response.write. Eg
Button1.attributes.add("onclick", test)
for example
Dim test As String = "alert('test');"
YourButton.Attributes.Add("onclick", test)

Cheers,
Jon

"al" <gr*********@yahoo.com> wrote in message
news:66**************************@posting.google.c om...
Greetings,

I'm having a problem trying to execute server-side command included in
javascript inside codebehind file (VB.net).
'*****code sample
Button1.attributes.add("onclick"," '" & <%response.write(""test"")%>
& "' ")

This gives me javascript error?!?!?!??

Any help with the syntax of such case???

MTIA,
Grawsha

Nov 18 '05 #2
You can't execute server commands from the browser. Read up on the difference between serverside and clientside programming. www.w3schools.com is a good place for javascript.

"al" wrote:
Greetings,

I'm having a problem trying to execute server-side command included in
javascript inside codebehind file (VB.net).
'*****code sample
Button1.attributes.add("onclick"," '" & <%response.write(""test"")%>
& "' ")

This gives me javascript error?!?!?!??

Any help with the syntax of such case???

MTIA,
Grawsha

Nov 18 '05 #3
al
Scott Simons <Scott.Simons.At.MealMagic.Com.Remove.This> wrote in message news:<AD**********************************@microso ft.com>...
You can't execute server commands from the browser. Read up on the difference between serverside and clientside programming. www.w3schools.com is a good place for javascript.

"al" wrote:
Greetings,

I'm having a problem trying to execute server-side command included in
javascript inside codebehind file (VB.net).
'*****code sample
Button1.attributes.add("onclick"," '" & <%response.write(""test"")%>
& "' ")

This gives me javascript error?!?!?!??

Any help with the syntax of such case???

MTIA,
Grawsha


Ok, what about this syntax(inside JS):

<%response.write(""test"")%>, or
<%response.redirect(""main.aspx"")%>

I thought it is used for executing server side code????

Grawsha
Nov 18 '05 #4

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

Similar topics

2
by: Phil | last post by:
I am using a Pascal like language (Wealth-Lab) on W2K and call this server: class HelloWorld: _reg_clsid_ = "{4E797C6A-5969-402F-8101-9C95453CF8F6}" _reg_desc_ = "Python Test COM Server"...
6
by: Nathan Sokalski | last post by:
I want to set up SQL Server on Windows XP Pro so that I can use the database capabilities of ASP and IIS. I am probably using some incorrect settings, but I am not sure what they are. Here is what...
9
by: Grim Reaper | last post by:
My work let me put SQL Server 7.0 Enterprise Edition on my laptop. I have never setup a server from the beginning, so I am a little new at creating server groups. Alright, I am trying to create...
0
by: Chris Halcrow | last post by:
Hi I've spent ALL DAY trying to re-install SQL Server 2000 on Windows XP. I continually get the error 'cannot configure server' just at the end of the installation. I've tried the following: ...
0
by: Zorba.GR | last post by:
IBM DB2 Connect Enterprise Edition v8.2, other IBM DB2 (32 bit, 64 bit) (MULTiOS, Windows, Linux, Solaris), IBM iSoft Commerce Suite Server Enterprise v3.2.01, IBM Tivoli Storage Resource Manager...
22
by: EP | last post by:
When running my asp.net hosting service (asp.net without IIS), on server 2003 with IIS not installed, I get the following when trying to process a request. "System.DllNotFoundException: Unable to...
2
by: Mike | last post by:
Hi, I am strugling with a simple problem which I can't seem to resolve. I have an asp.net page which contains a server-control (flytreeview, which is a kind of a tree to be exact). The tree is...
4
by: coosa | last post by:
Hi, I was installing SQL Server on my machine and during installation my PC freezed. It happens frequently on my machine. So i tried after restarting to install it again and since then i always...
1
by: Peter | last post by:
I've purchased VS.NET 2005 Standard and have tried to install SQL Server 2005 Express, but get the following error in the error log. Please could someone help me.... Microsoft SQL Server 2005...
14
by: Developer | last post by:
Hello All, i have recently installed VS2005 and was trying to install SQL sever 2000. I have Win XP' SP2. But when I tried installing, it only installed client tools and not the database. Can...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
3
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

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.