Link to home
Start Free TrialLog in
Avatar of Mark Klein
Mark KleinFlag for United States of America

asked on

Updatepanel breaks gridview Edit on remote server

I am using a page with four sections that I would like to update independently, and also use Enter as a default button. I put updatepanel around each of them and all works well on my local machine including the default button. However running on the remote server the edit button in the gridviews inside the panels are unresponsive.

To test this, I removed the update panel around the "Details" section and  that immediately enabled the Edit buttons in the gridview.  Another symptom of this problem is the that the defaultbuttons set in the code behind, while working on my local machine, get that usual error "the default button of a panel must be...".

I am aware of the restrictions on updatepanels, including one on defaultbutttons set programmatically, which I do. I need to find a way to have the default buttons.

My environment: Visual Studio 2010, Windows Server 2008, .Net 4.0.  I've checked and rechecked the IIS configuration on the server to look for differences. There could be sections missing in the web.config file.

This application is available at 54.237.152.246. To see the problem, go to this URL.  Register as a seller, create a piece of equipment for sale, go to Seller Control and select that piece of equipment you have just listed.  The EquipmentDetails page that appears is the one in question.  There is a master page with a Script Manager on it operating.  The Details section, lower left, does not have an updatepanel set.  The Images, Notes, and the main section above the bottom three all have updatepanels.  The Edit button in the main section illustrates non-functional Edit button.  The Add Notes button in the Notes section, when clicked, illustrates the default button problems. I am attaching files
EquipmentDetails.aspx
EquipmentDetails.aspx.vb
Avatar of Mark Klein
Mark Klein
Flag of United States of America image

ASKER

I didn't discuss the other issue: why does the code work locally and not remotely? I've looked at the Ajax components on the server and other possible differences between the two environments, without finding anything.
Avatar of Nasir Razzaq
Have you tried to use developer tools in browser to see if any javascript errors are being thrown?
No.  How do I do that?  what do I use?

There is certainly use of js in this page, but why would it affect the code on my development server at AWS and not on my local machine?
If you can create a test page without any private info and post that to a public link we can look it over for you.

More than likely the issue is a js file is either not available on the live server or there is an error that your local version is forgiving and live isn't.  

It is also a good idea to check the validator http://validator.w3.org/ as javascript typically needs well formed html.

https://developer.chrome.com/devtools/index
https://developer.mozilla.org/en-US/docs/Tools
http://msdn.microsoft.com/en-us/library/ie/gg589507(v=vs.85).aspx
Progress report:
Site still broken. Ran offending page (which is visible on web; see my original post) through validator and fixed some stuff. Then noticed I was using jquery 1.7.min in some places, 1.7.1.min in others. Went through and tried to fix them all.

Encountered some strange stuff. A subsequent search of the entire project found several instances of 1.7.min in the MasterPage directory of Dynamic Data, even post Build the corrections, even though they had the latest datetime stamp.  How do the dynamic data files get created? They seemed to be significantly older versions of the master files. What do I need to do to have these files show the proper rev?  There are still some 1.7.min left in the Dynamic Data directory.
I have removed all references to jquery 1.7 instead of 1.7.1 from the Dynamic Data folder. However as near as I can tell, the master pages in the DD folder are not being used, certainly not on the offending page of my Web Application Project.

Since I compile locally and then ftp the compiled code to my development server at 54.237.152.246, it seems that all the local code is moved to the dev server.  One difference is that the local code is created w/ the Build menu, whereas on the dev server it's running the compiled code.

Compilation throws two warnings about overloads.  Could that be significant? One is the property ApplicationInstance in the base class Master Page. Do I need to address this?
You still have some issues.   To start with, you have a few html coding errors that do need attention.  Type your url to the validator for details http://validator.w3.org/ there are many, but the ones that are there are important.

You are also missing files. I have only played around with VS so I can't help there but I thought there was some type of publish button that sends everything.

With jquery, you should be on v1.1x at this point if you want to support older IE. Otherwise, 2.x.    

Once you can figure out how to get all of your files live, you will probably be ok.

User generated image
Scott, I appreciate your patience.  I'm an old geezer, >80, back programming for my son after literally 50+ years, so it's a struggle sometimes to catch up to what I should be doing.

I've run the validator on page in question multiple times, only now showing one error:
Line 160, Column 294: there is no attribute "language"
….aspx", false, false))" language="javascript" id="LoginView1_btnRegister"…

