Here's another one that's got me ripping what's left of my hair out.
My latest asp.net page is something I just threw together for an in-house database tool. It uses the standard VS 2010 design template, which means it uses the site.master page. I mention this because it may be relevant to my problem.
I'm using asp:textbox
controls instead of input type="text"
. When one textbox 'blurs,' I need to run a sub in code-behind that will do a database lookup based on the information typed in the textbox.
Everything I see about this is that I need to add a asp:hiddenfield
to trigger the code-behind event to do the lookup. So I use document.GetElementById
method in a JavaScript script to set the value in the hidden field. What it's supposed to do is: document.GetElementById('HiddenInfo').value = "yada-yada"
.
My problem is that the VS development environment doesn't recognize the .value property for GetElelmentById command. For example, as is its wont, VS will give code hints as you type. When I get to where I want to insert the .value parameter, it doesn't show up on the list of suggestions. See illustration:
As you can see, typing the v doesn't bring up the .value parameter.
I've tried getting it by ClientID and by using jquery, and nothing works. The crazy thing is that I have done this before with anther web page I developed, but the only difference is that one did not have a site.master page.
I've spent hours trying to find the answer online, and nothing is quite exactly the same as my problem.
Any ideas?
Thanks!