ASP.NET: Accessing a Tag with C#

  • Thread starter msnews.microsoft.com
  • Start date
M

msnews.microsoft.com

Hi,

IN ASP.NET PAGE I HAVE DEFINED THE DIV TAG AS FOLLOWS:I want to access the
value in the code behind(c#) .

<div align="left" autopostback = true class="clsTitle"
style="VISIBILITY:hidden" id="HiddenFlag" runat="server"></div>

I am accessing the div tag in the code behind as follows:

string aa = "<SCRIPT FOR=window EVENT=onload LANGUAGE='JScript'>var a;a =
confirm('Shift is not Valid :" + aBE.Reason + " Do u want to override shift
validation warning message?');document.all." +
e.Item.FindControl("btnAdd").ClientID + ".click();HiddenFlag.innerText =
a;</SCRIPT>";

Page.RegisterStartupScript("tt",aa);

Althogh when i user alert(a) in the script it return true/false But when i
try to access the InnerHtml property as following i always get empty string.

if (HiddenFlag.InnerHtml == "true")

{

}

What is wrong i am doing it.

THANKS

EKTA





Please let me know what i am doing wrong
 

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,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top