Friday, 15 May 2015

asp.net - Javascript variable's “Value” property does not come up on the Intellisense Insted show Value of -



asp.net - Javascript variable's “Value” property does not come up on the Intellisense Insted show Value of -

hello new java scripts.

i wanted implement function in asp.net webpage. used separate .js file in project , called header section of asp.net web page.

here function want implement.

function uservalid() { var name; name = document.getelementbyid("txtname").value; if (name == '') { alert("please come in name"); homecoming false; } homecoming true; }

but probelem when after typing document.getelementbyid("txtname"). ( shows valueof() instead of value.

this textbox code

<asp:textbox id="txtname" runat="server" width="250" autocomplete="off"></asp:textbox>

what missing here?

it not matter shows not great help in java-script in visual studio. doing right thing.

also should using clientid instead of direct "txtname"

name = document.getelementbyid("<%= txtname.clientid %>").value;

more detail on clientid here http://msdn.microsoft.com/en-us/library/system.web.ui.control.clientid(v=vs.110).aspx

more reference of using intelligence in visual studio http://msdn.microsoft.com/en-us/library/bb385682.aspx

javascript asp.net

No comments:

Post a Comment