All i am trying to do is to have a button which when clicked should change the text of a label.
following is the code:
this is in the header section of the aspx page.
function faisal()
{
var a1 = document.getElementById('<%= Label1.ClientID %>');
document.getElementById('<%= Label1.ClientID %>').Text = "hello";
return false;
}
the following code is in the code behind file
private void Page_Load(object sender, System.EventArgs e)
{
Button1.Attributes.Add("onclick","return faisal()");
}
when i press the button, nothing happens.
if i add an alert box inside the javascript function, it displays the alert box but the text of the label doesnt change.
any ideas?
Thanks
Faisal Siddiqui