Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

.NET Forum


You are currently viewing our .NET Forum as a guest. Please register to participate.
Login



Reply
multiple coding files into ONE aspx file
Old 11-09-2008, 04:38 AM multiple coding files into ONE aspx file
Nazi370's Avatar
Skilled Talker

Posts: 70
Name: Nazirul
Trades: 0
Hi..

i am having problem to include 2 or more files in 1 aspx page..

is this command will import the coding file?

<%@ Register TagPrefix="Activity" TagName="TagActivity" src="../Entity/Activity.ascx" %>

i used Activity() to call for the function in the file but no luck.. it gives error message

Quote:
Activity is a type and cannot be used as an expression
To correct this error
  • Remove the type name and construct the expression using valid elements.
master page? i have created one and the coding looks similar to normal aspx...

let say we want to import many master page, how do we perform that in coding?

can we have

<%@ Page Language="VB" MasterPageFile="Main.master" Title="My Content Page" %>
<%@ Page Language="VB" MasterPageFile="Main2.master" Title="My Content Page" %>
<%@ Page Language="VB" MasterPageFile="Main3.master" Title="My Content Page" %>
or we just can use one of it? ...

please help me in creating multiple master page for coding... thanks
Nazi370 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 11-10-2008, 06:07 AM Re: multiple coding files into ONE aspx file
Nazi370's Avatar
Skilled Talker

Posts: 70
Name: Nazirul
Trades: 0
i have tried multiple calling using master page... the same error occur like an aspx inherit many files..

actually.. i want to call another function in another page? how can we do that?

i've tried <%@ assembly Activity.ascx.vb to include the file

the function is onClickButton

let say

PHP Code:
Private sub OnClickSubmit(ByVal e As ... )
 
Add_Activity() <!---- it is on another file called Activity.ascx.vb
 
Get_Activity
()
 
End Sub 
but it give error message

Quote:
"Reference to a non-shared member requires an object reference"

to correct this error

1. Declare the instance as an object variable
2. reference the instance by the variable name.
i dont understand what is to be declare as instance... need heLP ~
Nazi370 is offline
Reply With Quote
View Public Profile
 
Old 11-14-2008, 02:13 PM Re: multiple coding files into ONE aspx file
Learning Newbie's Avatar
Defies a Status

Latest Blog Post:
Astounding Republican Paranoia
Posts: 5,662
Name: John Alexander
Trades: 0
From MSDN

Quote:
Introduction to Object-Oriented Programming

Introduction

An object is a structure containing data and methods that manipulate the data. If you are new to object-oriented programming, the following terms and concepts will help you get started. While you don't have to master object-oriented programming to be a successful Visual Basic developer it is helpful because almost everything you do in Visual Basic is associated with objects.
Classes and Objects

The words "class" and "object" are used so much in object-oriented programming that it is easy to get the terms mixed up. Generally speaking, a class is an abstract representation of something, whereas an object is a usable example of the thing the class represents. The one exception to this rule is shared class members, which are usable in both instances of a class and object variables declared as the type of the class.
Fields, Properties, Methods, and Events

Classes are made of fields, properties, methods, and events. Fields and properties represent information that an object contains. Fields are like variables in that they can be read or set directly. For example, if you have an object named "Car" you could store its color in a field named "Color."
Properties are retrieved and set like fields, but are implemented using property Get and property Set procedures, which provide more control on how values are set or returned. The layer of indirection between the value being stored and the procedures that use this value helps isolate your data and allows you to validate values before they are assigned or retrieved.
Methods represent actions that an object can perform. For example, a "Car" object could have "StartEngine," "Drive," and "Stop" methods. You define methods by adding procedures, either Sub routines or functions, to your class.
Events are notifications an object receives from, or transmits to, other objects or applications. Events allow objects to perform actions whenever a specific occurrence takes place. An example of an event for the "Car" class would be a "Check_Engine" event. Because Microsoft Windows is an event-driven operating system, events can come from other objects, applications, or user input such as mouse clicks or key presses.
Encapsulation, Inheritance, and Polymorphism

Fields, properties, methods, and events are only one half of the object-oriented programming equation. True object-orient programming requires objects to support three qualities: encapsulation, inheritance, and polymorphism.
Encapsulation means that a group of related properties, methods, and other members are treated as a single unit or object. Objects can control how properties are changed and methods are executed. For example, an object can validate values before allowing property changes. Encapsulation also makes it easier to change your implementation at a latter date by letting you hide implementation details of your objects, a practice called data hiding.
Inheritance describes the ability to create new classes based on an existing class. The new class inherits all the properties and methods and events of the base class, and can be customized with additional properties and methods. For example, you can create a new class named "Truck" based on the "Car" class. The "Truck" class inherits the "Color" property from the "Car" class and can have additional properties such as "FourWheelDrive."
Polymorphism means that you can have multiple classes that can be used interchangeably, even though each class implements the same properties or methods in different ways. Polymorphism is essential to object-oriented programming because it allows you to use items with the same names, no matter what type of object is in use at the moment. For example, given a base class of "Car," polymorphism enables the programmer to define different "StartEngine" methods for any number of derived classes. The "StartEngine" method of a derived class named "DieselCar" may be completely different from the method with the same name in the base class. Other procedures or methods can use the "StartEngine" method of the derived classes in exactly the same way, no matter what type of "Car" object is being used at the time.
Overloading, Overriding, and Shadowing

Overloading, overriding, andshadowing are similar concepts that can be easy to confuse. Although all three techniques allow you to create members with the same name, there are some important differences.
Overloaded members are used to provide different versions of a property or method that have the same name, but that accept different number of parameters, or parameters with different data types.
Overridden properties and methods are used to replace an inherited property or method that is not appropriate in a derived class. Overridden members must accept the same data type and number of arguments. Derived classes inherit overridden members.
Shadowed members are used to locally replace a member that has broader scope. Any type can shadow any other type. For example, you can declare a property that shadows an inherited method with the same name. Shadowed members cannot be inherited.
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
Learning Newbie is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to multiple coding files into ONE aspx file
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.30926 seconds with 12 queries