Results 1 to 2 of 2

Thread: How to get Label1.Text value

  1. #1

    Thread Starter
    Hyperactive Member buddu's Avatar
    Join Date
    Jul 2001
    Location
    India
    Posts
    446

    How to get Label1.Text value

    hi
    I have a Simple problem but i cannot able to find the solution.
    Problem is I have a Label1 in my form and When i click the radio button i am changing the Lable1 value through Javascript. but this changed value does't not going to the Server side.. Why?

    This is my Code
    Code:
    <%@ Page Language="VB" %>
    <script runat="server">
     Sub GoForm(s as Object,e as EventArgs)
          response.write (Label1.Text)
          response.end
        End Sub
    </script>
    <html>
    <body>
    <form runat="server">
        <input onclick="Change()" type="radio" name="SelRadio"/>
        <asp:Label runat="server" id="Label1" Text="Label1"/>
        <asp:Button runat="server" Text="Button" onClick="GoForm" />
    </form>
    <script language="javascript">
      function Change()
      {
       document.all["Label1"].innerText ="Testing"
       document.all["Label1"].Text ="Testing"
       document.all["Label1"].value ="Testing"
     } 
    </script>
    </body>
    </html>
    Last edited by buddu; Oct 10th, 2002 at 01:02 AM.
    prasad

  2. #2
    Hyperactive Member
    Join Date
    Dec 2001
    Location
    Dublin, Ireland
    Posts
    262
    Not sure about this one but try setting enableviewstate=false for the label control.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width