473,626 Members | 3,316 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

What happened to client side code???

I am having a really hard time trying to get some client side code hooked up
in VS2005, ASP 2.0.

The code is in an .inc file (vbscript). The first problem I am encountering
is the ASP.NET page doesn't like vbscript and throws fits about the syntax.
Second, the page throws fits about the server side code tags (<% ...
%>),...are these supported anymore? Third, when I set the onclick event of a
client side HTML button it does not recognize the "public" method that I
specify (that is in the include file). I feel like there is some key piece of
information that I am missing that will make all of these issues fall into
place.

Essentially, what I need to do is access one or more local files on the
computer based on parameters that are sent to the server for processing. For
example, if a user clicks on a link I can pass a parameter to the server that
specifies the report the user is requesting, I can then return some
information about where to get the report (the file path...on another Report
Server), and then also where to put this report on the Users machine (client
code).

When I implemented this in ASP, I got it to work flawlessly and I was able
to do some string manipulation to get the client side code and the server
side code to work together nicely. I would like to get it updated to work
with our new ASP 2.0 webpages.

Any ideas on "re-inventing the wheel" in .NET?
Thanks,
- Mike

Jan 23 '06 #1
7 1603
Just use the Page.ClientScri pt.RegisterClie ntScriptBlock to embed your client
script into the page. You can do this in the Page_Load event handler. You can
even load the script text from a file off the file system if you want.

Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Mike Rand" wrote:
I am having a really hard time trying to get some client side code hooked up
in VS2005, ASP 2.0.

The code is in an .inc file (vbscript). The first problem I am encountering
is the ASP.NET page doesn't like vbscript and throws fits about the syntax.
Second, the page throws fits about the server side code tags (<% ...
%>),...are these supported anymore? Third, when I set the onclick event of a
client side HTML button it does not recognize the "public" method that I
specify (that is in the include file). I feel like there is some key piece of
information that I am missing that will make all of these issues fall into
place.

Essentially, what I need to do is access one or more local files on the
computer based on parameters that are sent to the server for processing. For
example, if a user clicks on a link I can pass a parameter to the server that
specifies the report the user is requesting, I can then return some
information about where to get the report (the file path...on another Report
Server), and then also where to put this report on the Users machine (client
code).

When I implemented this in ASP, I got it to work flawlessly and I was able
to do some string manipulation to get the client side code and the server
side code to work together nicely. I would like to get it updated to work
with our new ASP 2.0 webpages.

Any ideas on "re-inventing the wheel" in .NET?
Thanks,
- Mike

Jan 24 '06 #2
Peter,
Thanks for the suggestion. It did get me further than I was. But, I am still
running into at least one issue. I can see the client code when I View Source
on the page. The problem seems to be that the client side button control does
not see the method that I am calling. When I run the project an error comes
up on the onclick="System Test()", when I highlight the onclick to get more
info. it just shows {...} and no further information on the error. (Note, the
script was in vbscript, but I updated it to work with VB.)

Here is the sample code:
....
<SCRIPT LANGUAGE="VB">
Sub TestSystem()

Dim shl_Test As Object
Dim lExecRet_Test AS Long
Dim sCalc_Path As String

sCalc_Path = "C:\WINDOWS\sys tem32\calc.exe"
shl_Test = CreateObject("W Script.Shell")
lExecRet_Test = Shl_Test.Run(sC alc_Path,1,true )

END Sub
</SCRIPT>
<div>
<input id="Button1" style="z-index: 100; left: 136px; width: 155px;
position: absolute;
top: 106px; height: 57px" type="button" value="button"
onclick="TestSy stem()" />
</div>
</form>
</body>
</html>

Any ideas?
Thanks,
- Mike
"Peter Bromberg [C# MVP]" wrote:
Just use the Page.ClientScri pt.RegisterClie ntScriptBlock to embed your client
script into the page. You can do this in the Page_Load event handler. You can
even load the script text from a file off the file system if you want.

Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Mike Rand" wrote:
I am having a really hard time trying to get some client side code hooked up
in VS2005, ASP 2.0.

