Ask a Question related to ASP.NET General, Design and Development.
-
Fraggle #1
Catching buttons in repeaters
*google wont let me post to
microsoft.public.dotnet.framework.aspnet.webcontro ls so thats why i
posted here*
I have a repeater that i want to have an ImageButton and a linkbutton
in.
I catch the click in the repeater using OnItemCommand=" to run a sub.
I then cast to a button to check the CommandName=" and do what ever
the button is meant to be doing.
However when it comes to the cast i have to use
Dim command As String = CType(e.CommandSource, linkButton).CommandName
but when i added the imagebutton to the repeater and knocked the cast
back to
Dim command As String = CType(e.CommandSource, Button).CommandName
It fails; i get a "Specified cast is not valid" error.
<asp:button> <asp:Linkbutton> <asp:Imagebutton> all inherit from
System.Web.UI.WebControls.WebControl this seems like a fairly bad way
of going about things! I would have a general button class, and
specialise it :(
Whats even weirder (to me anyway) is linkbutton comes off
System.Web.UI.WebControls.Image
Anyway where do i go from here? do i just have to do lots of "try
catch" to sort out which TYPE of button the user clicked, then check
the command name then do the action?
Thanks for any ideas
Fragg
Fraggle Guest
-
Repeaters and eventListeners
Ok, so I am close and I thank help on this yesterday. I have a page that has a repeating canvas with items inside the canvas. When the mouse enters... -
Conditional code in Repeaters
Here's my situation: I'm creating a blog-like application for my company to do some simple news updates about new products in and the like that... -
Nested datagrids or repeaters...etc.
Hi, Microsoft has this code sample that shows you how to do nested repeater controls. How would I change this ... -
Checkboxes with Repeaters and DataGrids
I am having trouble getting checkboxes to work within Repeaters and DataGrids I have tried to access the value of each checkbox within a repeater... -
Cascading repeaters
Hello Does anyone know if it is possible to use a Repeater control within another one and setting it's datasource dynamically? Example: ...



Reply With Quote

