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

calling javascript function in link button click

1
Hi All,

I am using a java script function for opening a pop up window in a link button click. And I am able to call the function at link button's second click only. I am not able to call the java scritp at its first clic. Except this java script call, any thing i can do at first click itself. I have tried many alternatives..but no use...can any one hep me?

I have tried in two ways :

1) lnkShipper.Attributes.Add("onClick", "javascript:ShipperAddress();");(in client side)
2)lnkShipper.Attributes.Add("onClick", "window.open('ShipperDetails.aspx',null,'height=30 0,width=600,status=yes,toolbar=no,menubar=no,locat ion=no');"); (in code behind)



please advice
May 10 '07 #1
2 15492
Paulson
63
Hi All,

I am using a java script function for opening a pop up window in a link button click. And I am able to call the function at link button's second click only. I am not able to call the java scritp at its first clic. Except this java script call, any thing i can do at first click itself. I have tried many alternatives..but no use...can any one hep me?

I have tried in two ways :

1) lnkShipper.Attributes.Add("onClick", "javascript:ShipperAddress();");(in client side)
2)lnkShipper.Attributes.Add("onClick", "window.open('ShipperDetails.aspx',null,'height=30 0,width=600,status=yes,toolbar=no,menubar=no,locat ion=no');"); (in code behind)



please advice
Hi Lintas,

I read your problem.I am not a programming

expert but still what I think the problem is that

1. You are adding the function attribute to linkclick only on

link click

-->[That is when you first click the link only the attribute
is added]

2. Then on the next click it is already there so it works

properly (Hope you got the meaning of what I meant).


So what I would suggest is that you try adding it on

-->onload<-- instead of -->onclick()<--

I dont know if this will solve your problem but please check out.

Bye keep the good work going bye Paulson
May 10 '07 #2
Hi All,

I am using a java script function for opening a pop up window in a link button click. And I am able to call the function at link button's second click only. I am not able to call the java scritp at its first clic. Except this java script call, any thing i can do at first click itself. I have tried many alternatives..but no use...can any one hep me?

I have tried in two ways :

1) lnkShipper.Attributes.Add("onClick", "javascript:ShipperAddress();");(in client side)
2)lnkShipper.Attributes.Add("onClick", "window.open('ShipperDetails.aspx',null,'height=30 0,width=600,status=yes,toolbar=no,menubar=no,locat ion=no');"); (in code behind)



please advice
well y u dnt try this code at the palce of ur JS code caing
lnkShipper.Attributes.Add("onClick", "javascript:window.open('Address of ur Aspx page,' ','status=yes,menubar=no,,scrollbars=1,height=850, width=600') ");
May 10 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: RobG | last post by:
I am trying to get users to fill in a form on a web page, then click a button to send an e-mail. I am using JavaScript to get the fields from the form, then run a mailto command to put the...
11
by: Brian D | last post by:
I have been searching for a while to find an answer to this and I must be searching on the wrong keywords. Below is a snippet of my form. There are other form items on it, but I need to submit...
18
by: Simula | last post by:
I am developing an HTML javascript application and I want to preserve state in a way that can be book-marked. I chose HTML anchors as a means of preserving state. When the application changes...
0
by: zoltix | last post by:
Hi, I am beginner in aspx. I would like to intercept all click events on my document. I use this function in javascipt for that document.onmousedown=click;. It works well. But I would...
1
by: Steven | last post by:
Hello, I have a Javascript function which will get executed only when I click a Image Button on my aspx page (code behind - C#). C# InImgBut on click function --> {...
6
by: Shamin | last post by:
Hi, Thanks in advance for answering to my Question. I'm stuck with this problem and would really appreciate any help. I have 2 aspx files (Main.aspx and ReportViewer.aspx). Main.aspx has a...
1
by: Jorge Ponte | last post by:
hi I have a Web User Control (ascx) - lets call it "My_WUC" - in a Web form. In that WUC I want have a textbox and a button. I want to click on the button and open a popup (I use javascript for...
4
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...
8
by: chrisdude911 | last post by:
how do i add video into a javascript web page with my own custom buttons?
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: 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
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
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...

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.