The code is in an .inc file (vbscript). The first problem I am encountering
is the ASP.NET page doesn't like vbscript and throws fits about the syntax.
Second, the page throws fits about the server side code tags (<% ...
%>),...are these supported anymore? Third, when I set the onclick event of a
client side HTML button it does not recognize the "public" method that I
specify (that is in the include file). I feel like there is some key piece of
information that I am missing that will make all of these issues fall into
place.

Essentially, what I need to do is access one or more local files on the
computer based on parameters that are sent to the server for processing. For
example, if a user clicks on a link I can pass a parameter to the server that
specifies the report the user is requesting, I can then return some
information about where to get the report (the file path...on another Report
Server), and then also where to put this report on the Users machine (client
code).

When I implemented this in ASP, I got it to work flawlessly and I was able
to do some string manipulation to get the client side code and the server
side code to work together nicely. I would like to get it updated to work
with our new ASP 2.0 webpages.

Any ideas on "re-inventing the wheel" in .NET?
Thanks,
- Mike

Jan 24 '06 #3
Try this:

<SCRIPT LANGUAGE="VBScr ipt">
Sub TestSystem()
Dim shl_Test
Dim lExecRet_Test
Dim sCalc_Path

sCalc_Path = "C:\WINDOWS\sys tem32\calc.exe"
set shl_Test = CreateObject("W Script.Shell")
lExecRet_Test = Shl_Test.Run(sC alc_Path,1,true )

END Sub
</SCRIPT>
<div>
<input id="Button1" style="z-index: 100; left: 136px; width: 155px;
position: absolute;
top: 106px; height: 57px" type="button" value="button"
onclick="TestSy stem()" />
</div>
</form>
</body>
</html>

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Mike Rand" wrote:
Peter,
Thanks for the suggestion. It did get me further than I was. But, I am still
running into at least one issue. I can see the client code when I View Source
on the page. The problem seems to be that the client side button control does
not see the method that I am calling. When I run the project an error comes
up on the onclick="System Test()", when I highlight the onclick to get more
info. it just shows {...} and no further information on the error. (Note, the
script was in vbscript, but I updated it to work with VB.)

Here is the sample code:
...
<SCRIPT LANGUAGE="VB">
Sub TestSystem()

Dim shl_Test As Object
Dim lExecRet_Test AS Long
Dim sCalc_Path As String

sCalc_Path = "C:\WINDOWS\sys tem32\calc.exe"
shl_Test = CreateObject("W Script.Shell")
lExecRet_Test = Shl_Test.Run(sC alc_Path,1,true )

END Sub
</SCRIPT>
<div>
<input id="Button1" style="z-index: 100; left: 136px; width: 155px;
position: absolute;
top: 106px; height: 57px" type="button" value="button"
onclick="TestSy stem()" />
</div>
</form>
</body>
</html>

Any ideas?
Thanks,
- Mike
"Peter Bromberg [C# MVP]" wrote:
Just use the Page.ClientScri pt.RegisterClie ntScriptBlock to embed your client
script into the page. You can do this in the Page_Load event handler. You can
even load the script text from a file off the file system if you want.

Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Mike Rand" wrote:
I am having a really hard time trying to get some client side code hooked up
in VS2005, ASP 2.0.

The code is in an .inc file (vbscript). The first problem I am encountering
is the ASP.NET page doesn't like vbscript and throws fits about the syntax.
Second, the page throws fits about the server side code tags (<% ...
%>),...are these supported anymore? Third, when I set the onclick event of a
client side HTML button it does not recognize the "public" method that I
specify (that is in the include file). I feel like there is some key piece of
information that I am missing that will make all of these issues fall into
place.

Essentially, what I need to do is access one or more local files on the
computer based on parameters that are sent to the server for processing. For
example, if a user clicks on a link I can pass a parameter to the server that
specifies the report the user is requesting, I can then return some
information about where to get the report (the file path...on another Report
Server), and then also where to put this report on the Users machine (client
code).

