473,386 Members | 1,699 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

PHP & MySQL to C# .NET

Hello,

Maybe a common case, but I really want to not so much as migrate from
PHP/MySQL to C# .NET but learn the new language.

I have made maybe 3/4 very simple systems using C# .NET, but they all
seem to be a little, well simple -- and not uniform at all.

When I use PHP, I always incorperate some kind of template system, so,
say I have a master template and a child template which is loaded
inside the master.

I am aware of the ASP 2.0 master page functionality, but upgrading to
VS.NET 2005 right now isn't really an option; so I'm going to have to
stick with 2003.

Could anybody shed some light on how I would go about maintaining a
constant feel to all my aspx pages? An alternative to the master page
functionality in 2005 perhaps?

Any help at all would be much appreciated!

Thanks,
Nick

Nov 17 '05 #1
7 1851
Hello Nick,

I use WebUserControls for header, footer, menus and other items that should
be the same on all pages. Very similar to using PHP's include() function (I
also come from a PHP & MySQL background).

Regards,
Andrei Pociu

"Nick Bolton" <ni**@renhome.net> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
Hello,

Maybe a common case, but I really want to not so much as migrate from
PHP/MySQL to C# .NET but learn the new language.

I have made maybe 3/4 very simple systems using C# .NET, but they all
seem to be a little, well simple -- and not uniform at all.

When I use PHP, I always incorperate some kind of template system, so,
say I have a master template and a child template which is loaded
inside the master.

I am aware of the ASP 2.0 master page functionality, but upgrading to
VS.NET 2005 right now isn't really an option; so I'm going to have to
stick with 2003.

Could anybody shed some light on how I would go about maintaining a
constant feel to all my aspx pages? An alternative to the master page
functionality in 2005 perhaps?

Any help at all would be much appreciated!

Thanks,
Nick

Nov 17 '05 #2
Andrei,

Thanks for the reply! Glad to know I'm not the only lost developer from
a PHP background.

I just read a very interesting article on user controls and custom
controls by a guy called Solomon Shaffer (www.15seconds.com). I
reccomed anybody to have a look.

http://www.15seconds.com/issue/020319.htm
http://www.15seconds.com/issue/020430.htm

Glad I stumbled across this, it's shed a lot of light on the subject.
But what I still can't understand is why Microsoft have decided to
include "Master pages" in the .NET 2.0 framework. What's the
difference...? Is it just easier to use?

Nov 17 '05 #3
I believe master pages are a different concept, they don't seem similar to
WebUserControls:

ASP.NET 2.0 introduces a new concept known as Master Pages, in which you
create a common base master file that provides a consistent layout for
multiple pages in your application. To create a Master Page, you identify
common appearance and behavior factors for the pages in your application,
and move those to a master page.
http://www.devx.com/dotnet/Article/18042

I haven't tried them yet but I'm planning to soon.

Don't give up on ASP.NET even though some things might differ a lot from
PHP, after you get the hang of it, you'll see it was worth it ;).

Regards,
Andrei Pociu
"Nick Bolton" <ni**@renhome.net> wrote in message
news:11**********************@g14g2000cwa.googlegr oups.com...
Andrei,

Thanks for the reply! Glad to know I'm not the only lost developer from
a PHP background.

I just read a very interesting article on user controls and custom
controls by a guy called Solomon Shaffer (www.15seconds.com). I
reccomed anybody to have a look.

http://www.15seconds.com/issue/020319.htm
http://www.15seconds.com/issue/020430.htm

Glad I stumbled across this, it's shed a lot of light on the subject.
But what I still can't understand is why Microsoft have decided to
include "Master pages" in the .NET 2.0 framework. What's the
difference...? Is it just easier to use?

Nov 17 '05 #4
Hello

The master template can be done with ASP 1.0, but you will have to implement
it yourself, and you will not have WYSIWYG from VS2003 that VS2005 provides
with master pages.
The idea is make one .aspx page with a PlaceHolder control, then override
the CreateChildControls method to dynamically load and add a user control
(.ascx) file to the PlaceHolder. Determining what .ascx file to use can be
done by query strings, url rewriting and reading the path, or any other
method.

Best regards,
Sherif

"Nick Bolton" <ni**@renhome.net> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
Hello,

