ASP.NET: Accessing a Tag with C#

Discussion in 'ASP .Net' started by msnews.microsoft.com, Jul 22, 2003.

  1. 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
    msnews.microsoft.com, Jul 22, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Alek Davis
    Replies:
    15
    Views:
    7,153
    Scott M.
    Nov 12, 2009
  2. Soren S. Jorgensen

    Accessing a ASP (not .NET) session from ASP.NET

    Soren S. Jorgensen, Jan 20, 2006, in forum: ASP .Net
    Replies:
    5
    Views:
    388
    Soren S. Jorgensen
    Jan 21, 2006
  3. jstack
    Replies:
    1
    Views:
    589
    Tor Iver Wilhelmsen
    Jul 4, 2003
  4. kishan bisht

    struts tag inside a tag

    kishan bisht, Jul 8, 2003, in forum: Java
    Replies:
    1
    Views:
    1,477
    Wendy S
    Jul 9, 2003
  5. shruds
    Replies:
    1
    Views:
    759
    John C. Bollinger
    Jan 27, 2006
Loading...

Share This Page