473,387 Members | 3,750 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,387 software developers and data experts.

Button with multiple CommandArguments??

hi,

I'm wondering how I can achieve a button with a CommandArgument thats
dynamicly created from two or more DataBinder values, seperated with a ";"
so I can split the information up afterwards.
I've tried this (on the HTML page):

<asp:Button ID="NewButton" Runat="server" Text="New"
CommandName = "New"
CommandArgument ='<%# DataBinder.Eval(Container.Item, "ID")%> & ";" &
<%# DataBinder.Eval(Container.Item, "Name")%>'
</asp:Button>
With this code, I'll alway get an error msg. Can anybody help, please?

Thanks

Jan
Nov 18 '05 #1
2 2182
I think we need to see the bigger picture here Jan - what are you trying to
achieve with this behaviour - maybe we can spot alternative approaches.

Joe
"Jan Vetterli" <ja**@yahoo.com> wrote in message
news:10***************@fuchs.cyberlink.ch...
hi,

I'm wondering how I can achieve a button with a CommandArgument thats
dynamicly created from two or more DataBinder values, seperated with a ";"
so I can split the information up afterwards.
I've tried this (on the HTML page):

<asp:Button ID="NewButton" Runat="server" Text="New"
CommandName = "New"
CommandArgument ='<%# DataBinder.Eval(Container.Item, "ID")%> & ";" &
<%# DataBinder.Eval(Container.Item, "Name")%>'
</asp:Button>
With this code, I'll alway get an error msg. Can anybody help, please?

Thanks

Jan

Nov 18 '05 #2
Hi Joe

This button will be placed in a Datarepeater ctrl. I want to use the
information thats included in the CommandArgument to supply me with
information like: how many times this item has been clicked and the ID of
the selected content of the Datarepeater. I can not use the CommandName for
this since I need it allready to supply me with more information from the
database.

I've found a way around this by just get the ID and execute a database
lookup, read the field with the stored information on how many times it has
been clicked, add 1 and write the new total of the click counter back to the
database.

I just thought it would be faster and easier to supply the value of the
click counter in the Datarepeater, and I really think there must be a way to
include two information strings in the CommandArgument.

Jan

"Joe Molloy" <mo********@hotmail.com> schrieb im Newsbeitrag
news:OQ**************@TK2MSFTNGP10.phx.gbl...
I think we need to see the bigger picture here Jan - what are you trying to achieve with this behaviour - maybe we can spot alternative approaches.

Joe
"Jan Vetterli" <ja**@yahoo.com> wrote in message
news:10***************@fuchs.cyberlink.ch...
hi,

I'm wondering how I can achieve a button with a CommandArgument thats
dynamicly created from two or more DataBinder values, seperated with a ";" so I can split the information up afterwards.
I've tried this (on the HTML page):

<asp:Button ID="NewButton" Runat="server" Text="New"
CommandName = "New"
CommandArgument ='<%# DataBinder.Eval(Container.Item, "ID")%> & ";" & <%# DataBinder.Eval(Container.Item, "Name")%>'
</asp:Button>
With this code, I'll alway get an error msg. Can anybody help, please?

Thanks

Jan


Nov 18 '05 #3

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

Similar topics

5
by: Ron Brennan | last post by:
Good afternoon. The entire task that I'm trying to achieve is to allow a user to browse and upload multiple files simultaneously, hiding the Browse button of <input> tags of type="file" and...
3
by: Adam | last post by:
Hey guys, I've decided to stop banging my head against the wall and just ask you guys for the answer. I can't seem to find it. I have a form in which I have multiple submit buttons; only, I'm...
2
by: techfuzz | last post by:
I scoured this group and others looking for the best way to disable a button after the first click to prevent multiple submissions, but never did find anything that worked like they said it would. ...
3
by: Mark | last post by:
This is a solution... Often users want to keep clicking "submit" when they are waiting for server processing. Most apps these days like to disable the submit button to prevent this. You can't just...
3
by: Peter Vermilye | last post by:
How can I dynamically create buttons and wire them to an event handler? I have seen how I can add buttons to an event handler that are pre-created as part of the codebehind using AddHandler, but I...
16
by: Barry Gilmore | last post by:
Is there a way to disable a button after it is clicked? I am trying to avoid having someone click on it twice while they wait for it to process. Thank you!
2
by: mark | last post by:
Is there a means of raising an event when ANY button on a windows application form is clicked wherein the actual button clicked can be determined in the generic click events code (eg by way of...
4
by: SEliel | last post by:
Hello everyone: I'm programming a custom GridView, adding column by column dynamically. Every column is a TemplateField, and I've made a class hierarchy for each template (TextColumnTemplate,...
8
by: Willie | last post by:
Hi All; I have a form with multiple buttons and I would like to disable the buttons after the user clicks on the button to prevent multiple submitions. <input type="submit" name="return1"...
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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
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...

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.