473,320 Members | 2,122 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,320 software developers and data experts.

Dynamic controls and their handlers

Hello all,

im making a dynamic .NET page which reads downloads from a XML file.
there are two controls that have handlers, a category switcher and a download streamer (so people cant surf directly to the file).
these controls are built out of multiple LinkButtons all having the same event but different ID's

the controls are linkbuttons, not sure if that gives any troubles.

when i open the page i have to include a showItems(category); otherwise the handlers of the download streamer dont trigger (not created?).

i tried creating a dummybutton or a ghost button but nothing worked unless i showed a category on the first page.

any idea to get their fixed handler attached to the buttons?
Mar 6 '09 #1
4 1184
Frinavale
9,735 Expert Mod 8TB
This is very confusing....

But,in the PageLoad event, have you tried just specifying a default "category" and calling the method that loads the XML if it's the first time the page is loaded?

Eg:

Expand|Select|Wrap|Line Numbers
  1. Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load 
  2.  
  3.    If IsPostBack = False  Then
  4.      'Provide default category 
  5.      'Load XML
  6.    End If
  7. End Sub
  8.  
Mar 6 '09 #2
im sorry i meant to say
if i dont create the category items and their buttons on the first load it will not trigger their event.

i already set a default and am calling that on page_load, because i need to
if i dont, the download linkbuttons wont work.
Mar 7 '09 #3
Frinavale
9,735 Expert Mod 8TB
I don't understand what your problem is.
Could you please clarify what you are trying to do and what your problem is.
Are you creating your controls in the Page Init event?

Have you seen quick overview of how to use dynamic controls in asp.net?

-Frinny
Mar 9 '09 #4
very simple, the problem is

if i do not create both button types (category button + download button) first time the page loads one type wont fire its event.

i try to do

dynamically generate a categories list
on click
dynamically generate downloads list

since im using a streamer to keep the files safe from direct browsing a normal link wont work

i looked into things like that, but im unable to link the page init event in VWD2008 using C# thus i am using the page_load event

*edit*
forgot to mention its an ascx page in DotNetNuke
Mar 9 '09 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Roy Lawson | last post by:
I want to enable the user to define parts of their user interface. I am developing an application that does some accounting functions (basicly the end user enters revenues for each account, and...
6
by: Mark | last post by:
I have been working for quite some time on this issue which in theory should be quite simple. The problem is that the Cancel and Save events are not fired when their respective buttons are...
0
by: Kenton Smeltzer | last post by:
Hello All, I am having a problem with events and the addition of controls on a page I am developing. First let me tell you what I have tried and then maybe someone can see something I missed. ...
1
by: Jim Heavey | last post by:
Hello, I have a web page with a <ASP:Table> control on the form. This table also has 5 DataListControls on 5 seperate <ASP:TableRow> controls. In code I am dynamically adding TableRow controls...
3
by: Leo J. Hart IV | last post by:
OK, here's another question for the experts: I am building a multi-step (3 steps actually) form using a panel for each step and hiding/displaying the appropriate panel/panels depending on which...
3
by: Kris Palmer | last post by:
hi, can somebody explain this problem? it's driving me crazy! i have a requirement to dynamically create a variable quantity of timers with associated start button based on the contents of a...
6
by: Joseph Geretz | last post by:
Writing an Outlook AddIn with C#. For the user interface within Outlook I'm adding matching pairs of Toolbar buttons and Menu items. All of the buttons and menu items are wired up to send events to...
3
by: HP | last post by:
Hi there The problem of dynamically created controls vs viewstate is widely known one. To access values of controls they have to be recreated on Page_Load. Unfortunately it causes many...
3
balabaster
by: balabaster | last post by:
I've got a user control that builds a table of dynamic data based on a :LINQ class holding the data. The data is loaded using the LoadData(DataInstance) method. The table it builds contains a...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.