When I implemented this in ASP, I got it to work flawlessly and I was able
to do some string manipulation to get the client side code and the server
side code to work together nicely. I would like to get it updated to work
with our new ASP 2.0 webpages.

Any ideas on "re-inventing the wheel" in .NET?
Thanks,
- Mike

Jan 24 '06 #4
Peter,
Thanks. I got it working. I pasted the code into the page, rather than using
the Register method and then realized that the code was the problem. More
specifically the language tag, the script tag being capatilized and the
absence of the type attribute (the code I used was my original vbscript
code). Once I got those sorted out, it worked nicely. Then I moved it back to
the include file and used the Register method and it worked fine.
Thanks for taking the time on this, I really appreciate it!
- Mike

"Peter Bromberg [C# MVP]" wrote:
Try this:

<SCRIPT LANGUAGE="VBScr ipt">
Sub TestSystem()
Dim shl_Test
Dim lExecRet_Test
Dim sCalc_Path

sCalc_Path = "C:\WINDOWS\sys tem32\calc.exe"
set shl_Test = CreateObject("W Script.Shell")
lExecRet_Test = Shl_Test.Run(sC alc_Path,1,true )

END Sub
</SCRIPT>
<div>
<input id="Button1" style="z-index: 100; left: 136px; width: 155px;
position: absolute;
top: 106px; height: 57px" type="button" value="button"
onclick="TestSy stem()" />
</div>
</form>
</body>
</html>

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Mike Rand" wrote:
Peter,
Thanks for the suggestion. It did get me further than I was. But, I am still
running into at least one issue. I can see the client code when I View Source
on the page. The problem seems to be that the client side button control does
not see the method that I am calling. When I run the project an error comes
up on the onclick="System Test()", when I highlight the onclick to get more
info. it just shows {...} and no further information on the error. (Note, the
script was in vbscript, but I updated it to work with VB.)

Here is the sample code:
...
<SCRIPT LANGUAGE="VB">
Sub TestSystem()

Dim shl_Test As Object
Dim lExecRet_Test AS Long
Dim sCalc_Path As String

sCalc_Path = "C:\WINDOWS\sys tem32\calc.exe"
shl_Test = CreateObject("W Script.Shell")
lExecRet_Test = Shl_Test.Run(sC alc_Path,1,true )

END Sub
</SCRIPT>
<div>
<input id="Button1" style="z-index: 100; left: 136px; width: 155px;
position: absolute;
top: 106px; height: 57px" type="button" value="button"
onclick="TestSy stem()" />
</div>
</form>
</body>
</html>

Any ideas?
Thanks,
- Mike
"Peter Bromberg [C# MVP]" wrote:
Just use the Page.ClientScri pt.RegisterClie ntScriptBlock to embed your client
script into the page. You can do this in the Page_Load event handler. You can
even load the script text from a file off the file system if you want.

Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Mike Rand" wrote:

> I am having a really hard time trying to get some client side code hooked up
> in VS2005, ASP 2.0.
>
> The code is in an .inc file (vbscript). The first problem I am encountering
> is the ASP.NET page doesn't like vbscript and throws fits about the syntax.
> Second, the page throws fits about the server side code tags (<% ...
> %>),...are these supported anymore? Third, when I set the onclick event of a
> client side HTML button it does not recognize the "public" method that I
> specify (that is in the include file). I feel like there is some key piece of
> information that I am missing that will make all of these issues fall into
> place.
>
> Essentially, what I need to do is access one or more local files on the
> computer based on parameters that are sent to the server for processing. For
> example, if a user clicks on a link I can pass a parameter to the server that
> specifies the report the user is requesting, I can then return some
> information about where to get the report (the file path...on another Report
> Server), and then also where to put this report on the Users machine (client
> code).
>
> When I implemented this in ASP, I got it to work flawlessly and I was able
> to do some string manipulation to get the client side code and the server
> side code to work together nicely. I would like to get it updated to work
> with our new ASP 2.0 webpages.
>
> Any ideas on "re-inventing the wheel" in .NET?
> Thanks,
> - Mike
>

