c# - how can I show the user that the data is gone when he trying to edit a field? -


Thus when a user clicks on the edit link to edit one of the clients (field) How can the client wipe out? Can the user be shown that the customer (field) has gone?

Is there another way to use I'am's TempData? I think jquery but I do not know how to use it properly

  edit public functioning (int id) {client cliente = db.Clients.Find (id); If (cliente! = Null) {see return (cliente); } TempData ["message"] = string.Format ("This customer is expunged to another user"); Return Redirect Action ("Index"); }   

Edit:

See more

  & lt; Table class = "widgets" & gt; & Lt; TR & gt; & Lt; Th & gt; & Lt; / Th & gt; & Lt; Th & gt; @HTMLconnect ("numbe", "index", new {ordenasien = vyubag.NamesSortperm, filetro = vubag.filter}}  & lt; / tr & gt; @forchar (Miscellaneous in the model Objects) {& lt; tr id = "widget-id-@item.id"> LT; TD & gt; @ HTMLActionLink ("editor", "edit", new id = ITIDID}) | @ Ajax.exeLink ("Eleminar", "Eleminer", "Client", New {item.id}, New Ajax Option {HttpMethod = "POST", Confirmation = String.format ("Esta Seguro Queen Quo Nir Aminner '{0}'? ", Item.descripcion), OnSuccess =" deleteConfirmation "})  & lt; tt & gt; @html displayform (model itam => iddateccipian)   

Will I have this script guees? That's why I have to make my editing link I did it for the link (elyer) link using the @JaxActionLink?

  & script; script type = "text / javascript"> var validateForEdit = function (id) { Val valid CallbackFunction = function (Par Result) {if (result) {window.location = '/ Client / Edit' / '+ id; } And (window 'Alert' ('This customer is wiped out to another user');}}; $ .post ('/ client / validifier /', {id: id}, valid callbone function, 'jason') ;} & Lt; / script & gt;    

Hi You can edit user Before validating the data, you can use the following code

  var is valid again Edit = function {id} validate {blackback function = function (results) {if (result) {win Dow.location = '/ client / edit /' + id;} and {warning ('this customer has been expunged for another user');}}; $ .post ('/ client / validfeed /', {id : Id}, valid callbone function, 'jason');}   

and your actions:

  [http post] Public JSNet Validated (Anti ID) {Var cliente = db.Clients.Find (id); return customer! = Tap? Jason (true): Jason (false);}   

edit: And you have to change your following code

  @ html.ActionLink ("Editar", "Edit", Or {id = item.id})   

with this code:

  input class = "button" type = "button" value = "edited Do "onclick =" valid fordid (item.id) "/>   

Hope this help

Comments

Popular posts from this blog

java - NullPointerException for a 2d Array -

python - Assemble mpeg file unable to play in mediaplayer -

c# - NameSpace Manager or XsltContent to parse aspx page -