Click here to Skip to main content
15,867,834 members
Home / Discussions / C#
   

C#

 
QuestionClickOnce app launching separate executable being detected as a virus Pin
MichaelC#Noob25-Jul-16 9:44
professionalMichaelC#Noob25-Jul-16 9:44 
AnswerRe: ClickOnce app launching separate executable being detected as a virus Pin
Dave Kreskowiak25-Jul-16 12:51
mveDave Kreskowiak25-Jul-16 12:51 
GeneralRe: ClickOnce app launching separate executable being detected as a virus Pin
MichaelC#Noob25-Jul-16 14:43
professionalMichaelC#Noob25-Jul-16 14:43 
GeneralRe: ClickOnce app launching separate executable being detected as a virus Pin
OriginalGriff25-Jul-16 19:04
mveOriginalGriff25-Jul-16 19:04 
GeneralRe: ClickOnce app launching separate executable being detected as a virus Pin
MichaelC#Noob26-Jul-16 10:39
professionalMichaelC#Noob26-Jul-16 10:39 
AnswerRe: ClickOnce app launching separate executable being detected as a virus Pin
Bernhard Hiller25-Jul-16 21:35
Bernhard Hiller25-Jul-16 21:35 
GeneralRe: ClickOnce app launching separate executable being detected as a virus Pin
MichaelC#Noob26-Jul-16 10:44
professionalMichaelC#Noob26-Jul-16 10:44 
QuestionSending DropDownList Data Pin
MadDashCoder25-Jul-16 8:49
MadDashCoder25-Jul-16 8:49 
I am trying to send data from a View to be saved in the database.
Below are snippets of code in my Edit View and the EditController method
Edit View
/////////////////////////////////////////////////////////////////

<tr>
  <td>@Html.LabelFor(model=>model.Category.ID, "Category")</td>                
  <td>
      @Html.DropDownListFor(model => model.ProductCategories, 
      ViewBag.categoryList as IEnumerable<SelectListItem>,
      (string)ViewBag.ProductCategoryName)
  </td> 
</tr>

/////////////////////////////////////////////////////////////////

Edit Method in EditController

       [HttpPost]
        public ActionResult Edit(ProductViewModel pvm)
        {
            ProductServiceClient psc = new ProductServiceClient();
            psc.EditProduct(pvm.Product);
            return RedirectToAction("Index");
        }


Above is a snippet of the code in the Edit View, users are sent to the Edit View from the Index View when they select the Edit link associated with a product in the Index View.

There are two ViewBags used in populating the dropdownlist in the Edit View.

ViewBag.categoryList contains data from the Product Category which had been added to a IEnumerable<selectlistitem> object.

ViewBag.ProductCategoryName contains a the product category name of the product that the user had selected in the Index View.

Below is my ViewModel
public class ProductViewModel
{
    public Product Product
    { get;set;}

    public Category Category
    {get;set;}

    public ProductCategory ProductCategory
    {get;set;}

    private IEnumerable<SelectListItem> productCategories;

    public IEnumerable<SelectListItem> ProductCategories
    {
        get
        {
            return productCategories ?? new List<SelectListItem>();
        }
        set
        {
            productCategories = value;
        }
    }
}


The above code is not working, I cannot save the form data when clicking the Save button.

modified 26-Jul-16 1:38am.

QuestionShowing a custom balloon tip icon Pin
Member 1209073125-Jul-16 1:46
Member 1209073125-Jul-16 1:46 
AnswerRe: Showing a custom balloon tip icon Pin
Curry Francis25-Jul-16 1:53
Curry Francis25-Jul-16 1:53 
AnswerRe: Showing a custom balloon tip icon Pin
Ravi Bhavnani25-Jul-16 5:36
professionalRavi Bhavnani25-Jul-16 5:36 
QuestionLINQ Join Result Is Null Pin
MadDashCoder24-Jul-16 9:15
MadDashCoder24-Jul-16 9:15 
AnswerRe: LINQ Join Result Is Null Pin
Mycroft Holmes24-Jul-16 14:30
professionalMycroft Holmes24-Jul-16 14:30 
GeneralRe: LINQ Join Result Is Null Pin
MadDashCoder24-Jul-16 18:24
MadDashCoder24-Jul-16 18:24 
AnswerRe: LINQ Join Result Is Null Pin
Richard Deeming24-Jul-16 22:31
mveRichard Deeming24-Jul-16 22:31 
GeneralRe: LINQ Join Result Is Null Pin
MadDashCoder25-Jul-16 4:51
MadDashCoder25-Jul-16 4:51 
QuestionWhat is the correct code to invoke subscribers for an event? Pin
User 1106097923-Jul-16 21:16
User 1106097923-Jul-16 21:16 
AnswerRe: What is the correct code to invoke subscribers for an event? Pin
BillWoodruff23-Jul-16 21:31
professionalBillWoodruff23-Jul-16 21:31 
GeneralRe: What is the correct code to invoke subscribers for an event? Pin
User 1106097923-Jul-16 21:54
User 1106097923-Jul-16 21:54 
GeneralRe: What is the correct code to invoke subscribers for an event? Pin
BillWoodruff23-Jul-16 22:03
professionalBillWoodruff23-Jul-16 22:03 
GeneralRe: What is the correct code to invoke subscribers for an event? Pin
Richard MacCutchan24-Jul-16 1:31
mveRichard MacCutchan24-Jul-16 1:31 
GeneralRe: What is the correct code to invoke subscribers for an event? Pin
BillWoodruff24-Jul-16 2:59
professionalBillWoodruff24-Jul-16 2:59 
GeneralRe: What is the correct code to invoke subscribers for an event? Pin
Richard MacCutchan24-Jul-16 4:28
mveRichard MacCutchan24-Jul-16 4:28 
GeneralRe: What is the correct code to invoke subscribers for an event? Pin
Richard Deeming24-Jul-16 22:15
mveRichard Deeming24-Jul-16 22:15 
AnswerRe: What is the correct code to invoke subscribers for an event? Pin
Pete O'Hanlon23-Jul-16 23:43
subeditorPete O'Hanlon23-Jul-16 23:43 

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.