which I'm having difficulty understanding since it's probably referencing some module I can't find or see.

Your screen shot of the home page was very hard to read, even after enlargement. Looks like missing image files, yet the page renders properly and I can't figure out what directory those 484 errors are referencing.

How you publish in VS depends on type of project.  I need to ftp my whole project folder to the dev server.  I'm still looking for missing files.

Need to go out for a few hours now for an agility competition; back on line later today.
OK, I enabled the javascript console in Chrome, found several improperly referenced files, and am in process of correcting.  Stay tuned.
If you click on the image, you should see it full screen.  Here is the copy paste but you can get the same thing on your end.  

Failed to load resource: the server responded with a status of 404 (Not Found) http://54.237.152.246/~/CSS/HomePage_slidedeck.skin.css
Failed to load resource: the server responded with a status of 404 (Not Found) http://54.237.152.246/~/CSS/jquery.qtip.min.css
Failed to load resource: the server responded with a status of 404 (Not Found) http://54.237.152.246/~/Site.css
qTip2: Unable to locate content for tooltip! Aborting render of tooltip on element:  
e.fn.e.init[1]
 jquery.qtip.min.js:13
qTip2: Unable to locate content for tooltip! Aborting render of tooltip on element:  
e.fn.e.init[1]
 jquery.qtip.min.js:13
qTip2: Unable to locate content for tooltip! Aborting render of tooltip on element:  
e.fn.e.init[1]
 jquery.qtip.min.js:13
qTip2: Unable to locate content for tooltip! Aborting render of tooltip on element:  
e.fn.e.init[1]
 jquery.qtip.min.js:13
qTip2: Unable to locate content for tooltip! Aborting render of tooltip on element:  
e.fn.e.init[1]
 jquery.qtip.min.js:13
Failed to load resource: the server responded with a status of 404 (Not Found) http://54.237.152.246/CSS/back.png
Failed to load resource: the server responded with a status of 404 (Not Found) http://54.237.152.246/CSS/Images/SlidedeckBackgrounds/spines.png
Failed to load resource: the server responded with a status of 404 (Not Found) http://54.237.152.246/CSS/Images/SlidedeckBackgrounds/slides.png
Failed to load resource: the server responded with a status of 404 (Not Found) http://54.237.152.246/CSS/Images/SlidedeckBackgrounds/corner.png

Open in new window


In the validator I show 9 errors.  If you are using VS validator, try checking directly.  The important errors are things like the missing li tags.   Double check for every opening tag you have a closing tag and the closing tag should be in the same order it was opened.

<li><a href="/something/">link me</li></a> is not valid.   I know this is obvious, but a common error.

  http://validator.w3.org/
Error Line 285, Column 318: document type does not allow element "a" here; assuming missing "li" start-tag
…lay.aspx?EquipID=1044&quot;, false, true))">See details</a>&nbsp; &nbsp; &nbsp;
¿
Error Line 286, Column 33: end tag for "li" omitted, but OMITTAG NO was specified
                            </ul>  
¿
You may have neglected to close an element, or perhaps you meant to "self-close" an element, that is, ending it with "/>" instead of ">".

Info Line 285, Column 33: start tag was here
                                <a id="ContentPlaceHolder4_LinkButton2" href="j…
Error Line 301, Column 311: document type does not allow element "a" here; assuming missing "li" start-tag
…entDisplay.aspx?EquipID=760&quot;, false, true))">See details</a> &nbsp; &nbsp;
¿
Error Line 303, Column 29: end tag for "li" omitted, but OMITTAG NO was specified
                        </ul>  
¿
You may have neglected to close an element, or perhaps you meant to "self-close" an element, that is, ending it with "/>" instead of ">".

Info Line 301, Column 29: start tag was here
                            <a id="ContentPlaceHolder4_EqDetails1" href="javasc…
Error Line 318, Column 313: document type does not allow element "a" here; assuming missing "li" start-tag
…entDisplay.aspx?EquipID=998&quot;, false, true))">See details</a> &nbsp; &nbsp;
¿
Error Line 319, Column 29: end tag for "li" omitted, but OMITTAG NO was specified
                        </ul>  
¿
You may have neglected to close an element, or perhaps you meant to "self-close" an element, that is, ending it with "/>" instead of ">".

