473,781 Members | 2,732 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

C#: CodeBehind and Code Re-Use Using Inheritance in windows applications

Hi

Is there a way to seperate code of interface in windows applications
for various design purposes? Just like it can be done in ASP.NET, one
code can be inherited in different skins with different design.

Sincerely
Del

May 19 '06 #1
10 1822
of course there is a way. It is called layered application. usualy
layers are
DAL - Data Access Layer,
BL - Business Layer
PL - Presentation layer

DAL and BL are contained in Class library projects. You can have in on
solution Class library project with BL and DAL and Winform or\and Web
Application for Presentation layer.

I hope this helps
Galin Iliev[MCSD.NET]
www.galcho.com

May 19 '06 #2
Thanks Galcho for your response! Can you drop an example of building
layered application in studio 2005?

May 19 '06 #3
"Expert C# Business Objects" is a good place to start reading, and a
handy investment.

Our implementation using the new System.Windows. Forms.BindingSo urce as
the base class for our business object. I believe you must be using
..Net 2.0 to take advantage of this.

Now our business object can be used as a datasource for any data bound
control, and we can put our business logic into the class. For example,
our business object has an Update() method that validates the data, then
calls writes the changed data back to the database. If validation
fails, the record is flagged in error. A detail form with an error
provider on it can then display the appropriate error message.

It isn't really possible to send you code examples because 1) I'm not
sending out proprietary code ad 2) It would take quite a while to put
together an example for you.

If you still aren't sure how to proceed, you might consider contracting
a local consultant for a couple hours just to get you started. That's
what I did, and it was money very well spent.

Gary

ja*****@gmail.c om wrote:
Hi

Is there a way to seperate code of interface in windows applications
for various design purposes? Just like it can be done in ASP.NET, one
code can be inherited in different skins with different design.

Sincerely
Del

May 19 '06 #4
Well, i thought that it would be as easy as in asp.net, where you just
inherit the code in aspx page.

May 19 '06 #5
I posted item with attachment but I am not sure if web based reader
would show posting

you could you Outlook Express instead (if you do not get it)

regards
Galin Iliev[MCSD.NET]
www.galcho.com

May 19 '06 #6
There may be an easier method, but this is the one that I use. The nice
thing about using such an approach is that even though you invest more
"up front" time, your payoff is enormous because the right business
object can be used for so much more than just presenting data to your
constituents. We've gotten application creation down to the point of
creating an application shell, running the application, and then
configuring the datasources at runtime with a propertygrid. Essentially
the entire app is the XML config file saved from propertygrid.

This saves a lot of time because I won't need to spend much time messing
with application interfaces now. Instead, I can focus on database
design and playing hockey at lunch time.

Delorean wrote:
Well, i thought that it would be as easy as in asp.net, where you just
inherit the code in aspx page.

May 19 '06 #7
You are right, cant see item, and as this is my first day here in
discussion group, not sure how to get it thru Outlook Express :/ :)
Maybe you could send it to my email? ja*****@gmail.c om

May 19 '06 #8
This sounds like an engine, that you gain the programmatical result
without programming. Actually thats why i am interesting how to get
various interfaces under one code-behind (for different projects there
might be different design)

May 19 '06 #9
I get failure when I try to send mail to stated address

Regards
Galin Iliev[MCSD.NET]
www.galcho.com

May 20 '06 #10

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

Similar topics

2
2649
by: varun_789 | last post by:
hello friend, while developing an application, i encountered a subtle point. for a aspx page, what is the difference between src property and codebehind property ? src stands for code-behind class to compile where as
2
2484
by: Francisco Carvalho | last post by:
I have created a user control that gets loaded by a page. The user control has a codebehind, but when I change the code on the codebehind, it never runs. If on the other hand a run the same code on the .ascx file it runs with no problems. The directive(see below) was added automatically by VS.NET so I can't seam to know what the problem is. Any thoughts? Francisco
4
2418
by: Boban Dragojlovic | last post by:
I create a new webform (I always use codebehind), and I insert some server-side controls into the form (the ASPX) Later, I switch to codeview, and I notice that some (sometimes all) of the controls I created have been automatically defined for me in the #Region " Web Form Designer Generated Code " section Later, when I add more controls this no longer happens. First, I'm wondering which of my actions causes it to no longer do this;
12
1653
by: Karl Hungus | last post by:
If I use a code behind class for an aspx page, what is the best way to get data from the codebehind class into my aspx page? I know about databinding, but is there a more basic way of just referencing the variables or calling getters? thanks in advance
0
1236
by: Tigrou | last post by:
Hello, I'm searching for a solution who permit me to create an TemplateColumn in a DataGrid into codebehind... I found only solution for create it into the ASPX code... My problem is to find a solution for add ImageButton controls into this column, for now my code is: Dim colSupp As New TemplateColumn
2
3126
by: Tigrou | last post by:
Hello, I'm searching for a solution who permit me to create an TemplateColumn in a DataGrid into codebehind... I found only solution for create it into the ASPX code... My problem is to find a solution for add ImageButton controls into this column, for now my code is: Dim colSupp As New TemplateColumn
7
2222
by: Jack | last post by:
Hello, What is the difference between SRC and CODEBEHIND Tags? Example <%@ Page Language="vb" ValidateRequest="false" AutoEventWireup="false" Codebehind="WebForm1.aspx.vb" %> or
10
1383
by: Arsalan | last post by:
Where is Codebehind usually uploaded? Suppose I have aspx pages containing codebehind in different directories for e.g myweb/aaa myweb/bbb Where do i store the compiled codebehind?
1
1529
by: Antoine | last post by:
I have a pretty quickish question about ASPX with codebehind. I have done an exhaustive search of the web so no go there. I was hoping to reach out for some help here. Anyway, I have a really nicely working javascript replace going on with multiple data items databinded to an aspx web form so that I am theoretically much simplifying the data sent back from the codebehind (literally values such as 1,2,3 that can define which webpage to go...
4
1943
by: simon | last post by:
have an image (acting like a button) currently that has onMouseOver and onMouseOut events. want to make this accessible to the codebehind with a click event. was able to right click at and choose "run as server control", when i double click it then to put code in the codebehind, there is no function there for me to fill in. i made up one called goButton_Click and handles gobutton.click that didn't work, didn't recognize the name i gave...
0
9639
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
9474
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
10143
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8964
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...
0
6729
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5375
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4040
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
3633
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2870
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.