Click here to Skip to main content
15,918,889 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionAdd/Remove type control for Web pages? Pin
Josh Martin29-May-08 12:53
Josh Martin29-May-08 12:53 
AnswerRe: Add/Remove type control for Web pages? Pin
Christian Graus29-May-08 13:33
protectorChristian Graus29-May-08 13:33 
GeneralRe: Add/Remove type control for Web pages? Pin
Josh Martin30-May-08 6:40
Josh Martin30-May-08 6:40 
QuestionStoring html Pin
ChrisFarrugia29-May-08 11:21
ChrisFarrugia29-May-08 11:21 
AnswerRe: Storing html Pin
Christian Graus29-May-08 13:34
protectorChristian Graus29-May-08 13:34 
AnswerRe: Storing html Pin
N a v a n e e t h29-May-08 15:39
N a v a n e e t h29-May-08 15:39 
Questiontrouble with tableAdapter.update method Pin
ghazanfarKhan29-May-08 9:48
ghazanfarKhan29-May-08 9:48 
QuestionAJAX problem - deleting table rows Pin
prezident29-May-08 7:04
prezident29-May-08 7:04 
Hi,

I apologize for double post, but this is very urgent, and I don't know how to do it.

I have to create a table with unknown number of rows. There should be a button for adding a new row and a button for deleting selected rows (in each rows there is a cell with a checkbox for deleting). I started with AJAX, but I'm a newbie, so I stuck. I can now add new rows, but have no clue how to delete them. Is there anyone who could help?

Here's my code (for now):

<asp:updatepanel id="UpdatePanel1" runat="server">
<contenttemplate>
<asp:table id="receivingInstitutionsTable" runat="server">
</asp:table>
</contenttemplate>
<triggers>
<asp:asyncpostbacktrigger controlid="ButtonAddNewReceivingInstitution" eventname="Click" />
<asp:asyncpostbacktrigger controlid="ButtonDeleteReceivingInstitutions" eventname="Click" />
</triggers>
</asp:updatepanel>

That's my table and two buttons - one for adding new row, and second for deleting selected rows. And this is inline code:

static int numberOfReceivingInstitutions = 1;
ArrayList receivingInstitutionsArrayList = new ArrayList();

protected void Page_PreInit(object sender, EventArgs e)
{
Control controlWhichCausedPostBack = GetPostBackControl(this.Page);

if ((controlWhichCausedPostBack != null))
{
if ((controlWhichCausedPostBack.ClientID.ToString() == "ButtonAddNewReceivingInstitution"))
{
numberOfReceivingInstitutions += 1;
}
}
}

protected override void OnInit(EventArgs e)
{
base.OnInit(e);


for (int i = 0; i &lt; numberOfReceivingInstitutions; i += 1)
{
TableRow newReceivingInstitution = getNewRow();
newReceivingInstitution.ID = "receivingInstitution" + i.ToString();

receivingInstitutionsTable.Rows.Add(newReceivingInstitution);
receivingInstitutionsArrayList.Add(newReceivingInstitution);
}
}
QuestionDocumentation for style sheets vs. web control declarative attributes Pin
Christopher Duncan29-May-08 5:45
Christopher Duncan29-May-08 5:45 
AnswerRe: Documentation for style sheets vs. web control declarative attributes Pin
led mike29-May-08 6:06
led mike29-May-08 6:06 
GeneralRe: Documentation for style sheets vs. web control declarative attributes Pin
Christopher Duncan29-May-08 6:34
Christopher Duncan29-May-08 6:34 
GeneralRe: Documentation for style sheets vs. web control declarative attributes Pin
led mike29-May-08 7:57
led mike29-May-08 7:57 
Questionhow to set a error path to a file in asp.net page Pin
trannguyen8629-May-08 5:45
trannguyen8629-May-08 5:45 
AnswerRe: how to set a error path to a file in asp.net page Pin
N a v a n e e t h29-May-08 7:19
N a v a n e e t h29-May-08 7:19 
AnswerRe: how to set a error path to a file in asp.net page Pin
HelloRedStone29-May-08 17:35
HelloRedStone29-May-08 17:35 
GeneralRe: how to set a error path to a file in asp.net page Pin
trannguyen8629-May-08 20:20
trannguyen8629-May-08 20:20 
QuestionAsp.net uniqueURL problem Pin
maithili_koli29-May-08 4:38
maithili_koli29-May-08 4:38 
QuestionHow can I detect if Application is running under high trust level Pin
Nadia Monalisa29-May-08 3:37
Nadia Monalisa29-May-08 3:37 
AnswerRe: How can I detect if Application is running under high trust level Pin
led mike29-May-08 4:40
led mike29-May-08 4:40 
GeneralRe: How can I detect if Application is running under high trust level Pin
Nadia Monalisa29-May-08 5:34
Nadia Monalisa29-May-08 5:34 
QuestionHow can i create an aspx page dynamically Pin
Satish - Developer29-May-08 3:04
Satish - Developer29-May-08 3:04 
AnswerRe: How can i create an aspx page dynamically Pin
Mogaambo29-May-08 3:07
Mogaambo29-May-08 3:07 
GeneralRe: How can i create an aspx page dynamically Pin
Satish - Developer29-May-08 3:11
Satish - Developer29-May-08 3:11 
GeneralRe: How can i create an aspx page dynamically Pin
Satish - Developer29-May-08 3:12
Satish - Developer29-May-08 3:12 
QuestionRe: How can i create an aspx page dynamically Pin
Vasudevan Deepak Kumar29-May-08 4:25
Vasudevan Deepak Kumar29-May-08 4:25 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.