473,396 Members | 2,108 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,396 software developers and data experts.

OnClientClick pass parameter from databinding

Hi,

I am trying to do something like this:
<asp:Button ID="cmdExploder" runat="server"
OnClientClick='javascript:ButtonPressed(<%# Container.DataItem %>);'
Text="testing" />
Of course this is a little simplistic. Assume this code is in a
datalist and the databinding will be the primary key of some record.
The purpose is to give the client side javascript the ID.

The problem I am having is that I can't figure out how to wrap the <%#
%> stuff properly with quotes or whatever. It doesn't actually databind
it just shows the literal in the page source.

Any thoughts?

thanks in advance.

Randy
Apr 10 '06 #1
0 2016

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

Similar topics

2
by: Nathan Sokalski | last post by:
I am using a SortedList as my DataSource. However, one of the things I am using the data for is to generate the URL for the HyperLinks in my DataList. Therefore, I need to use the result of a...
0
by: JSantora | last post by:
Essentially, InsertAT is broken! For the past couple of hours, I've been getting this "Parameter name: '-2147483550' is not a valid value for 'index'." error. Apparently, its caused by having...
4
by: Steve | last post by:
<script language=javascript> function selectFile(fileUrl) { if(navigator.appName.indexOf('Microsoft')!=-1) window.returnValue=fileUrl; else window.opener.setAssetValue(fileUrl); self.close();...
0
by: jtencate | last post by:
I am trying to add an OnClientClick event to links in an asp:Menu. I tried using a StaticItemTemplate to bind the MenuItem data to a LinkButton with an OnClientClick attribute. This works fine to...
5
by: Dan | last post by:
Hi, i try to redirect to another aspx page with jscript. I use "OnClientClick" but nothing happens. I tried two ways. What am i doing wrong? Thanks Dan ....
3
by: Phil | last post by:
Hi, I'm a little confused about the precedence of actions between OnClientClick and OnClick. In this example, what will be executed first and why? Thanks Phil in code-behind:...
1
by: cir9 | last post by:
I know that I can add: return confirm(Are you sure?') to a button and have the button eventhandler action taken if they choose yes, but is there any good way to also cause a postback and...
3
by: Brad Baker | last post by:
I have a formview with a datasource that contains a select and update command. The select statement works fine but the update command doesn't seem to be working. After some troubleshooting I have...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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?
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
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,...
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...
0
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...
0
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,...

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.