문제

I'm quite new to html and asp.

The problem is that i've defined a textarea that resizes depending on the content it has (using javascript functions).

It works like a charm till i set that textarea to runat="server". Then the resizing doesn't work anymore.

Why is this? How can i fix it?

도움이 되었습니까?

해결책

This could be due to changed id of controls have runat="server", you can user ClientIDMode="static" if you are using framework 4 or above or use the ClientID instead of id of control.

Using ClientIDMode

<textarea id="TextArea1" cols="20" rows="2" runat="server" ClientIDMode="static" ></textarea>

Using ClientID

<textarea id="TextArea1" cols="20" rows="2" runat="server" ></textarea>

In javascript

  TextArea1 = document.getElementById("<%= TextArea1.ClientID %>");
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top