Jan 25 '06 #5
Is it possible to translate that script in javascript?
--
JLobo
"Peter Bromberg [C# MVP]" wrote:
Try this:

<SCRIPT LANGUAGE="VBScr ipt">
Sub TestSystem()
Dim shl_Test
Dim lExecRet_Test
Dim sCalc_Path

sCalc_Path = "C:\WINDOWS\sys tem32\calc.exe"
set shl_Test = CreateObject("W Script.Shell")
lExecRet_Test = Shl_Test.Run(sC alc_Path,1,true )

END Sub
</SCRIPT>
<div>
<input id="Button1" style="z-index: 100; left: 136px; width: 155px;
position: absolute;
top: 106px; height: 57px" type="button" value="button"
onclick="TestSy stem()" />
</div>
</form>
</body>
</html>

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Mike Rand" wrote:
Peter,
Thanks for the suggestion. It did get me further than I was. But, I am still
running into at least one issue. I can see the client code when I View Source
on the page. The problem seems to be that the client side button control does
not see the method that I am calling. When I run the project an error comes
up on the onclick="System Test()", when I highlight the onclick to get more
info. it just shows {...} and no further information on the error. (Note, the
script was in vbscript, but I updated it to work with VB.)

Here is the sample code:
...
<SCRIPT LANGUAGE="VB">
Sub TestSystem()

Dim shl_Test As Object
Dim lExecRet_Test AS Long
Dim sCalc_Path As String

sCalc_Path = "C:\WINDOWS\sys tem32\calc.exe"
shl_Test = CreateObject("W Script.Shell")
lExecRet_Test = Shl_Test.Run(sC alc_Path,1,true )

END Sub
</SCRIPT>
<div>
<input id="Button1" style="z-index: 100; left: 136px; width: 155px;
position: absolute;
top: 106px; height: 57px" type="button" value="button"
onclick="TestSy stem()" />
</div>
</form>
</body>
</html>

Any ideas?
Thanks,
- Mike
"Peter Bromberg [C# MVP]" wrote:
Just use the Page.ClientScri pt.RegisterClie ntScriptBlock to embed your client
script into the page. You can do this in the Page_Load event handler. You can
even load the script text from a file off the file system if you want.
>
Peter
>
--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com
>
>
>
>
"Mike Rand" wrote:
>
I am having a really hard time trying to get some client side code hooked up
in VS2005, ASP 2.0.

The code is in an .inc file (vbscript). The first problem I am encountering
is the ASP.NET page doesn't like vbscript and throws fits about the syntax.
Second, the page throws fits about the server side code tags (<% ...
%>),...are these supported anymore? Third, when I set the onclick event of a
client side HTML button it does not recognize the "public" method that I
specify (that is in the include file). I feel like there is some key piece of
information that I am missing that will make all of these issues fall into
place.

Essentially, what I need to do is access one or more local files on the
computer based on parameters that are sent to the server for processing. For
example, if a user clicks on a link I can pass a parameter to the server that
specifies the report the user is requesting, I can then return some
information about where to get the report (the file path...on another Report
Server), and then also where to put this report on the Users machine (client
code).

When I implemented this in ASP, I got it to work flawlessly and I was able
to do some string manipulation to get the client side code and the server
side code to work together nicely. I would like to get it updated to work
with our new ASP 2.0 webpages.

Any ideas on "re-inventing the wheel" in .NET?
Thanks,
- Mike
Sep 20 '07 #6
"JLobo" <JL***@discussi ons.microsoft.c omwrote in message
news:0F******** *************** ***********@mic rosoft.com...
Is it possible to translate that script in javascript?
<script type="text/javascript>
function TestSystem()
{
var shl_Test;
var lExecRet_Test;
var sCalc_Path;

sCalc_Path = "C:\\WINDOWS\\s ystem32\\calc.e xe";
shl_Test = new ActiveXObject(" WScript.Shell") ;
lExecRet_Test = shl_Test.Run(sC alc_Path,1,true );
}
</script>

