hi everyone,
i want to add 10 strings in array and i have one textbox in that am going to add new array that need to be added as 11 string onclick of show button then again 12 string again it should be added to that 11 strings...and so on... how to do this??
am sharing what i have tried..
Source code::
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="arrytxt.aspx.cs" Inherits="Validators.Examples.arrytxt" %>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Text;
namespace Validators.Examples
{
public partial class arrytxt : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
private List ResultArray
{
get
{
if (Session["resultArray"] == null)
Session["resultArray"] = new List();
return (List)Session["resultArray"];
}
}
protected void btnAdd_Click(object sender, EventArgs e)
{
ResultArray.Add(txtNewText.Text);
txtNewText.Text = string.Empty;
}
protected void btnShow_Click(object sender, EventArgs e)
{
StringBuilder sb = new StringBuilder();
foreach (string s in ResultArray)
{
sb.Append("
" + s);
" + s);
}
lblResultingText.Text = sb.ToString();
}
}
}
Web application using C#..
Manas MohapatraPosted Aug 13, 2015, 8:20 AM
Sumit JoshiPosted Aug 13, 2015, 8:28 AM
SreenishPosted Aug 13, 2015, 7:53 AM
Sumit JoshiPosted Aug 13, 2015, 7:50 AM
SreenishPosted Aug 13, 2015, 7:45 AM
Manas MohapatraPosted Aug 13, 2015, 3:46 AM
SreenishPosted Aug 13, 2015, 3:38 AM
Manas MohapatraPosted Aug 13, 2015, 3:33 AM
", ResultArray).ToString();