Click here to Skip to main content
15,867,704 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
When i click on Save button. Data is saving in database . After Saving data add counting . Count is 1$ , Add another record, Click Save Button , Add Another one more doller.
Posted
Updated 27-Feb-14 18:53pm
v4
Comments
Sergey Alexandrovich Kryukov 28-Feb-14 0:01am    
Please don't re-post; this is considered as abuse. Also, this is not a question, despite the question mark.
—SA
dan!sh 28-Feb-14 0:02am    
I don't think anyone here is going to write code for you for free. Please try something if you haven't done yet or share what you have tried so far.
Sai Prasad anumolu 28-Feb-14 0:07am    
kkk , I am very confusing sir , please help me
bbirajdar 28-Feb-14 0:10am    
Show your code
Sai Prasad anumolu 28-Feb-14 0:12am    
This is my code .... Save button Logic sir, I need how to count 1$ After Save Button Click .And save the count in database

try
{

string FileName = Path.GetFileName(FileStartUpBanner.PostedFile.FileName);
// Page.ClientScript.RegisterStartupScript(typeof(Page), "openPopup", "firstPopup();", true);
if (ChechStartUpBanner.Checked == true)
{
con.Open();
Page.ClientScript.RegisterStartupScript(typeof(Page), "openPopup", "firstPopup();", true);

if (FileStartUpBanner.HasFile == true && FileStartUpBanner.FileName != null && FileStartUpBanner.PostedFile.ToString() != " ")
{
FileStartUpBanner.SaveAs(Server.MapPath("~/Images/" + FileName));
SqlCommand cmd = new SqlCommand("StartUpBanner_SP", con);
cmd.CommandType = CommandType.StoredProcedure;

cmd.Parameters.AddWithValue("@ImagePath", "~/Images/" + FileName);

int res = cmd.ExecuteNonQuery();
if (res > 0)
{

uploadmessage.Visible = true;
uploadmessage.Text = "Your File Uploadad SucessFully";
imagepreview.Visible = true;
startupimg.Visible = true;
btnStartDelete.Visible = true;
btnStartEdit.Visible = true;
btnStateUpUpdate.Visible = false;
ChechStartUpBanner.Visible = false;
}
ChechStartUpBanner.Checked = false;

}
else
{
uploadmessage.Visible = true;
uploadmessage.Text = "Please Choose Your File ";

}
StartBanner();

}

1 solution

  • Declare one HiddenField on your page.
  • On Button Click, after the Database operation, check, increment and assign required Text to that HiddenField.
 
Share this answer
 
Comments
Sai Prasad anumolu 28-Feb-14 0:25am    
Can you please send me sample code me .... Definitely ,I will try Sir and get the output ...Give me guidence
Just inside the Button Click, after the Database operation...

if(!string.IsNullOrEmpty(yourHiddenFieldID.Value))
{
yourHiddenFieldID.Value += yourHiddenFieldID.Value + "$";
}
else
{
yourHiddenFieldID.Value = "1$";
}
Sai Prasad anumolu 28-Feb-14 0:34am    
Thank you Sir .....I have any i will Ask another time ..Help me ...I have less logic thinking
No problem Sai. Most welcome. Just add question on Code Project when you face issues.

Please accept this answer, if it has helped you in any way.
This will help others to find the answer in one go and you will also be awarded with some points for this action...

Thanks,
Tadit
Sai Prasad anumolu 6-Mar-14 5:18am    
hi sir i need Open Another Division When i will click add button

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900