0

I am trying to get the actual HTML text for the control from the client browser because some of the info in this control don't show on the sever side special the "Style". So How can get the whole HTML text for a control?

kartal
  • 17,436
  • 34
  • 100
  • 145

1 Answers1

0
    <asp:TextBox ID="tb1" runat="server" OnChange="tbOnChange();" />
    <script type="text/javascript">
        function tbOnChange() {
            var tb1 = document.getElementById('tb1');
            alert(tb1.value);
        }
    </script>

EDIT: For get style in C#

ASP page:

<input type="text" id="tb1" runat="server" style="color:Red;" />

C# page:

    protected void Page_Load(object sender, EventArgs e)
    {
        var style = tb1.Style;
    }

Regards

k.

kintaro
  • 2,393
  • 2
  • 16
  • 16