473,803 Members | 3,306 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

adding Button question

I need to create a page that lists a users Content, and allow them to
add subscribers to or remove subscribers from that Content. The list may
contain just one Content item, but it could just as easily contain 10
Content items.

Each Content item would look something like this:

---------------------------------------------
<content title 1>
<content description 1>
add new subscriber:
<textbox for subscribers e-mail address<button to add subscriber>

list of current subscribers:
<checkbox for subscribere-****@addressof. subscriber
<checkbox for subscribere-****@addressof. subscriber
<checkbox for subscribere-****@addressof. subscriber
<checkbox for subscribere-****@addressof. subscriber
<button to remove selected subscribers>

--

<content title 2>
<content description 2>
add new subscriber:
<textbox for subscribers e-mail address<button to add subscriber>

list of current subscribers:
<checkbox for subscribere-****@addressof. subscriber
<checkbox for subscribere-****@addressof. subscriber
<checkbox for subscribere-****@addressof. subscriber
<checkbox for subscribere-****@addressof. subscriber
<button to remove selected subscribers>
---------------------------------------------

I have two methods addSubscriber and delSubscriber that I need to call
from one of the two buttons, and here's where I'm having trouble.

using somthing like this:

Expand|Select|Wrap|Line Numbers
  1. <asp:Button ID="testBtn" runat="server" oncommand="addSubscriber"
  2. Text="Add Subscriber" />
  3.  
I can call the method, but I need a way to indentify which of the
Content "Add Subscriber" buttons on the page was clicked.

the method is this:

Expand|Select|Wrap|Line Numbers
  1. private void addSubscriber(object sender,
  2. System.Web.UI.WebControls.CommandEventArgs e)
  3. {
  4. Response.Write("trace 1: " + e.CommandArgument.ToString());
  5. }
  6.  
Can anyone help me work out how to get some identifying value to the
"addSubscri ber" method?
Many thanks in advance

Kevin


THINGS I'VE ALREADY TRIED (though quite possible one will work with a
little help)

Expand|Select|Wrap|Line Numbers
  1. <asp:Button ID="testBtn" runat="server" oncommand="addSubscriber"
  2. Text="Add Subscriber" commandargument="item<%=loopCount%>" />
  3.  
(this just passed "item<%loopCoun t %>" as a string - i.e. my
Repsonse.Write just displayed "trace 1: item<%=loopCoun t %>"

Expand|Select|Wrap|Line Numbers
  1. <%
  2. testBtn.Attributes.Add("commandargument","item" + loopCount);
  3. %>
  4. <asp:Button ID="testBtn" runat="server" oncommand="addSubscriber"
  5. Text="Add Subscriber" />
  6.  
(this called the method, but no commandargument was seen, i.e. the
Response.Write showed "trace 1: "

Nov 2 '06 #1
0 1036

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

Similar topics

3
4889
by: Jim Heavey | last post by:
Trying to figure out the technique which should be used to add rows to a datagrid. I am thinking that I would want an "Add" button on the footer, but I am not quite sure how to do that. Is that the best method? Do you have a sample of how to do this?
4
5592
by: Dmitry Korolyov [MVP] | last post by:
When we use btnSubmit.Attributes = "javascript: this.disabled=true;" to make the button disabled and prevent users from clicking it again while form data still posting, there is no longer postback. I.e. the button does go disabled, but the form does not invoke submit() method. Of course, it does work fine without this property. Clues?
1
3299
by: Andrew | last post by:
Hey all, I am very new to ASP.Net (and .Net in general), but that isn't stopping the boss from wanting to begin new projects in it. This latest project has me kinda stumped and after a couple days of struggling, I figure asking you all (the experts) will keep me from going down some dark and dangerous road. The project I have is a fairly simple one, in theory anyway. The gist is to create a page where the user enters an IDNumber,...
6
1496
by: Bart Schelkens | last post by:
Hi, I have another question. On my asp-page I put a label. I manually create a table and set that table in the text of the label. This way my table is displayed. My question is how can i add 2 columns that contain buttons to that table. The last two columns of my table need to contain buttons to edit or delete a
1
2034
by: seanmayhew | last post by:
I have a form page that that while editing saves the data to an xml doc before submitting to db. On each page unload it saves the xmldoc as the user can add multiple items to the company like product types etc. So for instance Im adding a fruit company while adding a fruit company I allow the user to add types of fruit they carry and display it dynamically using an <asp:table> with image
3
2347
by: Ankit Aneja | last post by:
I have a strange situation and I have no idea how to solve this. Its a Recruitment Search Page,in the Admin Page, for every button click event the Admin Person has to create a checkbox on the users page. So whenever the Admin person comes to know about the new category in the market he will be adding as different Sub-Categories for example ABAP, BDC etc..etc.. on every click event as Checkboxes. And these controls(checkboxes) should remain...
9
2783
by: Neo Geshel | last post by:
I have strip-mined, strip-searched, and completely exhausted the Internet (up to the 30th page on Google, with 100 results per page!!), all without finding an answer to my question AS TO WHY IT IS IMPOSSIBLE TO PROGRAMMATICALLY ADD A BUTTON TO A DYNAMICALLY CREATED PAGE. Or, to be more precise, why it is impossible to have an onClick sub respond to that button’s Click event. My main page has only one line:
6
1597
by: Totto | last post by:
Hi, Anyone know the best solution to dynamically add buttons to a asp 2.0 page using data from Sql server? Are there any contols suitable for this or is it best to iterate the dataset and dynamicaly add buttons in the asp page? Totto
4
2767
by: ranjini ns | last post by:
Hi, I have a form, and in this form, there are 2 drop down list a text box, one button (labelled "add" )and finally, a listbox. The question is, when the user clicks on the add button, how do I add the value selected in the drop down list and the text box values and put it into the listbox? After adding to the listbox, the selected value needs to stay in the drop down menu and not get removed. Thanks in advance
2
7670
by: Ken Fine | last post by:
I want to add the security question and answer security feature to the ChangePassword control. I am aware that this functionality is built into the PasswordRecovery tool. I have implemented the PasswordRecovery with a Password reset required; a temporary password is sent to the account on file. I want an extra layer of security to accommodate the very unlikely contingency that someone's e-mail account is compromised. Challenging with the...
0
9564
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10068
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9121
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
7603
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
6841
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
5498
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...
1
4275
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3796
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2970
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.