Note that there are some explanatory texts on larger screens.

plurals
  1. POASP.NET DetailView InsertItemTemplate
    text
    copied!<p>I have a InsertItemTemplate defined in my DeatilView control. Within this template I have a number of fields that the user fills and a number of fields that are filled automatically and the user cannot change them. These values are coming from an object stored in session.<br> Code looks like this: (I only mention necessary parts, if you need anything more let me know) </p> <pre><code>&lt;asp:DetailView ... DataSourceID="MyDataSource" ...&gt; &lt;Fields&gt; ... &lt;InsertItemTemplate&gt; // These are the fields filled by the system &lt;asp:Label ... Text='&lt;%# some value from session object %&gt;' /&gt; &lt;asp:Label ... Text='&lt;%# some value from session object %&gt;' /&gt; // some textboxes here that user fills, //they use Bind("some data source value here") to send their data to database ... &lt;/InsertItemTemplate&gt; ... &lt;/Fields&gt; &lt;/asp:DetailView&gt; </code></pre> <p>Now the problem is where I need to actually insert values into database.<br> Textbox values are sent just alright, but since I haven't bound label values they are not sent to DataSource. So I'm asking how to do this? </p> <ul> <li>An alternative I found was to pass a DefaultValue to DataSet's respective InsertParameter but I don't know how to fill that area to get it's value from Session.</li> <li>Another alternative is to set Parameter's value (not default value) to be taken from Session, which is possible but this only support values that are directly within Session, and I'm passing the value of a property inside an object that's stored in Session. Is there a way to get this fixed, other than storing values inside Session directly.</li> </ul>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload