ASP.Net 2.0 newbie questions

  • Thread starter Bartholomew Simpson
  • Start date
B

Bartholomew Simpson

I'm an experienced C/C++ programmer moving into ASP.Net website design.

Note: its the design issues more than the prog issues that I need help
most with.

I have the ff questions:

1). WYSIWIG design
When designing forms via the WYSIWYG designer, how can you be sure that
it will display correctly on (almost) all screen types (i.e. different
screen heights/widths etc)?

I would like to use the Designer if it means I wont have to learn CSS
(bcos designer is quicker, and I need to get a proj up and running ASAP).

2). How may I 'retrofit' CSS to a website - i.e. I have a website that
was developed by an ASP.net programmer. he was a good programmer but he
has NO eye for design. I would like to get a traditional website
designer to redesign the website using CSS. Is it possible to take a
copy of the static website (i.e. a snapshot of the gernrated pages) and
give that to a website DESIGNER, along with "excel mockups" of what the
the pages should look like, so he can he can write the required CSS
fuiles to position everything correctly on the pages, I will then take
the CSS files and 'link' them back into my dynamic pages - will this
work ? has anyone done this before ?


3). The MS ASP.Net site has several sample website toolkits. I notice
thoug, that the sample websites contain db schema (and possibly queries
etc) under the 'App_Data' folder. The tables are obviously generated
when the website is viewed in the browser (I am guessing that this is
the case - because the apps throw an exception when the SQL Server
engine is not running). However, it is not clear to me where the
generated tables are stored - what database are the tables stored in?
(no database name is specified in the SQL schema - AND I cant seem to
locate tables anywhere [using the table names in SQL statements]).
Are these temporary tables that are deleted after the website is no
longer being displayed in the browser?)


4). Is it possible to prevent the ".aspx" extension being displayed in
the web browser? (e.g. show http:/mywebsite.com/default INSTEAD of
http://mywebsite.com/default.aspx)

5). Is it possible to NOT show the IIS directory structure in the URl
(e.g. show http:/mywebsite.com/thepage.aspx INSTEAD of
http://mywebsite.com/dir1/dontlookhere/thepage.aspx) Or better still:
http:/mywebsite.com/thepage (no extension)

6).
Is there a way of showing a generic page for unhandled exceptions - and
DEFINITELY not showing the stack trace (default) - this is a "gift" to
hackers if they can see a stack trace and worse still the code snippet
that threw the exception - I need a way to prevent that from ever being
available to the viewing public at large.
 
J

Joe

1. short of testing everywhere, you can't.
2. In my experience, this needs to be done up front otherwise you're in for
some headaches. Not that it cant be done.
3. The samples run against SQL server express IIRC. The tables are
perssistent.
4. Yes - This can be set in IIS
5. Yes -- look up URL reqwriting (or check www.urlrewriting.net for a great
implementation)
6. Yep - you can specify error pages. If you're lazy, you can set the
web.config file to only ever show that information locally (see customErrors
in your web.config).

jor

Bartholomew Simpson said:
I'm an experienced C/C++ programmer moving into ASP.Net website design.

Note: its the design issues more than the prog issues that I need help
most with.

I have the ff questions:

1). WYSIWIG design
When designing forms via the WYSIWYG designer, how can you be sure that it
will display correctly on (almost) all screen types (i.e. different screen
heights/widths etc)?

I would like to use the Designer if it means I wont have to learn CSS
(bcos designer is quicker, and I need to get a proj up and running ASAP).

2). How may I 'retrofit' CSS to a website - i.e. I have a website that was
developed by an ASP.net programmer. he was a good programmer but he has NO
eye for design. I would like to get a traditional website designer to
redesign the website using CSS. Is it possible to take a copy of the
static website (i.e. a snapshot of the gernrated pages) and give that to a
website DESIGNER, along with "excel mockups" of what the the pages should
look like, so he can he can write the required CSS fuiles to position
everything correctly on the pages, I will then take the CSS files and
'link' them back into my dynamic pages - will this work ? has anyone done
this before ?


3). The MS ASP.Net site has several sample website toolkits. I notice
thoug, that the sample websites contain db schema (and possibly queries
etc) under the 'App_Data' folder. The tables are obviously generated when
the website is viewed in the browser (I am guessing that this is the
case - because the apps throw an exception when the SQL Server engine is
not running). However, it is not clear to me where the generated tables
are stored - what database are the tables stored in? (no database name is
specified in the SQL schema - AND I cant seem to locate tables anywhere
[using the table names in SQL statements]).
Are these temporary tables that are deleted after the website is no longer
being displayed in the browser?)


