Click here to Skip to main content
15,891,837 members
Home / Discussions / C#
   

C#

 
Questionneed some guidance and advice to build a questionnaire system similar to Google forms in vb.net or c# and sql server Pin
albasheer210019-Nov-20 18:09
albasheer210019-Nov-20 18:09 
Rant[REPOST] need some guidance and advice to build a questionnaire system similar to Google forms in vb.net or c# and sql server Pin
Richard Deeming19-Nov-20 21:45
mveRichard Deeming19-Nov-20 21:45 
AnswerRe: need some guidance and advice to build a questionnaire system similar to Google forms in vb.net or c# and sql server Pin
Gerry Schmitz20-Nov-20 6:04
mveGerry Schmitz20-Nov-20 6:04 
QuestionHelp with Docker Pin
pkfox18-Nov-20 20:30
professionalpkfox18-Nov-20 20:30 
AnswerRe: Help with Docker Pin
Gerry Schmitz19-Nov-20 4:26
mveGerry Schmitz19-Nov-20 4:26 
GeneralRe: Help with Docker Pin
pkfox19-Nov-20 4:28
professionalpkfox19-Nov-20 4:28 
GeneralRe: Help with Docker Pin
Pete O'Hanlon19-Nov-20 4:39
mvePete O'Hanlon19-Nov-20 4:39 
GeneralRe: Help with Docker Pin
pkfox19-Nov-20 6:49
professionalpkfox19-Nov-20 6:49 
QuestionHow to save DataGridView content? Pin
Alex Dunlop17-Nov-20 21:35
Alex Dunlop17-Nov-20 21:35 
AnswerRe: How to save DataGridView content? Pin
Richard Deeming17-Nov-20 21:39
mveRichard Deeming17-Nov-20 21:39 
AnswerRe: How to save DataGridView content? Pin
OriginalGriff17-Nov-20 21:49
mveOriginalGriff17-Nov-20 21:49 
GeneralRe: How to save DataGridView content? Pin
Alex Dunlop18-Nov-20 6:05
Alex Dunlop18-Nov-20 6:05 
GeneralRe: How to save DataGridView content? Pin
OriginalGriff18-Nov-20 6:21
mveOriginalGriff18-Nov-20 6:21 
GeneralRe: How to save DataGridView content? Pin
Alex Dunlop18-Nov-20 6:05
Alex Dunlop18-Nov-20 6:05 
GeneralRe: How to save DataGridView content? Pin
Mycroft Holmes18-Nov-20 11:14
professionalMycroft Holmes18-Nov-20 11:14 
Question.NET5 publish selfcontained: issue with App.config Pin
Super Lloyd17-Nov-20 14:31
Super Lloyd17-Nov-20 14:31 
AnswerRe: .NET5 publish selfcontained: issue with App.config Pin
Richard Deeming17-Nov-20 17:46
mveRichard Deeming17-Nov-20 17:46 
GeneralRe: .NET5 publish selfcontained: issue with App.config Pin
Super Lloyd17-Nov-20 18:12
Super Lloyd17-Nov-20 18:12 
AnswerRe: .NET5 publish selfcontained: issue with App.config Pin
Gerry Schmitz17-Nov-20 20:46
mveGerry Schmitz17-Nov-20 20:46 
GeneralRe: .NET5 publish selfcontained: issue with App.config Pin
Super Lloyd17-Nov-20 20:52
Super Lloyd17-Nov-20 20:52 
GeneralRe: .NET5 publish selfcontained: issue with App.config Pin
Gerry Schmitz17-Nov-20 20:59
mveGerry Schmitz17-Nov-20 20:59 
GeneralRe: .NET5 publish selfcontained: issue with App.config Pin
Super Lloyd17-Nov-20 21:16
Super Lloyd17-Nov-20 21:16 
GeneralRe: .NET5 publish selfcontained: issue with App.config Pin
Gerry Schmitz18-Nov-20 7:05
mveGerry Schmitz18-Nov-20 7:05 
QuestionHow to reference resource from Resources file Pin
Bootzilla3316-Nov-20 13:56
Bootzilla3316-Nov-20 13:56 
I have a bunch of messages in a Constants file that I want to convert all string constants for messages displayed to users to be moved to a localized/globalization resource file.

I created a Resources.resx file and I'm trying to figure out how to reference a resource in a controller. For example this resource in my Resources.resx file
internal static string ExamItemResponseAddSuccessfully {
           get {
               return ResourceManager.GetString("ExamItemResponseAddSuccessfully", resourceCulture);
           }
       }


I want to reference it in a controller POST action to replace the bolded reference to the string constant in the method below. How do I reference the resource above in the method below.

public async Task<IActionResult> CreateDorItemResponse(CreateEditDorItemResponseViewModel dorToCreateItemResponse, CancellationToken cancellationToken)
       {
           // Create a new Dor Item PacketResponse to receive the required properties from the view model
           var newDorItemResponse = new DorItemResponse();

           // Attempt to transfer the properties from the view model into the Dor
           if (ModelState.IsValid)
           {
               try
               {
                   //Get the item to return back to Edit Item page.
                   var item = await _dorService.GetItemAsync(dorToCreateItemResponse.ItemId, cancellationToken)
                       .ConfigureAwait(true);
                   // Save the Dor Item Response
                   _mapper.Map(dorToCreateItemResponse, newDorItemResponse);
                   newDorItemResponse.CreatedBy = User.Identity.Name;
                   newDorItemResponse.ModifiedBy = User.Identity.Name;
                   await _dorService.CreateEditItemResponse(newDorItemResponse, User.Identity.Name, cancellationToken).ConfigureAwait(true);
                   TempData.Put(TempDataKey.Dor.RESPONSE_ADD_MESSAGE, StatusMessageModel.Create(Constants.Dor.RESPONSE_ADD_SUCCESS, false));
                   return RedirectToAction(nameof(EditDorItem), new {id = item.ItemId, dorId = item.DorId});
               }
               catch (Exception)
               {
                   // Save failed, add an error message and reload the same page
                   TempData.Put(TempDataKey.Dor.RESPONSE_ADD_MESSAGE, StatusMessageModel.Create(Constants.Dor.RESPONSE_UPDATE_FAIL));
               }
           }
           // Validation failed, reload the same page
           return View(dorToCreateItemResponse);
       }

AnswerRe: How to reference resource from Resources file Pin
Richard Deeming16-Nov-20 21:45
mveRichard Deeming16-Nov-20 21:45 

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.