Info Line 318, Column 29: start tag was here
                            <a id="ContentPlaceHolder4_LinkButton1" href="javas…
Error Line 335, Column 313: document type does not allow element "a" here; assuming missing "li" start-tag
…aspx?EquipID=690&quot;, false, true))">See details</a>                        …
¿
Error Line 336, Column 29: end tag for "li" omitted, but OMITTAG NO was specified
                        </ul>  
¿
You may have neglected to close an element, or perhaps you meant to "self-close" an element, that is, ending it with "/>" instead of ">".

Info Line 335, Column 29: start tag was here
                            <a id="ContentPlaceHolder4_LinkButton3" href="javas…

Open in new window


The error you are referencing about "no language..." is where your rendered code looks like below.   Notice you have language="javascript" thrown in there.  That is not needed.
 <input type="submit" name="_ctl0:LoginView1:btnRegister" value="Register" onclick="javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions(&quot;_ctl0:LoginView1:btnRegister&quot;, &quot;&quot;, false, &quot;&quot;, &quot;register.aspx&quot;, false, false))" language="javascript" id="LoginView1_btnRegister" title="Register and then Login to bid or list equipment for sale" />

Open in new window

Scott, I really appreciate your patient explication of these errors.  Here's what I now know or have done:
--From the javascript console, I have cured all the Not Found references. There are still some warnings for references that I have not been able to access or understand, for ex those qtip2, e.fn.e references.  BTW, I see exactly what you see.
--That 'language ="javascript" is not code I wrote; it was auto-generated from I know not where
--The validator issues primarily came from the code for the home page slider.  Those <a> elements are also auto-generated.  I'm attaching the files
Default.aspx
FrontEnd.master
ASKER CERTIFIED SOLUTION
Avatar of Scott Fell
Scott Fell
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Making some progress.  I cured all the js problems along the way to the crucial page by updating to the latest version of qtip, and switching to a cdn for distribution.  Still working on validation
Substantial progress:
--The js problems are gone along the path to the crucial page.  I'm working on other places
--Pages go through the validator ok now too. Problems were stuff like buttons inside the anonymous template, etc.

BUT--still don't have the main problem working.  The problem solving assumption is that bad html or javascript was inhibiting the Ajax extensions. Can't invalidate that yet until I fix every problem in sight.

stay tuned, and I appreciate the help.  You were spot on about the validator problems.
That is really the best thing to do.  Even if it does not solve the issue at hand, you solved other problems.   With front end development, you have to get this stuff right to take away the possibility it is not in the code.
I'm clean w/ validator except for the login page, which is weird b/c I am using exactly the msdn example code.
I'm back to trying to solve my main problem, namely code working locally but not on remote host. I read in a few places, and you said too, that javascript problems will break it.

Well, I've found what may be a js problem. I think it could be js b/c it shows in the Chrome javascript console. This is a well-reported problem--defaultbutton must be of type IButtonControl.  However I can't find how to fix it.

Problem shows when I try to click an Edit button in a gridview.  That's the error msg that appears. Any suggestions?  Error doesn't appear locally, which is confusing.  I've checked the versions on both boxes a few times.
I logged in and couldn't use the "create new listing" button.   Can you just create the page without a log in and set it up so we can just surf to the page and see a listing?
here are some credentials:
markasboth
%&mark89

go to sell, then select the second piece of equipment, and try the edit button, or in the notes section, show the notes and then try edit.  This is my dev site, not production.  Add notes is broken b/c of stuff I've been doing.
Finally have this working, after an unmentionable amount of time.

I needed a defaultbutton to be set to avoid the <enter> key switching focus off the page. Multiple attempts to set it programmatically for each of the five panels on the page failed. I tried many combinations of FindControl, uniqueID, etc but could never get the code to "see" the button in question for each panel.

I changed tactics and resorted to a hack. In each panel I created a dummy button and hid it with CSS.  I identified these buttons as the defaultbutton when creating the panel inside the update panel. The click event for these buttons executed the necessary update or insert command.

This works both locally and on a remote server. Scott, many thanks for your suggestions.  --Mark
Greatly appreciate the patience working through the problem
Your welcome.  I'm glad it worked out.

I'm sorry I couldn't help more on the actual .net details.   Troubleshooting just takes time and and not getting frustrated.