slow page load - empty code behind

M

Martin Eyles

Hi,

I have a .aspx page, but have not done any codeBehind for it. I use
javascript to open this page, and on my development server this is fine.
However, when I copy all the files to another server, and try running the
same thing there, the page takes an age to load. (Note, the pop-up window
opens quickly, but it takes a long time before the page opens in the
pop-up).

Does anyone have any idea why this is happening? Is there a problem with the
way I am deploying the application (copying the files in a folder in my
wwwroot to the other pc's wwwroot)?

Thanks,
Martin
 
M

Martin Eyles

Also, I've noticed one of my scripts doesn't work on one PC, but works on
another. After investigating, found that on one server, the form my script
references gets the id "__aspnetForm" and on the other it gets the id
"Menu1_Form1". Any ideas why the form name have different IDs?
 
M

Marina Levit [MVP]

It sounds like ASP.NET is restarting. Is this only the first time that
takes so long, right after you copy - or every time?
 
M

Martin Eyles

Marina Levit said:
It sounds like ASP.NET is restarting. Is this only the first time that
takes so long, right after you copy - or every time?

It is quicker after the first time. Thanks for pointing this out.

This is however was masking another problem, which I have put in a reply to
the original message. any help there would also be appreciated.

Martin
 
M

Marina Levit [MVP]

Sorry, I've never heard of something like that happening. I don't know why
the server would be generating a different name for the form based on the PC
the request came from, unless you have some code there to change this.

I would put together a very simple page, and see if the problem still
happens. If not, I would see what this page is doing that would cause this
type of effect.
 
M

Martin Eyles

OK, I have taken a look at the system. The way it works is that there is a
page, and 1 custom control. The main page doesn't have a form, but the
control does. The name of the form on my development server is __aspnetForm,
and the name of the form on the server I deploy to is of the form
controlInstanceName_Form1.

Does this help the diagnosis?

Thanks,
Martin
 
M

Marina Levit [MVP]

What if someone placed 2 of these controls on one page? You would end up
with 2 server side forms - which you can't have.

The typical way this is handled, is to have the form on the page, and the
user control, or web control, is simply placed on the page and becomes part
of its form.
 
M

Martin Eyles

Marina Levit said:
What if someone placed 2 of these controls on one page? You would end up
with 2 server side forms - which you can't have.

Why not?
The typical way this is handled, is to have the form on the page, and the
user control, or web control, is simply placed on the page and becomes
part of its form.

OK, will try this, and will hopefully work. Thanks.
 
M

Martin Eyles

Martin Eyles said:
OK, will try this, and will hopefully work. Thanks.

Works beautifully. I now have a form with id="Form1" on all pages.

Once again, thanks! :)

Martin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top