473,659 Members | 2,980 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Triggering both client and server side scripts


I have a button that opens a new Window using client side Javascript. The
button also has server side script (.._click) that saves some session
variables to be used in the new Window.

The problem is that the server side function does not fire.

Karim
Nov 18 '05 #1
3 1937
Hi Karim,

Here's some code that might work for you. Not sure whether the setting of
the Session variable will be done in time for the secondary window to fetch.
Depends on the speed of the server, I suppose.

Private Sub Page_Load _
(ByVal sender As System.Object, _
ByVal e As System.EventArg s) Handles MyBase.Load
Button1.Attribu tes.Add _
("onclick", "window.open('s ec.aspx','sec') ;return true;")
End Sub

Private Sub Button1_Click _
(ByVal sender As System.Object, _
ByVal e As System.EventArg s) Handles Button1.Click
Session("stored ") = "here is the value at " & _
Now.ToLongTimeS tring
End Sub

"Karim" <ka*******@yaho o.moc> wrote in message
news:96******** *************** *****@40tude.ne t...

I have a button that opens a new Window using client side Javascript. The
button also has server side script (.._click) that saves some session
variables to be used in the new Window.

The problem is that the server side function does not fire.

Karim

Nov 18 '05 #2
On Tue, 25 Nov 2003 21:34:41 -0500, Ken Cox [Microsoft MVP] wrote:
Hi Karim,

Here's some code that might work for you. Not sure whether the setting of
the Session variable will be done in time for the secondary window to fetch.
Depends on the speed of the server, I suppose.

Private Sub Page_Load _
(ByVal sender As System.Object, _
ByVal e As System.EventArg s) Handles MyBase.Load
Button1.Attribu tes.Add _
("onclick", "window.open('s ec.aspx','sec') ;return true;")
End Sub

Private Sub Button1_Click _
(ByVal sender As System.Object, _
ByVal e As System.EventArg s) Handles Button1.Click
Session("stored ") = "here is the value at " & _
Now.ToLongTimeS tring
End Sub

Thanks. Your code resembles what I have. The problem is that the button
click doesn't fire. I want to execute code in the click event first to set
the session variables, then open window fires up to open a new window whose
page_load event reads in the session variables that were set by the
parent's window. I guess I will have to send the parameters through a
querystring which will will built dynamically in the open window script.
The variables are some form fields.

Does anyone have a better way of doing this?

Karim


"Karim" <ka*******@yaho o.moc> wrote in message
news:96******** *************** *****@40tude.ne t...

I have a button that opens a new Window using client side Javascript. The
button also has server side script (.._click) that saves some session
variables to be used in the new Window.

The problem is that the server side function does not fire.

Karim

Nov 18 '05 #3
On Wed, 26 Nov 2003 08:05:28 -0800, Karim wrote:
On Tue, 25 Nov 2003 21:34:41 -0500, Ken Cox [Microsoft MVP] wrote:
Hi Karim,

Here's some code that might work for you. Not sure whether the setting of
the Session variable will be done in time for the secondary window to fetch.
Depends on the speed of the server, I suppose.

Private Sub Page_Load _
(ByVal sender As System.Object, _
ByVal e As System.EventArg s) Handles MyBase.Load
Button1.Attribu tes.Add _
("onclick", "window.open('s ec.aspx','sec') ;return true;")
End Sub

Private Sub Button1_Click _
(ByVal sender As System.Object, _
ByVal e As System.EventArg s) Handles Button1.Click
Session("stored ") = "here is the value at " & _
Now.ToLongTimeS tring
End Sub

Thanks. Your code resembles what I have. The problem is that the button
click doesn't fire. I want to execute code in the click event first to set
the session variables, then open window fires up to open a new window whose
page_load event reads in the session variables that were set by the
parent's window. I guess I will have to send the parameters through a
querystring which will will built dynamically in the open window script.
The variables are some form fields.

Does anyone have a better way of doing this?

Karim


"Karim" <ka*******@yaho o.moc> wrote in message
news:96******** *************** *****@40tude.ne t...

I have a button that opens a new Window using client side Javascript. The
button also has server side script (.._click) that saves some session
variables to be used in the new Window.

The problem is that the server side function does not fire.


Well now after many tries I found that the click does fire sometimes. It
sometimes gets fired before the new Window is opened, sometimes gets fired
after the new Window is opened and sometimes the click event never fires.
This is very inconsistent!

Karim
Nov 18 '05 #4

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

Similar topics

9
4330
by: Kathryn | last post by:
Hiya I have a problem with using some client side and server side scripting together in an ASP. I'm using VBScript. What I'm trying to achieve is this - - Page loads up and some server side vbscript reads the database and populates a listbox on the page with the first field from each record in the recordset. This works fine. - User selects an option on the listbox and, using the OnChange, I
2
2274
by: Stephanie Stowe | last post by:
Hi. I have never worked on a project that requires IE. So I have done the vast majority of my work server side, delivering cross-browser compliant HTML to the client. I am working on a bug fix to a system that is a munch of ASP, ASP.NET with hard-core client side JScript, VBScript (client-side) and ActiveX controls. The problem in question involves functionality that is common to an ActiveX control delivered to the client. I have never...
5
1969
by: tmb | last post by:
Is there a way to use ASP to 'push' a new image to the client every 15 seconds or so? I guess the entire page will have to be 're-sent' to the client but I'm not sure. I'm trying to 'rotate' a new product image every few seconds. I could use an animated gif or some java script maybe, but I want to keep the file small and not have to count on the user having java script
5
2593
by: Mong | last post by:
Hi, I have a webform with various asp controls on it such as textboxes and dropdownlists. I'm fairly new to asp.net coming from VB6 and am wondering when it's best to use client side events and when it's best to use server side events. For example, if a textbox is to contain a date I want to validate the date when that textbox loses the focus. If the date is not valid I make visible a label next to the textbox telling the user it's
6
2484
by: adolf garlic | last post by:
A postback I'm doing takes ages to get the data which it then uses to populate a table. What I want to know is: How can I get the client side to fire a 'resize' event when the postback thing has finished?
4
1162
by: Tarllem | last post by:
Hi! Is possible to run scripts at the side of the client? Thanks!
4
3500
by: John Boy | last post by:
Hi, Can anyone help. This is really doing my nut in. 3 years ASP exp. and now doing .DOT which is a step in the wrong direction. Basically I am left with the code of a guy who has left. When I click a button on a pop-up window the javascript for that button click does a 'button.form.submit'. On the Server side there is a Button click event for this button, but for some reason it no longer fires. It worked fine before and everything...
10
2042
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...
5
13112
by: Ankur | last post by:
Hi Folks, I am new for this group. I want to clarify one thing what's a basic difference between Client Side Java Script and Server Side Java Script. how we can differentiate it. Why we called this kind of script "Server Side Java Script". I am in confusion because according to lots of web developer Java Script is a client side scripting language. We can not say it Server Side Java Script.
0
8428
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
8747
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...
1
8528
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8627
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...
1
6179
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
4175
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4335
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1976
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1737
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.