Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / February 2008

Tip: Looking for answers? Try searching our database.

sending more parameter from imagebutton ....

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Adam Right - 12 Feb 2008 15:40 GMT
Hi All,

i am using CommandArgument of imagebutton in a Repeater for adding a item to
shopping basket, like that;
**************************
<asp:Repeater ID="Repeater1" runat="server"
OnItemCommand="Repeater1_ItemCommand">
<ItemTemplate>
<asp:ImageButton ID="addToBasket" runat ="server"  CommandArgument='<%#
DataBinder.Eval(Container.DataItem,"STOCK_CODE")%>'
           ImageUrl="Images/shop/addbasket_24.gif" />
</ItemTemplate>
</asp:Repeater>
**************************
and then, in code-behind, i catch the ItemCommand event of repeater for
adding item to basket with three parameters...
**************************
protected void Repeater1_ItemCommand(object source, RepeaterCommandEventArgs
e)
{
   string par1 = e.CommandArgument.ToString();
   Basket.AddItem(par1,par2,par3);
}
**************************
But i can get only one parameter from imagebutton.
Is it possible to send all params(par1,par2 and par3) via the
"CommandArgument"  ?

I mean, i have to get the all parameters(par1,par2,par3)  from
"ImageButton" to accomplish the process via the Basket.AddItem() method...

Any idea for sending more parameter via the imagebutton control or similar
way ?

Thanks.

Adam
Misbah Arefin - 12 Feb 2008 15:59 GMT
You could set the CommandArgument of the imagebutton to a comma seperated
list of values and in your ItemCommand split the e.CommandArgument this
would give you an array of values which you can pass in to your func (might
not be the best solution but it works)

--
Misbah Arefin

> Hi All,
>
[quoted text clipped - 33 lines]
>
> Adam

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.