Maybe a common case, but I really want to not so much as migrate from
PHP/MySQL to C# .NET but learn the new language.

I have made maybe 3/4 very simple systems using C# .NET, but they all
seem to be a little, well simple -- and not uniform at all.

When I use PHP, I always incorperate some kind of template system, so,
say I have a master template and a child template which is loaded
inside the master.

I am aware of the ASP 2.0 master page functionality, but upgrading to
VS.NET 2005 right now isn't really an option; so I'm going to have to
stick with 2003.

Could anybody shed some light on how I would go about maintaining a
constant feel to all my aspx pages? An alternative to the master page
functionality in 2005 perhaps?

Any help at all would be much appreciated!

Thanks,
Nick

Nov 17 '05 #5
Sherif,

Nice idea, if it works, it sure beats loading several UserControls on
to a page at once, then just switching the visability.

How would I go about creating a new UserControl from a path? Don't they
have to be registered on the aspx page?

For example, say I wanted to load in "/Pages/Home.ascx" and assign it
to currentPage (which is a UserControl object). What method would I use
to do this?

Nov 17 '05 #6
Serif,

Found the LoadControl method, which works perfectly. Apart from one
minor detail, which I cant seem to fix...

Controls within my called UserControl don't seem to work... at all. Any
ideas why not? No errors are returned, the control just seems to not
bother running the associated event then posts nothing back to the
page.

InitializeComponent is however run, and the event controler for the
control is added, but as I said, nothing is actually run when a button
is clicked for example.

Nov 17 '05 #7
Well, third and final post in a row I should hope. Solved the problem!
All thanks to a top guy called Denis Bauer. He created a Control called
"DynamicControlsPlaceholder".

The issue I had yet to discover was that when I posted back to my page,
all the Controls with my PlaceHolder weren't being saved to the
viewstate. This means that the events could never actually be fired as
the UserControl had dissapeared.

As you may have guessed, the DynamicControlsPlaceholder solved this
very nicely indeed by... You guessed it, saving the view state.

http://www.denisbauer.com/ASPNETCont...aceholder.aspx

Nov 17 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: AF | last post by:
I am a real novice to php and MySQL, with about a week's worth of reading and self tutoring. I have an urgent need to publish a database of information and need some guidance on how to do this. ...
12
by: Sarah Tanembaum | last post by:
Though I installed MySQL5 and PHP5, how come my phpinfo() shows as follow: MySQL Support enabled Active Persistent Links 0 Active Links 0 Client API version 3.23.57 <<<<<<<<<<<<<<< ...
5
by: Raju V.K | last post by:
I am developing a web site which requires a set og unique values be transferred between pages and server many times. There fore i decided to put the values in an array so that only one reference to...
0
by: Jeremy Booker | last post by:
I installed the current stable release of MySQL from RPMs. I used the client and server packages. After installing the server package, the RPM printed a note saying I should run two commands. I...
0
by: Jamie Krasnoo | last post by:
Will placing Apache::RequestRec & Apache::RequestIO & APR::Table in startup.pl to load them up for multiple handlers have any bad side effects? I noticed that when I load them via startup.pl the...
4
by: MLH | last post by:
A programmer developed an AMP (Apache/MySQL/PHP) application for me. When he was done, he sent me the PHP files and the MySQL dump file. Now, when I connect to the application on my LAN using...
3
by: 21novembre | last post by:
Hi all, I made a question several days before to describe my strange trouble of mysqldump. But I still can't figour it out. Well, I just want to ask another question whether I could just backup...
2
by: zhengfish | last post by:
Hi,All, I try to install mysql-5.0.15 on RHEL3-U5. But It give me a error. MySQL-client-standard-5.0.15-0.rhel3.i386.rpm MySQL-devel-standard-5.0.15-0.rhel3.i386.rpm...
6
by: John Wells | last post by:
Guys, My boss has been keeping himself busy reading MySQL marketing pubs, and came at me with a few questions this morning regarding PostgreSQL features (we're currently moving to PostgreSQL). ...
3
by: subho2009 | last post by:
Hello friends, I have face a problem, the problem is that when i fetch data from mysql database i get '&' in the place of '&amp;'. I am using php 5.1.2 and mysql version 5.0.11-beta. What is the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.