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

  • Thread starter Thread starter Bogdan
  • Start date Start date
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
 
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
 
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
 
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
 
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
 
Back
Top