Javascript from Datagrid won't fire

G

Guest

I have a datagrid with a linkbutton for editing. I'm trying to run some
javascript when the link button is clicked to show a wait message. Everything
works fine the first time after the page loads but on subsequent postbacks,
the script does not run.

The following code is inlcuded in the the ItemDatabound sub in the code
behind.

dim l as linkbutton
if e.item.itemType = ListItemType or e.Item.ItemType = AlternatingItem then

l = ctype(e.item.Cells(0).FindControl(lnkbutEdit"), LinkButton)
l.attributes.Add("onclick", "return busyBox.Show();")

end if

Thanks
 
S

S. Justin Gengo

Mardy,

When are you adding the script to the page? Or does it exist in a .js file?

It may be that the script isn't being output on postbacks.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
 
G

Guest

The script is referenced from a .js file.

S. Justin Gengo said:
Mardy,

When are you adding the script to the page? Or does it exist in a .js file?

It may be that the script isn't being output on postbacks.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
 
S

S. Justin Gengo

Mardy,

Is there any difference between the html output the first time as compared
to after a postback? If there is a difference could you show the html that
is being output?

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
 
G

Guest

Arghhh

I found the problem. I am using a component for scrolling the datagrid. I
took it out to test an alternative scrolling mechanism and that solved my
javascript problem.

Thanks Justin
 
G

Guest

Yes Patrick

I had a control on the page that was apparently interferring with my script.

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top