ASP.Net Programmers

Open discussion about any topic, as long as you abide by the rules of course!
Post Reply
Turbanator
Posts: 883
Joined: Wed Jun 08, 1983 7:00 am

ASP.Net Programmers

Post by Turbanator »

Jesus please help me, this is driving me nuts.

Default.aspx

Code: Select all

<%@ Register TagPrefix="Portal" TagName="Banner" Src="~/modules/Banner.ascx" %>

<script runat="server">
    public int access = 5;
</script>

<Portal:Banner id="banner" runat="server"  access="<%# access %>"/>

Banner.ascx

Code: Select all

<script runat="server">
    public int access;
    void Page_Init(Object sender, EventArgs e)
</script>
 <% Response.Write(access.ToString()); %>
Banner always prints 0 :(:(:(
Turbanator
Posts: 883
Joined: Wed Jun 08, 1983 7:00 am

Post by Turbanator »

oh, if I manually set "access='5'" it works fine, so the link across is running smooth, just access isn't going in properly.
sommat wrong with <%# %>
User avatar
Foo
Posts: 13840
Joined: Thu Aug 03, 2000 7:00 am
Location: New Zealand

Post by Foo »

Jesus doesn't post here anymore. I hear he's on ina forums nowadays :3
"Maybe you have some bird ideas. Maybe that’s the best you can do."
― Terry A. Davis
Turbanator
Posts: 883
Joined: Wed Jun 08, 1983 7:00 am

Post by Turbanator »

help meh!

please :'(
Turbanator
Posts: 883
Joined: Wed Jun 08, 1983 7:00 am

Post by Turbanator »

almost fixed it all

Code: Select all

    <asp:SqlDataSource 
        ID="PortalDatabase"
        runat="server"
        ConnectionString="<%$ ConnectionStrings:serviceportalConnectionString %>"
        SelectCommand="SELECT [tab_name], [file_name] FROM [tabs] WHERE ([access_level] <= @access)"
    >
        <SelectParameters>
            <asp:Parameter Name="access" Type="Int32" DefaultValue="2" />
        </SelectParameters>
    </asp:SqlDataSource>
need that "DefaultValue=2" to be DefaultValue=access
Post Reply