I'm currently facing a challenging issue with my asp.net page that is causing me to pull out what's left of my hair.
This latest page I put together quickly for an internal database tool utilizes the standard VS 2010 design template, meaning it makes use of the site.master page. I mention this because it could be relevant to the problem at hand.
Instead of using input type="text"
, I have opted to use asp:textbox
controls. When one of these textboxes loses focus or 'blurs,' I need to execute a subroutine in the code-behind that performs a database lookup based on the textbox input.
All guidance I've come across suggests adding an asp:hiddenfield
to trigger the code-behind event for the lookup operation. To achieve this, I utilize the document.GetElementById
method within a JavaScript script to set the value in the hidden field like so:
document.GetElementById('HiddenInfo').value = "yada-yada"
.
The issue arises when the Visual Studio development environment fails to recognize the .value property for the GetElementById command. For instance, while typing and receiving code hints, the .value parameter does not appear in the suggestions list. See illustration:
As depicted, the '.v' criterion does not prompt the appearance of the .value parameter.
I attempted different approaches such as obtaining it by ClientID and utilizing jQuery, but all efforts were fruitless. What baffles me is that I successfully implemented a similar procedure in another web page I developed, albeit without the presence of a site.master page.
Hours of searching online have yielded no solutions that match my specific dilemma.
Any thoughts or suggestions would be greatly appreciated!
Thank you!