Markup syntax for inserting button's client id into onclick event?

B

Bogdan

Hi,

A button in aspx is as follows:

<asp:Button ID="FinishButton" runat="server" CommandName="MoveComplete"
Text="Finish"
OnClientClick="scheduleDisable('???');" />

Is there a way to declaratively replace ??? with the button's client ID?
I'm looking for something like '<% FinishButton.ClientID %>' which obviously
is wrong.

I could easily do it programmatically but I need to use markup in this case.

Thanks,
Bogdan
 
B

Bogdan

Mark,

Thanks for the quick reply. Unfortunately your suggestion did not work for
me.
It renders as: onclick="scheduleDisable('&lt;%=FinishButton.ClientID%>');

Any thoughts?
Thanks,
Bogdan
 
E

Eliyahu Goldin

The id doesn't have to come from server side:

OnClientClick="scheduleDisable(this.id);"


--
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin


Bogdan said:
Hi,

A button in aspx is as follows:

<asp:Button ID="FinishButton" runat="server" CommandName="MoveComplete"
Text="Finish"
OnClientClick="scheduleDisable('???');" />

Is there a way to declaratively replace ??? with the button's client ID?
I'm looking for something like '<% FinishButton.ClientID %>' which
obviously is wrong.

I could easily do it programmatically but I need to use markup in this
case.

Thanks,
Bogdan




__________ Information from ESET NOD32 Antivirus, version of virus
signature database 4094 (20090521) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com


__________ Information from ESET NOD32 Antivirus, version of virus signature database 4094 (20090521) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,053
Latest member
BrodieSola

Latest Threads

Top