Can anyone tells me how can I set value of asp:Label field with JavaScript?
Anton, ml.
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.583 / Virus Database: 369 - Release Date: 10.2.2004
"Anton ml. Vahčič" <anton....@campus.fri.uni-lj.si> wrote in message
news:uWFsGPW8...@TK2MSFTNGP12.phx.gbl...
That's good idea, but I don't want to have cookies behind my code... I
read somewhere that it can be done with RegisterHiddenField. I create a
hiddenfield even change value, but then how I read hidden field back to my
variable in asp.net program... Examples about it are not too perfect in MS
documentation.
Anton, ml.
"Dan" <d...@dontspam.com> wrote in message
news:u16tXAY8...@TK2MSFTNGP11.phx.gbl...
I believe you have to something like this:
var elMyElement = document.getElementByID("ElementName");
elMyElement.innerHTML = "your text here";
Adam
"Anton ml. Vahčič" <anton....@campus.fri.uni-lj.si> wrote in message news:<u2e909V8...@TK2MSFTNGP10.phx.gbl>...
<form id="frmMain" method="post" runat="server">
<asp:Label ID="lbl" Runat="server"></asp:Label>
</form>
private void Page_Load(object sender, System.EventArgs e)
{
this.RegisterStartupScript("initLabel", "<script>document.all['" +
lbl.ClientID + "'].innerText='some value';</script>");
}
Posted via DevelopmentNow.com Groups
http://www.developmentnow.com/g/
to get the client id of the server control you can also use
<%=myLabel.clientId%>
"asif" <mohamedib...@gmail.com> wrote in message
news:33798b54-a79c-4348...@developmentnow.com...