Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

Problem with asp+ (Buttons with images and eventhandlers in repeat)

I'm having a bit of trouble getting the behavior I want with a button in a
repeat element.
I want each item in the repeat to have it's own button with the same
graphic and handler, with a value or name set to a unique ID (to know which
one to process).

IE.

<viewbutton> <delbutton> Doc 1
<viewbutton> <delbutton> Doc 2
<viewbutton> <delbutton> Doc 3

Clicking any of the 3 viewbuttons calls viewdochandler, the 3 viewbuttons
have an identifier to say which doc should be processed (In a value, or name
attribute).

The problem.
Using <button ...> results in the handler receiving an htmlbutton object
as the source, which prevents access to name, value, text, etc; but results
in a nice button with graphic on it.

Using <input type=image... > results in a nice button, but a
compiler error stating that the default handler type of public void
xxxxx(Object src, EventArgs E) is the wrong signature. I am unable to find
any indication of what signature is desired.

Using <input type=submit...> results in not getting an image on the
freaking button.

Steve
[1239 byte] By [Steve] at [2007-11-9 16:23:50]
# 1 Re: Problem with asp+ (Buttons with images and eventhandlers in repeat)
Well, I found I can get these from the Attributes collection on
HtmlControl. They just aren't implemented as nicely as they are on the
HtmlInputButton.

"Steve" <spetty@a2corp.com> wrote in message news:399c0ca2@news.dev-archive.com...
> I'm having a bit of trouble getting the behavior I want with a button in
a
> repeat element.
> I want each item in the repeat to have it's own button with the same
> graphic and handler, with a value or name set to a unique ID (to know
which
> one to process).
>
> IE.
>
> <viewbutton> <delbutton> Doc 1
> <viewbutton> <delbutton> Doc 2
> <viewbutton> <delbutton> Doc 3
>
> Clicking any of the 3 viewbuttons calls viewdochandler, the 3
viewbuttons
> have an identifier to say which doc should be processed (In a value, or
name
> attribute).
>
> The problem.
> Using <button ...> results in the handler receiving an htmlbutton object
> as the source, which prevents access to name, value, text, etc; but
results
> in a nice button with graphic on it.
>
> Using <input type=image... > results in a nice button, but a
> compiler error stating that the default handler type of public void
> xxxxx(Object src, EventArgs E) is the wrong signature. I am unable to
find
> any indication of what signature is desired.
>
> Using <input type=submit...> results in not getting an image on the
> freaking button.
>
> Steve
>
>
Steve at 2007-11-11 23:26:20 >