attribute concatenation problem

  • Thread starter Pinkesh Achhodwala via .NET 247
  • Start date
P

Pinkesh Achhodwala via .NET 247

hi all, please see the followin line :

<input type="submit" name="btnRemove" value="Remove" onclick="if (typeof(Page_ClientValidate) == 'function') Page_ClientValidate(); " language="javascript" id="btnRemove" class="button" onClick="alert(2);" />

In above line, u can see that onclick event is called twice. why it is so?
If i want to concatenate it, what should i do?
Please reply me, if u have the solution.
Thanks.
 
G

Guest

Hi,
write this code on the page load
btnRemove.Attributes.Add("OnClick", "alert(2);")
Hope it helps.
 
A

adnan boz

Hi,
Concatenate all of your code in a js function.
Sample is below.

Good Luck
Adnan

<input ... onclick="myclick();" ... >

<script language=javascript>
function myclick(){
if (typeof(Page_ClientValidate) == 'function')
Page_ClientValidate();
alert(2);
}
<script>



Pinkesh Achhodwala via .NET 247 said:
hi all, please see the followin line :

<input type="submit" name="btnRemove" value="Remove" onclick="if
(typeof(Page_ClientValidate) == 'function') Page_ClientValidate(); "
language="javascript" id="btnRemove" class="button" onClick="alert(2);" />
 

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

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,175
Latest member
Vinay Kumar_ Nevatia
Top