473,780 Members | 2,258 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to use a dynamic text link as a post-back trigger?

I have a form that has a 'sub-form' in it that updates a separate table.

I can easily add records to this table from within this page. To delete,
though, I've been redirecting to a different 'delete' page where it asks for
confirmation before deleting. This works, but the problem is that I loose my
postback information from the main page. Since this is just a small bit of a
larger form, I don't want people to fill out half the form, get to this
point, delete an item, only to see the rest of their form reset.

So...

I decided that the confirmation isn't really that necessary for this, since
it's just a relationship I'm deleting...not the actual record. As such, I
want to delete the item from this page.

The question is how to I create these dynamic 'delete' links? Here's how I
currently do it:

(larger part of form)

item 1 | delete
item 2 | delete
item 3 | delete

these delete links are in a repeater and I build them one by one as such:

a href="deletepag e.aspx?itemToDe lete=[itemID]

So, I'm passing a specific field with each link to a new page.

Is there a way I can make these dynamicly rendered links (or buttons, if
need be) postback triggers? If so, how can I dynamically attach the itemID
to each one?

-Darrel
Nov 19 '05 #1
1 1474
Darrel, I'm not highly familiar with the capabilities of the Repeater
control, so I don't know whether there is a way to easily render a
LinkButton-type control in your current approach.

However you can definately emulate this behavior in a DataGrid, which seems
more appropriate for what you're doing.

In that approach, you would have a Delete link per row, which on click would
do a postback instead of a link to another page. Since you're not leaving
the page you don't lose your view state, and you can still do the delete
operations ad-hoc.

Another approach is to programmaticall y render your UI using a Table and
embedding TableRow's, TableCell's, LinkButton's, etc. This is nice for
especially complex UI's but in your case I would guess that the DataGrid is
the best solution.

/// M
"darrel" <no*****@hotmai l.com> wrote in message
news:Ow******** ******@TK2MSFTN GP10.phx.gbl...
I have a form that has a 'sub-form' in it that updates a separate table.

I can easily add records to this table from within this page. To delete,
though, I've been redirecting to a different 'delete' page where it asks for confirmation before deleting. This works, but the problem is that I loose my postback information from the main page. Since this is just a small bit of a larger form, I don't want people to fill out half the form, get to this
point, delete an item, only to see the rest of their form reset.

So...

I decided that the confirmation isn't really that necessary for this, since it's just a relationship I'm deleting...not the actual record. As such, I
want to delete the item from this page.

The question is how to I create these dynamic 'delete' links? Here's how I
currently do it:

(larger part of form)

item 1 | delete
item 2 | delete
item 3 | delete

these delete links are in a repeater and I build them one by one as such:

a href="deletepag e.aspx?itemToDe lete=[itemID]

So, I'm passing a specific field with each link to a new page.

Is there a way I can make these dynamicly rendered links (or buttons, if
need be) postback triggers? If so, how can I dynamically attach the itemID
to each one?

-Darrel

Nov 19 '05 #2

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

Similar topics

5
8594
by: adrian | last post by:
hi all this is my first post to this group, so pls bear with me while i try to make some sense. i am trying to create a sproc which uses dynamic sql to target a particuar table eg. '.' and perform some actions. i am using @tableID as a passes parameter for the sproc.
1
2501
by: Macamba | last post by:
Hi all, I am currently developing a website for a voluntary organisation. It is my first step in website development. The dynamic menu I developed has some bugs, which I addressed in another post. In this post I want to ask you why my code behaves differently in IE, while it behaves like I expect in Mozilla and Opera. What I would like to see addressed is what I need to do to get the same behaviour in all 3 browsers. I know each browser...
3
1909
by: Aaron Gervais | last post by:
I am brand-new to javascript, but after reading some tutorials online I was able to make a dynamic HTML photo gallery in javascript. It works fine in all browsers except IE6 (big surprise). I've been looking around online for solutions, but the fixes I have seen don't seem to work. I assume I am misunderstanding something... I was using element.setAttribute but have changed my code to avoid that. Here is an example. IE6 displays the link...
3
2723
by: JOSEPHINE ALVAREZ | last post by:
I have this code that I want to use to do a rollover. However, because the company I am doing it for is continually changing the text, I want to be able to use dynamic text to change the text on the fly, and still have the rollover work. I have taken the text off of the buttons, but cannot figure out how to do it with dynamic text using javascript and html. For example, in the columns of this row, I want to put "About...
6
2924
by: MikeY | last post by:
Hi Everyone, Does anyone know where I can get my hands on a sample with source code of a simple dynamic button control in C# Windows form. I am looking for a sample that uses a class library that sets the properties send/passed from the main windows form. I'm having problems with the class library, the button control collection and my referencing it ie this.Control.Add(aControl);. Any and all help is appreciated. Thanks in advance.
6
7404
by: 35th Ave Media | last post by:
Hello, I have about 60+ pages that I need to insert a MAILTO: tag so people can email the page using their email client. The body of the message is going to be the URL of that page. Using ASP, how can I insert the page URL in the email body without having to manually enter each URL for each MAILTO: tag? Is there a variable that can be used inside the MAILTO: tag that automatically inserts the current page's URL into the body of the...
6
1439
by: Andrew Robinson | last post by:
I have a page that contains a number of link buttons that are used for making selections. I load my LinkButtons during the Page_PreInit event and they render fine but then I need to make a change to one of these LinkButtons depending on the selection. I am using the Command Event and passing a key in the Command.Name field. From within this even handler, I am clearing my LinkButtons and then re-redering and marking with a different...
1
4832
by: Satish.Talyan | last post by:
hi, i want to create a dynamic tree hierarchy in javascript.there are two parts in tree, group & user.when we click on group then users come under that's tree category will be opened.problem is that i am not able to arrange three things simultaneously,group,users & there functionality simultaneously.dynamic means group & users come from database and groups & users can be increased in number at any time. i am sending code for that tree...
9
5313
by: dli07 | last post by:
Hello, I'm trying to convert a piece of code that creates a dynamic vertical resizing bar in a table from internet explorer to firefox. It's based on a post from http://blogs.crankygoblin.com/blogs/geoff.appleby/pages/50712.aspx. I've also read the post on this topic by bggraphics, but he doesn't arrive at a final result. The main problem I am having is that the layerX and layerY event properties don't work. They're supposed to return the...
2
1963
by: David W | last post by:
I need to include a style sheet link in the aspx page based on what user they are. Basically this functionality, but using code behind. Any idea how to change this line to code behind? This breaks once we include an AJAX control on the page. <head runat="server"> <link href="/textfiles/style<%= Session("partner_id") %>.css" rel="stylesheet" type="text/css">
0
9636
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
1
10075
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8961
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7485
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6727
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5373
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5504
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3632
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2869
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.