Last post Sep 23, 2011 04:12 AM by jagdish11
May 30, 2007 07:21 AM|khyatishah|LINK
I am having one web control label on webform. On chnage of textbox i am settting label.value = "change in textbox"
after on chnage event fire i am able to see label text is "change in textbox" But on click of button when i see label.value Its empty.
May 30, 2007 08:34 AM|Prerak Patel|LINK
Its so very easy.... please see the following code and put it into your aspx file.
document.getElementById("lableid").value = "change in text or whatever";
and set this function name against the onblur event of your textbox.... I guest you even need not to take the lable as server control as you can simply create a td or div tage and write the lable content into that using innerHTML.
I hope this will help.
May 30, 2007 11:32 AMfirstname.lastname@example.org|LINK
getElementById work with IE and new version of mozila, but with netsacpe it will not work. Also for Lable (html representation as SPAN/ Layer) dont have any attribute calles Value, so u have to use
innerHTML, in order to make ur scriptbrowser independant do like this
// check if browser is IE
document.getElementById("lableid").innerHTML = "change in text or whatever";
document.all('labelid').innerHTML ="hello word"
Jun 10, 2008 03:00 AM|danielszabo1981|LINK
I just wanted to drop a HUGE thank you for the info. Solved my problem!
Jun 11, 2008 12:18 PM|harish448|LINK
when control visibilty is false then i am not getting the value
which controls i have to use to store the values and use it javascirpt code
thanks in advance
Sep 05, 2011 12:56 PM|vivek.anandsingh|LINK
I have done Like this and working fine..
document.getElementById('lbl').innerHTML ='Showing 1-'+ count + ' of ' + document.getElementById('hdnCount').value+ ' Records'+'';
lbl- asp.net label control.
hdnCount- is HiddenField where i hv stored the value which i fetched from databse i.e. no. of total records in gridview.
'Showing 1-' - this user defined message
' of '-this user defined message
' Records'-this user defined message
Sep 07, 2011 07:40 AM|NilayMistry|LINK
User innerText to display text in label.
Sep 21, 2011 04:05 AM|Icychemist|LINK
Can I ask then,
Now, I need to take in the TEXT VALUE of the ASP LABEL from the SERVER side, is there anyway to do it?
Sep 23, 2011 03:54 AM|Icychemist|LINK
Manage to find an solution to my own question above.
Make use of System.Web.Services. [WebMethod] to get around it.
Sep 23, 2011 04:12 AM|jagdish11|LINK
document.getElementById("lableid").value = "Hello";