4). Is it possible to prevent the ".aspx" extension being displayed in the
web browser? (e.g. show http:/mywebsite.com/default INSTEAD of
http://mywebsite.com/default.aspx)

5). Is it possible to NOT show the IIS directory structure in the URl
(e.g. show http:/mywebsite.com/thepage.aspx INSTEAD of
http://mywebsite.com/dir1/dontlookhere/thepage.aspx) Or better still:
http:/mywebsite.com/thepage (no extension)

6).
Is there a way of showing a generic page for unhandled exceptions - and
DEFINITELY not showing the stack trace (default) - this is a "gift" to
hackers if they can see a stack trace and worse still the code snippet
that threw the exception - I need a way to prevent that from ever being
available to the viewing public at large.
 
A

Alan Silver

Bartholomew said:
I'm an experienced C/C++ programmer moving into ASP.Net website design.

Be prepared to unlearn a lot of the things you took for granted about
application interaction and design. MS may want us all to believe that
designing for the web is the same as designing for the desktop, but it
isn't.
Note: its the design issues more than the prog issues that I need help
most with.

I have the ff questions:

1). WYSIWIG design
When designing forms via the WYSIWYG designer, how can you be sure that
it will display correctly on (almost) all screen types (i.e. different
screen heights/widths etc)?

Don't try. This is a classic mistake made by many people. You will drive
yourself mad, and make the user experience very unpleasant. You need to
understand that the web is a fluid medium, and your web pages should
adapt to that. Don't design for any specific font, font size, window
size, window ratio etc.

I know this is hard, but it doesn't take too much learning, and it will
save you a LOT of frustration and testing.
I would like to use the Designer if it means I wont have to learn CSS
(bcos designer is quicker, and I need to get a proj up and running
ASAP).

The WYSIWYG designer produces poor (X)HTML and is better avoided. Write
your own (X)HTML and validate it at every stage. That is the best way to
ensure that your app will be seen at its best by the maximum number of
people. It will also help greatly with...
2). How may I 'retrofit' CSS to a website - i.e. I have a website that
was developed by an ASP.net programmer. he was a good programmer but he
has NO eye for design. I would like to get a traditional website
designer to redesign the website using CSS. Is it possible to take a
copy of the static website (i.e. a snapshot of the gernrated pages) and
give that to a website DESIGNER, along with "excel mockups" of what the
the pages should look like, so he can he can write the required CSS
fuiles to position everything correctly on the pages, I will then take
the CSS files and 'link' them back into my dynamic pages - will this
work ? has anyone done this before ?

What you want is part way there, but is going to be hard. Having a
designer do a CSS-based design is a very good idea, as it enables you to
concentrate on the semantic structure of the output. You can use ASP.NET
controls to insert the content in the right places.

In theory, if the designer produces a CSS-based design, you should be
able to take his/her files and insert the right controls in place of the
dummy content that he/she will presumably use. Your code-behind, which
is conveniently separate from the files that the designer hands you will
handle inserting the content into those controls.
4). Is it possible to prevent the ".aspx" extension being displayed in
the web browser? (e.g. show http:/mywebsite.com/default INSTEAD of
http://mywebsite.com/default.aspx)

The example you showed doesn't need any extension, it could just be
http://www.mywebsite.com/ without the "default" or "default.aspx"

I'm not sure you can just get away without any .aspx extension, as IIS
needs to know to route the requests through the ASP.NET engine, and the
..aspx extension signals that. Sure you can set IIS to route *all*
requests through ASP.NET, but that's not such a great idea.

Why does this bother you so much? Unless users are going to be typing in
URLs, such as ones seen in printed adverts, then the extension isn't
really an issue. If they do need short URLs to type in, just have
something like http://www.mywebsite.com/ferrets where "ferrets" is a
folder containing a default.aspx page that redirects to the real URL.
5). Is it possible to NOT show the IIS directory structure in the URl
(e.g. show http:/mywebsite.com/thepage.aspx INSTEAD of
http://mywebsite.com/dir1/dontlookhere/thepage.aspx) Or better still:
http:/mywebsite.com/thepage (no extension)

Sure, you can use virtual directories or URL rewriting. I'm not sure why
you would want to bother in the example you showed though. Why not just
make the IIS structure like the one you want to be shown?
6).
Is there a way of showing a generic page for unhandled exceptions - and
DEFINITELY not showing the stack trace (default) - this is a "gift" to
hackers if they can see a stack trace and worse still the code snippet
that threw the exception - I need a way to prevent that from ever being
available to the viewing public at large.

Set this in IIS. Showing the stack trace is a sign that the programmer
hasn't done a very good job. Exceptions should be handled as close to
source as possible, so a generic page is rarely necessary. You can add
code to global.asax to catch any unhandled exceptions, and that can then
make sure the user sees something friendly and of no significance for
hackers.

HTH
 
M

Mark Rae

The WYSIWYG designer produces poor (X)HTML and is better avoided. Write
your own (X)HTML and validate it at every stage. That is the best way to
ensure that your app will be seen at its best by the maximum number of
people.

Absolutely! I (almost) never use Design view when creating aspx pages...

Tools, Options, Text Editor, HTML, Validation should be set to XHTML 1.0
Transitional or XHTML 1.1
 

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

Top