N. B. I haven't tested this...
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Sep 20 '07 #7
Thank you, it works.
--
JLobo
"Mark Rae [MVP]" wrote:
"JLobo" <JL***@discussi ons.microsoft.c omwrote in message
news:0F******** *************** ***********@mic rosoft.com...
Is it possible to translate that script in javascript?

<script type="text/javascript>
function TestSystem()
{
var shl_Test;
var lExecRet_Test;
var sCalc_Path;

sCalc_Path = "C:\\WINDOWS\\s ystem32\\calc.e xe";
shl_Test = new ActiveXObject(" WScript.Shell") ;
lExecRet_Test = shl_Test.Run(sC alc_Path,1,true );
}
</script>

N. B. I haven't tested this...
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Sep 20 '07 #8

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

Similar topics

92
6435
by: Reed L. O'Brien | last post by:
I see rotor was removed for 2.4 and the docs say use an AES module provided separately... Is there a standard module that works alike or an AES module that works alike but with better encryption? cheers, reed
125
14694
by: Sarah Tanembaum | last post by:
Beside its an opensource and supported by community, what's the fundamental differences between PostgreSQL and those high-price commercial database (and some are bloated such as Oracle) from software giant such as Microsoft SQL Server, Oracle, and Sybase? Is PostgreSQL reliable enough to be used for high-end commercial application? Thanks
18
7363
by: cjl | last post by:
Hey all: I know that it is silly in the age of Google to 'lose' something on the internet, but I recently checked out a project that had implemented a database with a subset of SQL in pure client-side javascript. I forgot to bookmark it, and now I can't find it. Anyone?
8
4030
by: Hermawih | last post by:
Hello , I want your opinion about this . In order to say it clearly , I think I have to describe it in long sentences . I could consider myself as Intermediate/Advance Access Developer ; Intermediate/Advanced Database designer . Because of the requirements , I must create Web Application . Access Pages is not suitable for that so I think about learning VB Net / ASP Net . I am
4
2364
by: | last post by:
Hello Guys, I am using the validation controls to validate my data. But the problem is "The page is still being posted to server". I want to get rid of the round trips to server. Are there any get arounds for this problem apart from the traditional JavaScript?
9
4907
by: Harry Smith | last post by:
While reading the documentation on IsStartupScriptRegistered, there is a reference to "client startup script" as "Determines if the client startup script is registered with the Page object." What is meant by "Client Start Script"? Thanks, Harry
10
2040
by: Ben | last post by:
Hi, I made an application in classic asp (reservation of books and video stuffs for students) and want to migrate to asp.net. The user has to chose a date, then pushung on a submit button. The whole day is then displayed in cels of a table. The user has then to click in a cel representing a hour of the day and an object (book ..), and finally click on the submit button to insert that reservation in the database. My problem is: there...
3
1755
by: Simon Brooke | last post by:
I've been doing XSL transforms, converting XML to HTML, server side since 2000. In those days, clients which could do the transformation client side didn't exist, so whether to transform client-side or server-side wasn't an issue. Recently I've been overhauling the code in order to pass transform to the client wherever possible, and I've hit two problems (i) How do I know whether the client can do transforms? Currently I'm only...
3
5529
by: =?Utf-8?B?RWFnbGVSZWRASGlnaEZseWluZ0JpcmRzLmNvbQ== | last post by:
I am writing an application using VS2005 and I am using javascript on the client side. I have a table that contains textboxes and I want to set the contents of all of them to the empty string in javascript. I cannot permit a postback in this scenario. I want to find the textboxes by using: var txtBoxes = document.getElementsByTagName("input"); I can then iterate the array and set the value for all inputs of type text to the empty...
0
8272
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8713
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8644
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8514
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7206
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6126
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5579
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4208
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2632
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.