473,222 Members | 1,815 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,222 software developers and data experts.

Touble with User Control

Please take a look at this code.

I am creating a list of button/links that are part of a user control added
to an aspx file:

ASCX code

<asp:datalist id="LinksList" OnItemCommand="LinksList_ItemCommand"
runat="server">
<ItemTemplate>
<asp:button ID=btnlist CssClass='lbutton' Text='<%#
DataBinder.Eval(Container.DataItem, "LinkText") %>' CommandArgument='<%#
DataBinder.Eval(Container.DataItem, "LinkLevel") %>' CommandName='<%#
DataBinder.Eval(Container.DataItem, "LinkURL") %>' Runat='server'>
</asp:button>
</ItemTemplate>
</asp:datalist>

ASCX.VB code:

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
Dim DS As DataSet
DS = db.GetRecordset("select LinkText, LinkURL from Links where
Orientation='side' and bVis='1' order by LinkOrder")
LinksList.DataSource = DS.Tables("Table").DefaultView
LinksList.DataBind()
End Sub

Sub LinksList_ItemCommand(ByVal source As Object, ByVal e As
System.Web.UI.WebControls.DataListCommandEventArgs ) Handles
LinksList.ItemCommand
Response.Redirect(e.CommandName)
End Sub

ASPX code:

<uc1:sidemenu id="Sidemenu1" runat="server"></uc1:sidemenu>

Clicking on the buttons doesn't seem to do anything.

Is this because the User control is inside an ASPX file and so the
ItemCommand event in the ASCX.VB is not executed?

I am confused ... how can I make this happen?

Thank you for any help.

--
Phil Lamey, EIT
CGI Consultant
Jul 21 '05 #1
0 1026

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: hardwareman | last post by:
Hi Folks, I can work around this problem, but it shows a problem in my understanding of how things should work. Any ideas are appreciated. Thanks, Hardwareman When the following...
14
by: Darin | last post by:
I have a table that I want to delete specific records from based on data in other tables. I'm more familiar with Access '97, but am now using 2003, but the database is in 2000 format. In '97, I...
6
by: martin | last post by:
Hi, I am a web page and a web user control. My web user control is placed in my web page using the following directive <%@ Register TagPrefix="uc1" TagName="Header"...
1
by: Shourie | last post by:
I've noticed that none of the child controls events are firing for the first time from the dynamic user control. Here is the event cycle. 1) MainPage_load 2) User control1_Load user clicks a...
6
by: Steve Booth | last post by:
I have a web form with a button and a placeholder, the button adds a user control to the placeholder (and removes any existing controls). The user control contains a single button. I have done all...
0
by: Phil Lamey | last post by:
Please take a look at this code. I am creating a list of button/links that are part of a user control added to an aspx file: ASCX code <asp:datalist id="LinksList"...
0
by: tony | last post by:
Hello! This is a rather long mail but it's a very interesting one. I hope you read it. I have tried several times to get an answer to this mail but I have not get any answer saying something...
8
by: fernandezr | last post by:
I would like to use a user control as a template inside a repeater. Some of the fields in the control should be hidden depending on whether or not there is data. I'm still a ASP .Net newbie so the...
2
by: rn5a | last post by:
Assume that a user control (MyUC.ascx) encapsulates 2 TextBoxes with the IDs 'txt1' & 'txt2' respectively. To use this user control in an ASPX page, the following Register directive will be...
1
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
0
by: veera ravala | last post by:
ServiceNow is a powerful cloud-based platform that offers a wide range of services to help organizations manage their workflows, operations, and IT services more efficiently. At its core, ServiceNow...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
0
by: mar23 | last post by:
Here's the situation. I have a form called frmDiceInventory with subform called subfrmDice. The subform's control source is linked to a query called qryDiceInventory. I've been trying to pick up the...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
by: jimatqsi | last post by:
The boss wants the word "CONFIDENTIAL" overlaying certain reports. He wants it large, slanted across the page, on every page, very light gray, outlined letters, not block letters. I thought Word Art...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...

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.