Tech
Forums
Jobs
Books
Events
Videos
Conference
Annual Conference
Bcrypt
Ai Conference
Live
More
Interviews
Certification
Training
Career
Members
News
Blogs
Contribute
An Article
A Blog
A Video
An Ebook
An Interview Question
Register
Login
3
Answers
increment a alphanumeric numeric value on button click
Ask a question
Ask a question
Upload Source Code:
Select only zip and rar file.
vasu
10y
1.2k
1
Reply
How to increment a variable that is alpha numeric for every button click and display the incremented value for every increment.
If i am having a variable named Order number that is intialised to 1 and it should be concatenated to ABC like ABC1 and it should be incremented by 1 for every button click the code in C# is as follows:
ViewState["count"] = Convert.ToInt32(ViewState["count"]) + 1;
label1.Text = ViewState["count"].ToString();
if (OrderID >= 10000000)
{
CompleteOrderId = string.Concat(Prefix, OrderID.ToString());
if(CompleteOrderId.Length<=11)
label2.Text = CompleteOrderId.ToString();
OrderID++;
if (label1.Text != null)
{
(CompleteOrderId + 1).ToString();
DisplayOrderID.Text = CompleteOrderId.ToString();
DisplayOrderID.Visible = true;
}
here it is displaying the count of button click but not incrementing the completeorder ID number . Kindly help me with this. Thanks in advance
Post
Reset
Cancel
Answers (
3
)
Next Recommended Forum
textbox inside listbox in windows forms
iTextsharp Error