Click here to Skip to main content
15,890,438 members
Home / Discussions / ASP.NET
   

ASP.NET

 
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 
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 
It looks like you have more of a JavaScript issue than anything else.

First, remove the onclick handler for the HTML tag, it's extraneous and basically binds a null event to the button I don't see a function fetrec defined anywhere, just an anonymous event handler.
HTML
<input type="button" id="BTNFET" value="@model.RecordId" /> <!-- this needs to be bound to the correct Id field. It will display as the button text, though -->

Now for the JS. I'm not 100% sure about best practices with jQuery, and $.ajax() might be a better route, but we'll roll with what you have for the moment:
JavaScript
$('#BTNFET').onclick(function (e) {
        $.post('@Url.Action("GetRecordById")',
            {
                "id": e.target.value
            },
            function (data) {
                $("#txtParti").val(data.Name);
                $("#Type").val(data.Type);
            });
    });

Now, in this context the 'this' object should be the event initiator, but that's not a guarantee. The handler will automatically be passed the event as an argument, though, and we can use that to hook the calling HTML element via the 'target' property. This has the benefit of not leaning on 'this' and therefore not needing to add a new variable into the mix.
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 
AnswerRe: asp.net mvc with desktop ui. HowTo? Pin
Afzaal Ahmad Zeeshan5-Jan-16 0:26
professionalAfzaal Ahmad Zeeshan5-Jan-16 0:26 

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.