asp.net - Values of ASP labels in JavaScript -


I have ASP.NET label control which I use to pass text / string value from my C # backend I am

  function changeTab () click on the {var tab.   

= Document.getElementById ('& lt;% = searchType.Text%>'). Text content; If (tab == "official") {$ ('# tab-container') Easytabs ('Select', '# Tab 1-Officer'); Alert ("it was removed: 4"); } And {$ ('# tab-container'). Easytabs ('Select', '# Tab1-Company'); Alert ("it was removed: 5"); }

As far as I know, var tab is missing the value from my label What am I doing wrong?

I think what you want is this:

  Var tab = document.getElementById ('& lt;% = searchType.ClientID% & gt;'). Internal HTML;   

Use ClientID to get a label ID, which is then used as a parameter for getElementById is. Once you have a label, you will find the text of the label on the internal HTML property.


Comments

Popular posts from this blog

apache - 504 Gateway Time-out The server didn't respond in time. How to fix it? -

c# - .net WebSocket: CloseOutputAsync vs CloseAsync -

c++ - How to properly scale qgroupbox title with stylesheet for high resolution display? -