Click here to Skip to main content
15,902,721 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: Encrypted Web.Config files and Updates Pin
ZurdoDev13-Jan-16 3:02
professionalZurdoDev13-Jan-16 3:02 
GeneralRe: Encrypted Web.Config files and Updates Pin
redtwister13-Jan-16 4:28
redtwister13-Jan-16 4:28 
QuestionA namespace cannot directly contain members such as fields or methods Pin
indian14311-Jan-16 14:46
indian14311-Jan-16 14:46 
AnswerRe: A namespace cannot directly contain members such as fields or methods Pin
deepankarbhatnagar12-Jan-16 1:01
professionaldeepankarbhatnagar12-Jan-16 1:01 
QuestionSaving the Values entering dynamically created Textbox into database Pin
Member 1062539411-Jan-16 0:48
Member 1062539411-Jan-16 0:48 
AnswerRe: Saving the Values entering dynamically created Textbox into database Pin
deepankarbhatnagar12-Jan-16 0:25
professionaldeepankarbhatnagar12-Jan-16 0:25 
QuestionUse store Proc in NetTier code smith Pin
indian14310-Jan-16 17:18
indian14310-Jan-16 17:18 
QuestionFILL HTML.EDITFOR FIELDS ON BUTTON CLICK IN ASP.NET MVC Pin
pathllk10-Jan-16 4:27
pathllk10-Jan-16 4:27 
Dear Friends I am new MVC world & working in a project. I want to fill some html.editfor fields on a button click. My tried the given below codes:

Controller action:
C#
[HttpPost]
       public JsonResult GetRecordById(string  id)
       {
           var record = dc.TABLE1.FirstOrDefault(x => x.PART_NO == id);
           var result = new
           {
               Name = record.PARTI,
               Type = record.TYPE
           };
           return Json(result, JsonRequestBehavior.AllowGet);
       }


VIEW:
C#
<script type="text/javascript">
   $(function () {
       $("#txtParti").autocomplete({
          source: '@Url.Action("GetParti")'
       });
   });
       $(function () {
           $("#txtPtno").autocomplete({
               source: '@Url.Action("GetPtno")'
           });
       });
       $('#BTNFET').onclick(function (fetrec) {
           var recordId = this.value;
           $.post('@Url.Action("GetRecordById")',
               {
                   "id": recordId
               },
               function (data) {
                   $("#txtParti").val(data.Name);
                   $("#Type").val(data.Type);
               });
       });
   </script>

HTML
<input type="button" id="BTNFET" onclick="fetrec();" />
 @Html.EditorFor(model => model.PARTI, new { htmlAttributes = new { @class = "form-control", @id = "txtParti", @placeholder = "PART NAME" } })
@Html.EditorFor(model => model.PART_NO, new { htmlAttributes = new { @class = "form-control", @id = "txtPtno", @placeholder = "PART NO" } })
 @Html.EditorFor(model => model.TYPE, new { htmlAttributes = new { @class = "form-control", @id = "Type", @placeholder = "ITEM TYPE" } })



On the above codes Auto complete part working pefectly, Button click not working. So, friends please help me in this regard.
AnswerRe: FILL HTML.EDITFOR FIELDS ON BUTTON CLICK IN ASP.NET MVC Pin
Nathan Minier11-Jan-16 2:06
professionalNathan Minier11-Jan-16 2:06 
GeneralRe: FILL HTML.EDITFOR FIELDS ON BUTTON CLICK IN ASP.NET MVC Pin
deepankarbhatnagar12-Jan-16 0:14
professionaldeepankarbhatnagar12-Jan-16 0:14 
Questionhow to compare two text box values Pin
Member 122511847-Jan-16 18:34
Member 122511847-Jan-16 18:34 
AnswerRe: how to compare two text box values Pin
F-ES Sitecore7-Jan-16 21:51
professionalF-ES Sitecore7-Jan-16 21:51 
SuggestionRe: how to compare two text box values Pin
bVagadishnu8-Jan-16 7:36
bVagadishnu8-Jan-16 7:36 
GeneralRe: how to compare two text box values Pin
Richard Deeming8-Jan-16 7:47
mveRichard Deeming8-Jan-16 7:47 
GeneralRe: how to compare two text box values Pin
bVagadishnu8-Jan-16 9:37
bVagadishnu8-Jan-16 9:37 
AnswerRe: how to compare two text box values Pin
Richard MacCutchan7-Jan-16 22:14
mveRichard MacCutchan7-Jan-16 22:14 
QuestionTextbox is losing its value in PostBack Pin
indian1436-Jan-16 10:45
indian1436-Jan-16 10:45 
AnswerRe: Textbox is losing its value in PostBack Pin
JHizzle6-Jan-16 22:30
JHizzle6-Jan-16 22:30 
QuestionRadEditor is disabled possibly because of AJAX Manager Pin
indian1435-Jan-16 16:00
indian1435-Jan-16 16:00 
AnswerRe: RadEditor is disabled possibly because of AJAX Manager Pin
JHizzle6-Jan-16 3:41
JHizzle6-Jan-16 3:41 
GeneralRe: RadEditor is disabled possibly because of AJAX Manager Pin
indian1436-Jan-16 10:33
indian1436-Jan-16 10:33 
QuestionAbout Online Shopping In Asp.net and linq Pin
SunnyMistry0074-Jan-16 22:36
SunnyMistry0074-Jan-16 22:36 
AnswerRe: About Online Shopping In Asp.net and linq Pin
F-ES Sitecore4-Jan-16 22:48
professionalF-ES Sitecore4-Jan-16 22:48 
AnswerRe: About Online Shopping In Asp.net and linq Pin
Afzaal Ahmad Zeeshan5-Jan-16 0:05
professionalAfzaal Ahmad Zeeshan5-Jan-16 0:05 
Questionasp.net mvc with desktop ui. HowTo? Pin
Frygreen4-Jan-16 9:23
Frygreen4-Jan-16 9:23 

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.