471,571 Members | 1,233 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,571 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 15396
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

Post your reply

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

Similar topics

5 posts views Thread by RobG | last post: by
11 posts views Thread by Brian D | last post: by
reply views Thread by zoltix | last post: by
6 posts views Thread by Shamin | last post: by
8 posts views Thread by chrisdude911 | last post: by
reply views Thread by XIAOLAOHU | last post: by
reply views Thread by lumer26 | last post: by
reply views Thread by lumer26 | last post: by

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.