attribute concatenation problem

  • Thread starter Thread starter Pinkesh Achhodwala via .NET 247
  • Start date 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.
 
Hi,
write this code on the page load
btnRemove.Attributes.Add("OnClick", "alert(2);")
Hope it helps.
 
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);" />
 
Back
Top