473,387 Members | 1,493 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

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 1603
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: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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,...

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.