title: Assign value to Knockout observable?
body: <p>I have a page that populates its fields(dropdowns and textboxes) from the DB when the page loads via VIEWDATA object from controller.</p>
  
  <p>I am using KnockoutJS for data-binding, below is the scenario</p>
  
  <p><strong>HTML &amp; JS(dropdown)</strong></p>
  
  <pre><code>@if (Filter!= null)
  {
      &lt;select  data-bind="options: RsnAdmAct, 
                          value: selectedRsnAdmAct, 
                          optionsCaption:'Choose...', 
                          optionsValue:'RsnAdminActionID', 
                          optionsText:'RsnAdminActionDescp',
                          optionsAfterRender: function()
                          {
                              setOptionRSN(@Filter.RsnForAdminAction);
                          }"&gt;
       &lt;/select&gt;
  }
  
  
  self.RsnAdmAct = ko.observableArray([]);
  self.selectedRsnAdmAct = ko.observable();
  $.getJSON("GetRAA", null, function (data) {
      self.RsnAdmAct(data);
  });
  
  self.selectedRsnAdmAct = ko.observable();
  self.setOptionRSN = function (x) {//reason for admin action dd
      self.selectedRsnAdmAct(x);
  };
  </code></pre>
  
  <p>this does update the drop-down with the assigned value "<strong>X</strong>".</p>
  
  <p>But the same does not assign value for the text-boxes as below</p>
  
  <p><strong>HTML &amp; JS(textbox)</strong></p>
  
  <pre><code>@if (@Filter != null)
  {
      &lt;input placeholder="Downstream"  
             data-bind="value: DownStream,
                        optionsAfterRender:function()              
                        {
                           setOptionDstream(@Filter.DownstreamNumber);
                        }"&gt;
   }
  
   self.DownStream = ko.observable();   
   self.setOptionDstream = function (x) {//down stream number
       self.DownStream(x);
   };  
  </code></pre>