Splitting up long asp.net page

  • Thread starter Thread starter eggie5
  • Start date Start date
E

eggie5

So, my asp.net page is getting pretty long and hard to manager. It's
reached 1000 lines and i would like to break it up somehow.

Is there some way I can make separate parts of my pages to
separate .aspx pages and have asp.net stitch them back-together at
runtime? PHP's include does something link this.

Any ideas?
 
So, my asp.net page is getting pretty long and hard to manager. It's
reached 1000 lines and i would like to break it up somehow.

Is there some way I can make separate parts of my pages to
separate .aspx pages and have asp.net stitch them back-together at
runtime? PHP's include does something link this.

Any ideas?

NO DEAR!!!
 
NO DEAR!!!

Hi...

Google Reader is managing long page quite well...
they did used ajax and very smart way to show data...
as the user scrolldown google reader populate rest of the page using
ajax...

if you have too large page... why dont you make the content split in
seperate potion..
and use multiview to show the content porstion by portion...

you perhaps you can use ajax...

but please do check out the google reader first...

Thanks
Munna
www.kaz.com.bd
http://munnacs.110mb.com
 
Hi...

Google Reader is managing long page quite well...
they did used ajax and very smart way to show data...
I'm talking about the html, not the rendered page in the browser.
 
So, my asp.net page is getting pretty long and hard to manager. It's
reached 1000 lines and i would like to break it up somehow.

Is there some way I can make separate parts of my pages to
separate .aspx pages and have asp.net stitch them back-together at
runtime? PHP's include does something link this.

You might do better to ask yourself *why* your page is getting so long that
you're finding it so hard to manage...

Are you trying to cram too much information on the page? Maybe you should be
thinking about a redesign which will break this page up into two or more
other pages to make it easier for you to manage and to avoid bombarding your
browsers with information overload...
 
eggie5 said:
So, my asp.net page is getting pretty long and hard to manager. It's
reached 1000 lines and i would like to break it up somehow.

Is there some way I can make separate parts of my pages to
separate .aspx pages and have asp.net stitch them back-together at
runtime? PHP's include does something link this.

Any ideas?

You may consider creating user controls for those parts
of your page that form an entity.

User controls are the equivalent of includes.
 
Do you mean the .ASPX presentation side or the code-behind?

If it's presentation side, such as tables, controls, etc... consider reviewing
your code to find duplications in effort--where you do the same thing over
and over again (such as tables) and create a custom control that you can
pass data or parameters. If you have common controls, such as headers and
such, these are also good candidates for custom controls. Controls are somewhat
similar to an legacy ASP #include or PHP's include--reusable code, but better.
:)

If your actual code-behind is growing quite large, determine if you can separate
it out into other class files and reference these file in your code-behind.

A good place to start, if user control match what you're looking for, is
Google. Or, experimenting on your own--create a new custom control put some
HTML in it, such as <h1>Hello, world!</h1> and drag it onto your existing
web form. When it renders, you'll see your text.

HTH.

-dl
 
No it's not that. I just need suggestions on how to segment out pieces
of my page to different file and then have asp.net stitch it back
together at runtime. Like how PHPs include works.
 
No it's not that. I just need suggestions on how to segment out pieces
of my page to different file and then have asp.net stitch it back
together at runtime. Like how PHPs include works.

You've already received a suggestion to use UserControls, which would
function in a very similar way to includes...
 
So, my asp.net page is getting pretty long and hard to manager. It's
reached 1000 lines and i would like to break it up somehow.

Is there some way I can make separate parts of my pages to
separate .aspx pages and have asp.net stitch them back-together at
runtime? PHP's include does something link this.

Any ideas?

User controls are your friends. Especially used in conjunction with
caching ...
 
RE:
<< I just need suggestions on how to segment out pieces of my page to
different file and then have asp.net stitch it back together at runtime.
Like how PHPs include works >>

ASP.NET just doesn't offer the same thing as PHP includes, which are similar
to SSIs in classic ASP.

If you want to break it up as you are intending, then you'll have to write
some code to do it. Others in this thread have pointed out the building
blocks you'd use (user controls) and there are other ways (you could
position Literal controls and then inject a string containing the HTML you
want; with that string being populated by code you write that reads from a
file on disk. This would, basically, give you something very similar to the
includes you are looking for. You'd just have to roll your own.

-HTH
 
Bob Johnson said:
RE:
<< I just need suggestions on how to segment out pieces of my page to
different file and then have asp.net stitch it back together at runtime.
Like how PHPs include works >>

ASP.NET just doesn't offer the same thing as PHP includes, which are
similar to SSIs in classic ASP.

If you want to break it up as you are intending, then you'll have to write
some code to do it. Others in this thread have pointed out the building
blocks you'd use (user controls) and there are other ways (you could
position Literal controls and then inject a string containing the HTML you
want; with that string being populated by code you write that reads from a
file on disk. This would, basically, give you something very similar to
the includes you are looking for. You'd just have to roll your own.

Bob, for the rest of us, what are the differences between User Controls and
PHP includes? I've used User Controls to replace SSI includes, which you say
are similar to PHP includes.
 
Hi John,

RE:
<< which you say are similar to PHP includes>>
Hummm, I thought I said they weren't the same thing and then pointed the OP
to user controls or Literals populated from code-behind.... Maybe I
shouldn't have said he would "have to write code..."
 
Bob, I think I must have replied to the wrong post (or else I replied while
half-asleep).

--
John Saunders [MVP]


Bob Johnson said:
Hi John,

RE:
<< which you say are similar to PHP includes>>
Hummm, I thought I said they weren't the same thing and then pointed the
OP to user controls or Literals populated from code-behind.... Maybe I
shouldn't have said he would "have to write code..."
 
Back
Top