473,486 Members | 2,136 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 1609
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
2869
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
1272
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
1731
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
238
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
4358
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
2207
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
1263
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
6612
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
10360
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
2452
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
7100
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
7126
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,...
0
7175
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...
0
7330
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
4865
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
3070
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...
0
3070
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1378
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 ...
1
598
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.