Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Html helper in c# mvc app

Html helper in c# mvc app

Scheduled Pinned Locked Moved ASP.NET
helpcsharphtmlasp-netdatabase
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • E Offline
    E Offline
    e heldon
    wrote on last edited by
    #1

    I don't know if I am in the right place to ask a question in reference to using a variable inside a view. I want the variable to go inside the @Html.EditorFor(model => variable). Any help appreciated. Thanks. UPDATE: I think I have solved my problem. My application is used to store internet sites user/password information. The data is stored in data/value pairs. The value is encrypted with my own code. I needed to run the value item through the encryption code so it could be stored in the database. I created another object with data from the database, and compared the two value objects to see if it should be saved. If so the value item was run through the encrypt code. Then the second object was unattached and the edited object saved. Thanks for the help.

    L J 2 Replies Last reply
    0
    • E e heldon

      I don't know if I am in the right place to ask a question in reference to using a variable inside a view. I want the variable to go inside the @Html.EditorFor(model => variable). Any help appreciated. Thanks. UPDATE: I think I have solved my problem. My application is used to store internet sites user/password information. The data is stored in data/value pairs. The value is encrypted with my own code. I needed to run the value item through the encryption code so it could be stored in the database. I created another object with data from the database, and compared the two value objects to see if it should be saved. If so the value item was run through the encrypt code. Then the second object was unattached and the edited object saved. Thanks for the help.

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      You can have that variable as part of your your view model so you can use it on view. Assuming you have requirement to use it as html helper only per your code you showing in description.

      E 1 Reply Last reply
      0
      • E e heldon

        I don't know if I am in the right place to ask a question in reference to using a variable inside a view. I want the variable to go inside the @Html.EditorFor(model => variable). Any help appreciated. Thanks. UPDATE: I think I have solved my problem. My application is used to store internet sites user/password information. The data is stored in data/value pairs. The value is encrypted with my own code. I needed to run the value item through the encryption code so it could be stored in the database. I created another object with data from the database, and compared the two value objects to see if it should be saved. If so the value item was run through the encrypt code. Then the second object was unattached and the edited object saved. Thanks for the help.

        J Offline
        J Offline
        John C Rayan
        wrote on last edited by
        #3

        What do you want to do with the variable ? It can be part of the model. Post a sample code for what you are trying to do.

        E 1 Reply Last reply
        0
        • L Lost User

          You can have that variable as part of your your view model so you can use it on view. Assuming you have requirement to use it as html helper only per your code you showing in description.

          E Offline
          E Offline
          e heldon
          wrote on last edited by
          #4

          Vinod, UPDATE: I think I have solved my problem. My application is used to store internet sites user/password information. The data is stored in data/value pairs. The value is encrypted with my own code. I needed to run the value item through the encryption code so it could be stored in the database. I created another object with data from the database, and compared the two value objects to see if it should be saved. If so the value item was run through the encrypt code. Then the second object was unattached and the edited object saved. Thanks for the help.

          1 Reply Last reply
          0
          • J John C Rayan

            What do you want to do with the variable ? It can be part of the model. Post a sample code for what you are trying to do.

            E Offline
            E Offline
            e heldon
            wrote on last edited by
            #5

            John, UPDATE: I think I have solved my problem. My application is used to store internet sites user/password information. The data is stored in data/value pairs. The value is encrypted with my own code. I needed to run the value item through the encryption code so it could be stored in the database. I created another object with data from the database, and compared the two value objects to see if it should be saved. If so the value item was run through the encrypt code. Then the second object was unattached and the edited object saved. Thanks for the help.

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups