Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Calling code-behind function from in-line code page

Reply
Thread Tools

Calling code-behind function from in-line code page

 
 
Fred Armitage
Guest
Posts: n/a
 
      08-26-2003
I have a fairly complex application written using a vb code-behind dll.
However, I'd like to write one particular aspx page utilising in-line code
so that it can easily be modified as needed by the end user, and yet still
utilise some functions in the code-behind dll.
Is this possible? (How?)



 
Reply With Quote
 
 
 
 
S. Justin Gengo
Guest
Posts: n/a
 
      08-26-2003
Fred,

I'm not 100% positive but I don't think you can do this. To use the
codebehind file or inline code you change the page directive's
AutoEventWireup attribute. Since it has to be set to true or false I think
you can only use one or the other.

Sincerely,

--
S. Justin Gengo, MCP
Web Developer

Free code library at:
www.aboutfortunate.com

"Out of chaos comes order."
Nietzche


"Fred Armitage" <(E-Mail Removed)> wrote in message
news:bifrbm$bla$1$(E-Mail Removed)...
> I have a fairly complex application written using a vb code-behind dll.
> However, I'd like to write one particular aspx page utilising in-line code
> so that it can easily be modified as needed by the end user, and yet still
> utilise some functions in the code-behind dll.
> Is this possible? (How?)
>
>
>



 
Reply With Quote
 
 
 
 
Sherif ElMetainy
Guest
Posts: n/a
 
      08-26-2003
I disagree. It is possible to use code behind and inline code at the same
time. Setting AutoEventWireup to true doesn't prevent events in the parent
class (in the code behind dll) from getting executed.
So you develop you code behind dll the normal way, and set AutoEventWireup
to true to handle page events (like Page_Init and Page_Load) in the aspx
file.

or better override the methods that raises these events, for example
<script language="c#" runat="Server">

protected override void OnLoad(EventArgs e)
{
// here execute the code you want to be executed before the Load event
is raised
base.OnLoad(e);
// here execute the code you want to be executed after the Load event is
raised
}
</script>

You can also decide not to call base.OnLoad if you don't want the Load event
to be fired. This gives more flexibility.
you can also use asp style inline code
for example
<table>
<%
for(int i = 0; i < 10; i++)
{
%>
<tr>
<td><%=i%></td>
<td>Hello World</td>
</tr>
<%
}
%>
</table>


"S. Justin Gengo" <(E-Mail Removed)> wrote in message
news:#76Qi5#(E-Mail Removed)...
> Fred,
>
> I'm not 100% positive but I don't think you can do this. To use the
> codebehind file or inline code you change the page directive's
> AutoEventWireup attribute. Since it has to be set to true or false I think
> you can only use one or the other.
>
> Sincerely,
>
> --
> S. Justin Gengo, MCP
> Web Developer
>
> Free code library at:
> www.aboutfortunate.com
>
> "Out of chaos comes order."
> Nietzche
>
>
> "Fred Armitage" <(E-Mail Removed)> wrote in message
> news:bifrbm$bla$1$(E-Mail Removed)...
> > I have a fairly complex application written using a vb code-behind dll.
> > However, I'd like to write one particular aspx page utilising in-line

code
> > so that it can easily be modified as needed by the end user, and yet

still
> > utilise some functions in the code-behind dll.
> > Is this possible? (How?)
> >
> >
> >

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

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 On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Calling function residing on Ancestor page from child page M B HONG 20 Javascript 2 12-13-2005 02:10 AM
write a function such that when ever i call this function in some other function .it should give me tha data type and value of calling function parameter komal C++ 6 01-25-2005 11:13 AM
calling virtual function results in calling function of base class... Andreas Lagemann C++ 8 01-10-2005 11:03 PM
calling virtual function results in calling function of base class ... tiwy C++ 0 01-09-2005 11:17 PM
Security problem with Managed Code calling Unmanaged Code in a Web Page GAH ASP .Net Security 0 07-11-2003 06:27 PM



Advertisments