I've been experiencing an issue where VS isn't editing the designer to include new controls I create in source view. This is happening for pages that have been almost completed. I've gone back to change a <tr> tag to run from the server, and it won't recognize
it. I also added 7 labels, and it didn't recognize those as well. Has anyone experienced this? Installing the hotfix help at all? Has this been logged?
Brian
"Trust in the Lord and do what is good; dwell in the land and live securely. Take delight in the Lord, and He will give you your heart's desires" (Psalm 37: 3-4).
Sometimes lack of idle time prevents VS from doing background processing such as compilation. One identified issue was with Wireless Mouse driver broadcasting messages too often. If you are using wireless mouse, try switching to wired one and see if it helps.
If you "view source" in the web browser, you'll see that the ID attribute of the textbox isn't "compEmailTextBox".
When the control is rendered, ASP.Net prepends a value to the ID to ensure that it is unique.
You can access that value via the "ClientID" property (ex. compEmailTextBox.ClientID) (in your server code, not in the javascript).
Sometimes lack of idle time prevents VS from doing background processing such as compilation. One identified issue was with Wireless Mouse driver broadcasting messages too often. If you are using wireless mouse, try switching to wired one and see if it helps.
This definitely isn't the issue...
Brian
"Trust in the Lord and do what is good; dwell in the land and live securely. Take delight in the Lord, and He will give you your heart's desires" (Psalm 37: 3-4).
Try this below; note the change to document.getelementbyid:
function checkButton_onclick()
{
alert ("hey");
var st=document.getElementById("<%= compEmailTextBox.ClientID %>");
alert ("st value "+st.value); // error comes that object not
// defined, although it is defined.
return (true);
}
Brian
"Trust in the Lord and do what is good; dwell in the land and live securely. Take delight in the Lord, and He will give you your heart's desires" (Psalm 37: 3-4).
function ResetImage(imageName)
{
if(imageName=='inbox')
{
document.getElementById('inboxImage').src="~/images/inbox.gif";
}
}
</script>
</asp:Content>
Have you understood my problem?
VS2008VS 2008 IntellisenceVS2008 Wed DeploymentVisual Studio 2008Visual Studio 2008 javascript support external scriptsAJax VS 2008 conversion problemViisual Studio 2008VS2008 Web Sites/Applications
function ResetImage(imageName)
{
if(imageName=='inbox')
{
document.getElementById('inboxImage').src="~/images/inbox.gif";
}
}
</script>
</asp:Content>
Have you understood my problem?
VS2008VS 2008 IntellisenceVS2008 Wed DeploymentVisual Studio 2008Visual Studio 2008 javascript support external scriptsAJax VS 2008 conversion problemViisual Studio 2008VS2008 Web Sites/Applications
bmains
All-Star
29116 Points
5886 Posts
MVP
Can't Reference New Controls By ID
Mar 25, 2008 04:05 PM|LINK
I've been experiencing an issue where VS isn't editing the designer to include new controls I create in source view. This is happening for pages that have been almost completed. I've gone back to change a <tr> tag to run from the server, and it won't recognize it. I also added 7 labels, and it didn't recognize those as well. Has anyone experienced this? Installing the hotfix help at all? Has this been logged?
"Trust in the Lord and do what is good; dwell in the land and live securely. Take delight in the Lord, and He will give you your heart's desires" (Psalm 37: 3-4).
scommisso
Member
670 Points
139 Posts
Re: Can't Reference New Controls By ID
Mar 25, 2008 04:07 PM|LINK
This happens to me all the time in VS.NET SP1, usually toggling between Design and Source view fixes it for me.
MCSD.NET, MCPD: EAD
grundt
Member
35 Points
26 Posts
Re: Can't Reference New Controls By ID
Mar 25, 2008 04:31 PM|LINK
I've been having the same problem ... see my post in this forum: controls not added to designer.cs
And, unfortunately, I've found no solution or workaround.
( " toggling between Design and Source view " doesn't work for me, in this situation )
Mikhail Arkh...
All-Star
33139 Points
6083 Posts
Microsoft
Re: Can't Reference New Controls By ID
Mar 25, 2008 05:56 PM|LINK
Sometimes lack of idle time prevents VS from doing background processing such as compilation. One identified issue was with Wireless Mouse driver broadcasting messages too often. If you are using wireless mouse, try switching to wired one and see if it helps.
------------------------------------------------------------
This posting is provided "AS IS" with no warranties, and confers no rights.
sheri_nust
Member
2 Points
2 Posts
Problem in accessing object by its ID using JavaScript in VS 2008/ i m using master pages
Mar 26, 2008 02:54 PM|LINK
Hey,
I m using master pages in VS 2008
This is my java script code and I am invoking this function on onclick of a button,
function checkButton_onclick()
{
alert ("hey");
var st=document.getElementById("compEmailTextBox");
alert ("st value "+st.value); // error comes that object not
// defined, although it is defined.
return (true);
}
“compEmailTextBox” is id of textbox,
But when I want to access it and display its value through alert (),
The null value is displayed,
And when I debug the code,
Error displays that “object compEmailTextBox is not found”.
I have defined that object but while debugging JavaScript code that error comes.
Please can anyone help me out because I am doing final year project and I am stuck in this hell.
The reason I think is that I am using Ajax Tabbed Pane inside a form tag, that might cause problem or using master pages can cause error.
Can anyone tell the correct reason.
Thanks
grundt
Member
35 Points
26 Posts
Re: Problem in accessing object by its ID using JavaScript in VS 2008/ i m using master pages
Mar 26, 2008 03:26 PM|LINK
If you "view source" in the web browser, you'll see that the ID attribute of the textbox isn't "compEmailTextBox".
When the control is rendered, ASP.Net prepends a value to the ID to ensure that it is unique.
You can access that value via the "ClientID" property (ex. compEmailTextBox.ClientID) (in your server code, not in the javascript).
bmains
All-Star
29116 Points
5886 Posts
MVP
Re: Can't Reference New Controls By ID
Mar 26, 2008 04:12 PM|LINK
This definitely isn't the issue...
"Trust in the Lord and do what is good; dwell in the land and live securely. Take delight in the Lord, and He will give you your heart's desires" (Psalm 37: 3-4).
bmains
All-Star
29116 Points
5886 Posts
MVP
Re: Problem in accessing object by its ID using JavaScript in VS 2008/ i m using master pages
Mar 26, 2008 04:15 PM|LINK
Try this below; note the change to document.getelementbyid:
function checkButton_onclick()
{
alert ("hey");
var st=document.getElementById("<%= compEmailTextBox.ClientID %>");
alert ("st value "+st.value); // error comes that object not
// defined, although it is defined.
return (true);
}
"Trust in the Lord and do what is good; dwell in the land and live securely. Take delight in the Lord, and He will give you your heart's desires" (Psalm 37: 3-4).
sheri.champ
Member
4 Points
2 Posts
Re: Problem in accessing object by its ID using JavaScript in VS 2008/ i m using master pages
Apr 01, 2008 08:53 PM|LINK
Thanks a lot,the problem which i told you was because of some other mistake.
I have some what same problem again.
I m using nested master pages, in MainMaster.master page i have html,body and form tag with runat="server" attribute.
The ChildMaster.master page which extents from MainMaster.master page have image tag
<img runat="server" alt="" id="inboxImage" height="20" width="134" src="~/images/inbox.gif" onmouseover="SwitchImage('inbox')" onmouseout="ResetImage('inbox')" />
I m calling the two functions SwitchImage and ResetImage.As
<script type="text/javascript" language="javascript">
function SwitchImage(imageName)
{
if(imageName=='inbox')
{
document.getElementById('inboxImage').src="~/images/inboxOver.gif";
}
}
function ResetImage(imageName)
{
if(imageName=='inbox')
{
document.getElementById('inboxImage').src="~/images/inbox.gif";
}
}
</script>
Now i m stucked up that where i have to use this code,B/c
when i use this code in MainMaster.master page as below,then "Error:object expected" comes
<asp:ContentPlaceHolder id="head" runat="server">
<script type="text/javascript" language="javascript">
function SwitchImage(imageName)
{
if(imageName=='inbox')
{
document.getElementById('inboxImage').src="~/images/inboxOver.gif";
}
}
function ResetImage(imageName)
{
if(imageName=='inbox')
{
document.getElementById('inboxImage').src="~/images/inbox.gif";
}
}
</script>
</asp:ContentPlaceHolder>
Also when i use the same code in ChildMaster.master page as below,then "Error:document.getElementById() is null or not an object" comes
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
<script type="text/javascript" language="javascript">
function SwitchImage(imageName)
{
if(imageName=='inbox')
{
document.getElementById('inboxImage').src="~/images/inboxOver.gif";
}
}
function ResetImage(imageName)
{
if(imageName=='inbox')
{
document.getElementById('inboxImage').src="~/images/inbox.gif";
}
}
</script>
</asp:Content>
Have you understood my problem?
VS2008 VS 2008 Intellisence VS2008 Wed Deployment Visual Studio 2008 Visual Studio 2008 javascript support external scripts AJax VS 2008 conversion problem Viisual Studio 2008 VS2008 Web Sites/Applications
sheri.champ
Member
4 Points
2 Posts
Re: Problem in accessing object by its ID using JavaScript in VS 2008/ i m using master pages
Apr 01, 2008 08:53 PM|LINK
Thanks a lot,the problem which i told you was because of some other mistake.
I have some what same problem again.
I m using nested master pages, in MainMaster.master page i have html,body and form tag with runat="server" attribute.
The ChildMaster.master page which extents from MainMaster.master page have image tag
<img runat="server" alt="" id="inboxImage" height="20" width="134" src="~/images/inbox.gif" onmouseover="SwitchImage('inbox')" onmouseout="ResetImage('inbox')" />
I m calling the two functions SwitchImage and ResetImage.As
<script type="text/javascript" language="javascript">
function SwitchImage(imageName)
{
if(imageName=='inbox')
{
document.getElementById('inboxImage').src="~/images/inboxOver.gif";
}
}
function ResetImage(imageName)
{
if(imageName=='inbox')
{
document.getElementById('inboxImage').src="~/images/inbox.gif";
}
}
</script>
Now i m stucked up that where i have to use this code,B/c
when i use this code in MainMaster.master page as below,then "Error:object expected" comes
<asp:ContentPlaceHolder id="head" runat="server">
<script type="text/javascript" language="javascript">
function SwitchImage(imageName)
{
if(imageName=='inbox')
{
document.getElementById('inboxImage').src="~/images/inboxOver.gif";
}
}
function ResetImage(imageName)
{
if(imageName=='inbox')
{
document.getElementById('inboxImage').src="~/images/inbox.gif";
}
}
</script>
</asp:ContentPlaceHolder>
Also when i use the same code in ChildMaster.master page as below,then "Error:document.getElementById() is null or not an object" comes
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
<script type="text/javascript" language="javascript">
function SwitchImage(imageName)
{
if(imageName=='inbox')
{
document.getElementById('inboxImage').src="~/images/inboxOver.gif";
}
}
function ResetImage(imageName)
{
if(imageName=='inbox')
{
document.getElementById('inboxImage').src="~/images/inbox.gif";
}
}
</script>
</asp:Content>
Have you understood my problem?
VS2008 VS 2008 Intellisence VS2008 Wed Deployment Visual Studio 2008 Visual Studio 2008 javascript support external scripts AJax VS 2008 conversion problem Viisual Studio 2008 VS2008 Web Sites/Applications