Auto-increment linear increment ,Asp.net,C#

Posted by Raja_89 under ASP.NET on 2/28/2013 | Points: 10 | Views : 2828 | Status : [Member] | Replies : 2
Hai
1. How can i generate a auto increment linear alphanumeric no in label when i click button

EX:std1000

The no should be generated after button was clicked once again




Responses

Posted by: Somu475 on: 2/28/2013 [Member] Starter | Points: 25

Up
0
Down
Hi Raja,

Only number should be incremented with std remaining same right..??

std1000, std1001, std1002, etc...

Let me know it's like this only or not....

-Somu

Raja_89, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Satyapriyanayak on: 2/28/2013 [Member] [MVP] Silver | Points: 25

Up
0
Down
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

namespace WebApplication15
{
public partial class WebForm2 : System.Web.UI.Page
{

string s1 = "std100";
protected void Button1_Click(object sender, EventArgs e)
{
int count = 0;
count++;
ViewState["count"] = Convert.ToInt32(ViewState["count"]) + count;
Label1.Text = s1+ ViewState["count"].ToString();

}
}
}


If this post helps you mark it as answer
Thanks

Raja_89, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response