473,473 Members | 2,169 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Generic Question about Codebehind forms

jm
I have a question about codebehind. I have an upload namespace, class
and all in a codebehind. I currently have it so it works with one of
my .aspx pages. I want to use it for another .aspx page. The problem
is that they codebehind looks at a specific directory (since it was
only being used by one page). I need it to decide which directory to
go to based upon which page is using the codebehind page. Can I just
reference the private subs in my codebehind from my .aspx page and
send another parameter telling which page is calling and make a
decision. I know I could just copy and paste the page over, but that
defeats the purpose.

I guess the main question is about referencing subs in the codebehind
page. If I reference the page in my page directive, can't I call the
codebehind subs just like any other sub?
Nov 18 '05 #1
6 1608
one
so you want to do something like this

root director
|-----first virtual director
|-----first.aspx (first.aspx.cs
|-----second virtual director
|-----second.aspx(first.aspx.cs

If I haven't tried the above but I don't think it will work. However, I will put the function (sub) in a seperate assembly (dll) and place that in the GAC. Code-behind is not designed to be shared among pages

HT

----- jm wrote: ----

I have a question about codebehind. I have an upload namespace, clas
and all in a codebehind. I currently have it so it works with one o
my .aspx pages. I want to use it for another .aspx page. The proble
is that they codebehind looks at a specific directory (since it wa
only being used by one page). I need it to decide which directory t
go to based upon which page is using the codebehind page. Can I jus
reference the private subs in my codebehind from my .aspx page an
send another parameter telling which page is calling and make
decision. I know I could just copy and paste the page over, but tha
defeats the purpose

I guess the main question is about referencing subs in the codebehin
page. If I reference the page in my page directive, can't I call th
codebehind subs just like any other sub

Nov 18 '05 #2
one
so you want to do something like this

root director
|-----first virtual director
|-----first.aspx (first.aspx.cs
|-----second virtual director
|-----second.aspx(first.aspx.cs

If I haven't tried the above but I don't think it will work. However, I will put the function (sub) in a seperate assembly (dll) and place that in the GAC. Code-behind is not designed to be shared among pages

HT

----- jm wrote: ----

I have a question about codebehind. I have an upload namespace, clas
and all in a codebehind. I currently have it so it works with one o
my .aspx pages. I want to use it for another .aspx page. The proble
is that they codebehind looks at a specific directory (since it wa
only being used by one page). I need it to decide which directory t
go to based upon which page is using the codebehind page. Can I jus
reference the private subs in my codebehind from my .aspx page an
send another parameter telling which page is calling and make
decision. I know I could just copy and paste the page over, but tha
defeats the purpose

I guess the main question is about referencing subs in the codebehin
page. If I reference the page in my page directive, can't I call th
codebehind subs just like any other sub

Nov 18 '05 #3
Why you don't do a class with your code and then use this??

Example :
public class Job
{
public static void DoJob() {....};
}

In other you can try to make some function virtual and then override.
Brun.

NB :
You must remember that codebehind directive is used only by Visual Studio
(for tree I think!). Framework don't watch this!
..aspx page can derive from any class that derive from Page class.
"Src" directive is used by Framework for runtime compile c# or vb.net code.
"Inherits" for set class that .aspx must inherits.

This code work without problem :
<%@ Page language="c#" %>
<script runat=server>
public string GetPippo()
{
string s = null;
s = "<h3>pippo</h3>";
return s;
}
</script>
<form id="Form1" method="post" runat="server">
<% = GetPippo() %>
</form>
"jm" <jo*************@yahoo.com> wrote in message
news:c6**************************@posting.google.c om...
I have a question about codebehind. I have an upload namespace, class
and all in a codebehind. I currently have it so it works with one of
my .aspx pages. I want to use it for another .aspx page. The problem
is that they codebehind looks at a specific directory (since it was
only being used by one page). I need it to decide which directory to
go to based upon which page is using the codebehind page. Can I just
reference the private subs in my codebehind from my .aspx page and
send another parameter telling which page is calling and make a
decision. I know I could just copy and paste the page over, but that
defeats the purpose.

I guess the main question is about referencing subs in the codebehind
page. If I reference the page in my page directive, can't I call the
codebehind subs just like any other sub?

Nov 18 '05 #4
Why you don't do a class with your code and then use this??

Example :
public class Job
{
public static void DoJob() {....};
}

In other you can try to make some function virtual and then override.
Brun.

NB :
You must remember that codebehind directive is used only by Visual Studio
(for tree I think!). Framework don't watch this!
..aspx page can derive from any class that derive from Page class.
"Src" directive is used by Framework for runtime compile c# or vb.net code.
"Inherits" for set class that .aspx must inherits.

This code work without problem :
<%@ Page language="c#" %>
<script runat=server>
public string GetPippo()
{
string s = null;
s = "<h3>pippo</h3>";
return s;
}
</script>
<form id="Form1" method="post" runat="server">
<% = GetPippo() %>
</form>
"jm" <jo*************@yahoo.com> wrote in message
news:c6**************************@posting.google.c om...
I have a question about codebehind. I have an upload namespace, class
and all in a codebehind. I currently have it so it works with one of
my .aspx pages. I want to use it for another .aspx page. The problem
is that they codebehind looks at a specific directory (since it was
only being used by one page). I need it to decide which directory to
go to based upon which page is using the codebehind page. Can I just
reference the private subs in my codebehind from my .aspx page and
send another parameter telling which page is calling and make a
decision. I know I could just copy and paste the page over, but that
defeats the purpose.

I guess the main question is about referencing subs in the codebehind
page. If I reference the page in my page directive, can't I call the
codebehind subs just like any other sub?

Nov 18 '05 #5
Why separate assembly in GAC? If it is in bin directory there isn't problem!

Brun

"one" <on***********@online.nospam> wrote in message
news:66**********************************@microsof t.com...
so you want to do something like this:

root directory
|-----first virtual directory
|-----first.aspx (first.aspx.cs)
|-----second virtual directory
|-----second.aspx(first.aspx.cs)

If I haven't tried the above but I don't think it will work. However, I will put the function (sub) in a seperate assembly (dll) and place that in
the GAC. Code-behind is not designed to be shared among pages.
HTH

----- jm wrote: -----

I have a question about codebehind. I have an upload namespace, class and all in a codebehind. I currently have it so it works with one of
my .aspx pages. I want to use it for another .aspx page. The problem is that they codebehind looks at a specific directory (since it was
only being used by one page). I need it to decide which directory to
go to based upon which page is using the codebehind page. Can I just
reference the private subs in my codebehind from my .aspx page and
send another parameter telling which page is calling and make a
decision. I know I could just copy and paste the page over, but that
defeats the purpose.

I guess the main question is about referencing subs in the codebehind
page. If I reference the page in my page directive, can't I call the
codebehind subs just like any other sub?

Nov 18 '05 #6
Why separate assembly in GAC? If it is in bin directory there isn't problem!

Brun

"one" <on***********@online.nospam> wrote in message
news:66**********************************@microsof t.com...
so you want to do something like this:

root directory
|-----first virtual directory
|-----first.aspx (first.aspx.cs)
|-----second virtual directory
|-----second.aspx(first.aspx.cs)

If I haven't tried the above but I don't think it will work. However, I will put the function (sub) in a seperate assembly (dll) and place that in
the GAC. Code-behind is not designed to be shared among pages.
HTH

----- jm wrote: -----

I have a question about codebehind. I have an upload namespace, class and all in a codebehind. I currently have it so it works with one of
my .aspx pages. I want to use it for another .aspx page. The problem is that they codebehind looks at a specific directory (since it was
only being used by one page). I need it to decide which directory to
go to based upon which page is using the codebehind page. Can I just
reference the private subs in my codebehind from my .aspx page and
send another parameter telling which page is calling and make a
decision. I know I could just copy and paste the page over, but that
defeats the purpose.

I guess the main question is about referencing subs in the codebehind
page. If I reference the page in my page directive, can't I call the
codebehind subs just like any other sub?

Nov 18 '05 #7

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

Similar topics

2
by: Graham Allwood | last post by:
I'm reading the Essential ASP.NET book by Fritz onion and he says that when VS.NET creates a new .aspx page for you is uses the codebehind attribute on the Page directive rather than the src...
1
by: ani | last post by:
When I try to open the web form page, I get a designer error which says: 'the file could not be loaded into the web forms designer. Please correct the following error and then try loading it...
12
by: A.M | last post by:
Hi, Using VS.NET 2003, If i use SRC page attribute instead of CodeBehind, do i still have intelisence and generally IDE support for that? Thanks, Ali
3
by: jm | last post by:
I have a question about codebehind. I have an upload namespace, class and all in a codebehind. I currently have it so it works with one of my .aspx pages. I want to use it for another .aspx...
5
by: Selden McCabe | last post by:
I have an application where they want to create numerous forms (for example, an expense reimbursement form, a book availability form, etc.). The idea is someone would create a form for a user to...
7
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
3
by: nagesh | last post by:
hi guys, when we compiling the asp.net project, all codebehind pages gives you one dll. suppose if i write the code in .aspx forms itself then is it create a dll ? if i write the code in aspx...
3
by: Harry Haller | last post by:
Hello, I want to implement a generic list which will be used to display 7 columns in a GridView. One should be able to sort, filter and page each of the 7 columns. Ideally the filter should be...
7
by: j4richard | last post by:
Help please, I am getting this "Unhandled Exception has occurred in your application" " A Generic error occurred in GDI+" See the end of this message for details on...
2
by: Andrus | last post by:
Winforms UI assembly has static FormManager.FormCreator method which creates forms taking entity as parameter. I need to pass this method to business objects in business assembly so that business...
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
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...
0
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,...
1
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
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...
0
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.