Professional Web Applications Themes

Calling code-behind function from in-line code page - ASP.NET General

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?)...

  1. #1

    Default Calling code-behind function from in-line code page

    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?)



    Fred Guest

  2. #2

    Default Re: Calling code-behind function from in-line code page

    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" <bin> wrote in message
    news:bifrbm$bla$1$demon.co.uk... 


    S. Guest

  3. #3

    Default Re: Calling code-behind function from in-line code page

    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" <com> wrote in message
    news:#76Qi5#phx.gbl... [/ref]
    code [/ref]
    still 
    >
    >[/ref]


    Sherif Guest

Similar Threads

  1. Calling Javascript function using MM_Menu code
    By Bay_Ridah26 in forum Macromedia Dynamic HTML
    Replies: 2
    Last Post: August 3rd, 02:43 PM
  2. Passing code/data from code-behind to ASPX page
    By A. Atienza in forum ASP.NET Data Grid Control
    Replies: 1
    Last Post: December 8th, 06:29 PM
  3. Fitting the asp code in a page inside the asp code in a template
    By rogerwithnell webforumsuser@macromedia.com in forum Macromedia Dreamweaver
    Replies: 3
    Last Post: July 17th, 11:29 AM
  4. Replies: 0
    Last Post: July 11th, 06:27 PM
  5. Replies: 2
    Last Post: June 25th, 01:14 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139