Professional Web Applications Themes

Passing in a parameter - ASP.NET Building Controls

Hello All, I've declared my usercontrol in the normal way (page directive) and to load it I'm doing: <webapp:menu runat="server" />. However, is there a way I can pass a parameter into it as this menu will be used on a number of pages and on each page it needs to show the same info, but with a different css applied so i need to know what page i'm on. Any other ideas would be appreciated also, Thanks, Jon...

  1. #1

    Default Passing in a parameter

    Hello All,

    I've declared my usercontrol in the normal way (page directive) and to load
    it I'm doing: <webapp:menu runat="server" />. However, is there a way I can
    pass a parameter into it as this menu will be used on a number of pages and
    on each page it needs to show the same info, but with a different css applied
    so i need to know what page i'm on.

    Any other ideas would be appreciated also,

    Thanks,

    Jon

    Jon Guest

  2. #2

    Default Re: Passing in a parameter

    On Wed, 1 Dec 2004 01:39:02 -0800, Jon <Jondiscussions.microsoft.com>
    wrote:
    >Hello All,
    >
    >I've declared my usercontrol in the normal way (page directive) and to load
    >it I'm doing: <webapp:menu runat="server" />. However, is there a way I can
    >pass a parameter into it as this menu will be used on a number of pages and
    >on each page it needs to show the same info, but with a different css applied
    >so i need to know what page i'm on.
    >
    >Any other ideas would be appreciated also,
    >
    >Thanks,
    >
    >Jon
    From code-behind (e.g. in InitializeComponent) you could pass a
    parameter.
    (([ClassName])this.FindControl("[ControlId]")).[ParameterFunctionName]
    = [Value];

    Leon.
    Leon Friesema Guest

  3. #3

    Default Re: Passing in a parameter

    Couldn't you specify a public property on the user control which you could
    use to indicate the css file to use?

    Pete

    "Jon" <Jondiscussions.microsoft.com> wrote in message
    news:2542B432-53EE-4401-A10C-5BD0D3B4DEBAmicrosoft.com...
    > Hello All,
    >
    > I've declared my usercontrol in the normal way (page directive) and to
    load
    > it I'm doing: <webapp:menu runat="server" />. However, is there a way I
    can
    > pass a parameter into it as this menu will be used on a number of pages
    and
    > on each page it needs to show the same info, but with a different css
    applied
    > so i need to know what page i'm on.
    >
    > Any other ideas would be appreciated also,
    >
    > Thanks,
    >
    > Jon
    >

    pete Guest

  4. #4

    Default RE: Passing in a parameter

    Look at

    [url]http://www.123aspx.com/ResErr.aspx?res=937[/url]

    It explains it well


    "Jon" wrote:
    > Hello All,
    >
    > I've declared my usercontrol in the normal way (page directive) and to load
    > it I'm doing: <webapp:menu runat="server" />. However, is there a way I can
    > pass a parameter into it as this menu will be used on a number of pages and
    > on each page it needs to show the same info, but with a different css applied
    > so i need to know what page i'm on.
    >
    > Any other ideas would be appreciated also,
    >
    > Thanks,
    >
    > Jon
    >
    G Rupe Guest

Similar Threads

  1. Passing a parameter in SWF
    By Kesab in forum Macromedia Flash Flashcom
    Replies: 0
    Last Post: March 11th, 03:33 PM
  2. getURL parameter passing bug?
    By 1dan webforumsuser@macromedia.com in forum Macromedia Flash Actionscript
    Replies: 3
    Last Post: February 3rd, 06:22 PM
  3. Passing parameter using XML data
    By Peter in forum ASP.NET Web Services
    Replies: 2
    Last Post: December 15th, 08:09 PM
  4. parameter passing from asp to php
    By PIII450@HOME.NL in forum PHP Development
    Replies: 3
    Last Post: December 4th, 02:39 PM
  5. passing a blob as a parameter
    By UnixUser in forum PHP Development
    Replies: 5
    Last Post: November 19th, 07:23 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