Click here to Skip to main content
16,006,749 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionHow to sense user's session's timeout Pin
IamMohan23-Aug-06 20:33
IamMohan23-Aug-06 20:33 
Questionhow to do two tasks in same buton Pin
Kissy1623-Aug-06 20:31
Kissy1623-Aug-06 20:31 
AnswerRe: how to do two tasks in same buton Pin
Guffa23-Aug-06 20:59
Guffa23-Aug-06 20:59 
GeneralRe: how to do two tasks in same buton Pin
Kissy1623-Aug-06 21:54
Kissy1623-Aug-06 21:54 
GeneralRe: how to do two tasks in same buton Pin
Irshad Sulaimani23-Aug-06 23:01
Irshad Sulaimani23-Aug-06 23:01 
GeneralRe: how to do two tasks in same buton Pin
Kissy1624-Aug-06 1:16
Kissy1624-Aug-06 1:16 
GeneralRe: how to do two tasks in same buton Pin
_AK_24-Aug-06 1:19
_AK_24-Aug-06 1:19 
GeneralRe: how to do two tasks in same buton Pin
Irshad Sulaimani24-Aug-06 2:09
Irshad Sulaimani24-Aug-06 2:09 
Ok...
Now I understand it. I would suggest you to take a static string say strSaveMode. Assign its value as "Add" on Add button click or if Update button is clicked then assign its value as "Update".

On clicking on Save button check the value of strSaveMode.If it is "Add" then call Add block of code. If it is Update then call Update block code.

Example:

Let cmdAdd,cmdUpdate and cmdSave are three buttons.
Declare a string at the class level like:

static string strSaveMode = "";

Now, In cmdAdd button click method:

-----
strSaveMode = "Add" ;
-----
-----

Similarly ,
write
In cmdUpdate button click method:

-----
strSaveMode = "Update" ;
-----
-----

Then in cmdSave button click :
-----
if(strSaveMode == "Add")
// Add Block
else if (strSaveMode == "Update")
//Update Block.


Hope it works.;)




Irshad Ahmad
GeneralRe: how to do two tasks in same buton Pin
Kissy1624-Aug-06 20:23
Kissy1624-Aug-06 20:23 
GeneralRe: how to do two tasks in same buton Pin
Irshad Sulaimani24-Aug-06 20:29
Irshad Sulaimani24-Aug-06 20:29 
GeneralRe: how to do two tasks in same buton Pin
Kissy1624-Aug-06 21:50
Kissy1624-Aug-06 21:50 
GeneralRe: how to do two tasks in same buton Pin
Irshad Sulaimani25-Aug-06 0:22
Irshad Sulaimani25-Aug-06 0:22 
GeneralRe: how to do two tasks in same buton Pin
Kissy1625-Aug-06 1:24
Kissy1625-Aug-06 1:24 
GeneralRe: how to do two tasks in same buton Pin
Irshad Sulaimani25-Aug-06 2:02
Irshad Sulaimani25-Aug-06 2:02 
GeneralRe: how to do two tasks in same buton Pin
Irshad Sulaimani25-Aug-06 2:03
Irshad Sulaimani25-Aug-06 2:03 
GeneralRe: how to do two tasks in same buton Pin
Paddy Boyd23-Aug-06 23:21
Paddy Boyd23-Aug-06 23:21 
QuestionHow to identify location of controls in asp.net 2.0 Pin
Kuricheti23-Aug-06 20:17
Kuricheti23-Aug-06 20:17 
QuestionDrag and drop items between two listboxes in asp.net with c# Pin
Kuricheti23-Aug-06 20:10
Kuricheti23-Aug-06 20:10 
QuestionJavascript, dropdown menu layer gets displayed behind server controls Pin
varun_khanna1723-Aug-06 19:38
varun_khanna1723-Aug-06 19:38 
Questionfolder browsing using TreeView Control Pin
248912823-Aug-06 19:15
248912823-Aug-06 19:15 
QuestionNeural Networks[Modified] Pin
Vsree23-Aug-06 18:58
Vsree23-Aug-06 18:58 
Questionexport to excel using xslt when the column name contains blank?? Pin
steven_wong23-Aug-06 16:54
steven_wong23-Aug-06 16:54 
QuestionASP.NET Cookies Pin
Socheat.Net23-Aug-06 16:51
Socheat.Net23-Aug-06 16:51 
AnswerRe: ASP.NET Cookies Pin
steven_wong23-Aug-06 17:14
steven_wong23-Aug-06 17:14 
GeneralRe: ASP.NET Cookies Pin
Socheat.Net25-Aug-06 15:15
Socheat.Net25-Aug-06 15:15 

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.