473,657 Members | 2,554 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1864
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.n et> wrote in message
news:11******** **************@ f14g2000cwb.goo glegroups.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.n et> wrote in message
news:11******** **************@ g14g2000cwa.goo glegroups.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 CreateChildCont rols 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.n et> wrote in message
news:11******** **************@ f14g2000cwb.goo glegroups.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.

InitializeCompo nent 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
"DynamicControl sPlaceholder".

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 DynamicControls Placeholder 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
3360
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. This question might be more suited to a MySQL newsgroup, but since php and MySQL seem to have become almost married to one another, and since getting the data out and displaying it is where my problem seems to lie, I thought I would start with...
12
3614
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 <<<<<<<<<<<<<<< Instead of saying 3.23.57, shouldn't it show 5.xx.xx? Or, did I do something wrong?
5
7608
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 the array is needed ratherthan idividual reference. The situation is like this: When the page is loaded based on the user input say 6 values are created like character1="tom", character2="jerry", Character3="micky", Character4="donald",...
0
1843
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 only got the first one, which was # ./mysqladmin -u root --password I assume this gave the root user a password. I then downloaded and proceeded to compile the Perl DBI and DBD:mysql packages. The DBI package installed fine after I also...
0
1618
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 handlers that use them don't complain that they don't have the use statements within the module code and still work as normal. Jamie Krasnoo --
4
2799
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 http://192.168.1.106/~mlh/credifree/index.php the AMP app still thinks the data resides somewhere else. It runs fine - as long as I leave my LAN's external internet connection up. But if I unplug my LAN from the world, my app locks up. Before I...
3
4691
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 my databases by copying the data folder to some place? Then if I meet some disaster, could I just copy the backup folder back to recover my databases? Thank you. Zh.y
2
6698
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 MySQL-server-standard-5.0.15-0.rhel3.i386.rpm MySQL-shared-standard-5.0.15-0.rhel3.i386.rpm MySQL-standard-debuginfo-5.0.15-0.rhel3.i386.rpm
6
2014
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). While I don't think either are really that important for our situation, he wanted to know specifically whether PostgreSQL supported SQL:2003, and what sort of capabilities PostgreSQL has to scale across multiple CPUs and hosts (multithreading,...
3
3542
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 problem? any body solve my problem? Please answer me. Thanks in advance!
0
8392
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8305
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8823
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8503
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7321
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6163
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
1
2726
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1950
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1607
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.