how to pass a label value to session variable in c# in asp.net -


how pass label value session variable in c# in asp.net?

the subtotal label shows value not pass value session variable: .session["subtotal"]=subtotal.text;

my code below please #

<%@ page title="" language="c#" masterpagefile="~/siteproduct.master" autoeventwireup="true" codebehind="checkout.aspx.cs" inherits="ecommerce.checkout" %>  <asp:content id="content1" contentplaceholderid="contentplaceholder1" runat="server">      <!-- check out -->      <div class="container">  	<div class="check-sec">	   		<div class="col-md-3 cart-total">  			<a class="continue" href="default.aspx">continue basket</a>  			<div class="price-details">  				<h3>price details</h3>  				<span>total</span>                  <div class="total">  					<span class="simplecart_total"></span> </div>  			  				<span>discount</span>  			                  <span class="total1">$00.00</span>  				<span>delivery charges</span>  				                  <span class="total1">$00.00(free)</span>  				<div class="clearfix"></div>				   			</div>	  			<ul class="total_price">  			   <li class="last_price"> <h4>total</h4></li>	  			  	                  <div class="total">  					<span class="simplecart_total"></span> </div>	     			</ul>   			<div class="clearfix"></div>  			<div class="clearfix"></div>  			<a class="order" href="checkoutsignin.aspx">place order</a>  			  		</div>  		<div class="col-md-9 cart-items">  			<h1>my shopping bag </h1>                               <%--here  cart view start 06/06/2016   --%>                                                           <table  style="width:100%;"  class="table table-hover">                      <ul  >                            <tr style="width:100%;"   >                                                        <td style="width:100%;color:red;background-color:lightblue;margin:10px;display:inline-block;padding:18px;" class="simplecart_items">                                          </td>               </tr>               </ul>                                            <tr >      <td>    </td>      <td>   </td>      <td>   </td>      <td><h5>subtotal</h5></td>      <td>                  <div><asp:label id="subtotal" class="simplecart_total" runat="server"></asp:label></div>                </td>  </tr>  <tr>      <td>   </td>      <td>   </td>      <td>   </td>      <td><h5>estimated shipping</h5></td>      <td><div class="simplecart_shipping"></div></td>  </tr>  <tr>      <td>   </td>      <td>   </td>      <td>   </td>      <td><h3>total</h3></td>      <td>          <div id="grandtotal" class="simplecart_grandtotal"></div>        </td>  </tr>  <tr>      <td>   </td>      <td>   </td>      <td>   </td>      <td>   </td>          <td><a class="order" href="checkoutsignin.aspx">finalcheckout</a></td>      <td style="visibility:hidden"> <asp:textbox id="mytextbox" runat="server"></asp:textbox>  </td>            </tr>                     </table>                                                                       <%-- here cart view end 06/06/2016--%>                 <%-- part close start 07/06/2016--%>    				                  <%-- part close end 07/06/2016--%>            		</div>  		<div class="clearfix"> </div>  	</div>  </div>  <!-- //check out -->  </asp:content>     

try this:

        <asp:label id="subtotal" text="sometext" class="simplecart_total" runat="server"></asp:label>         <%session["subtotal"] = subtotal.text; %> 

Comments

Popular posts from this blog

magento2 - Magento 2 admin grid add filter to collection -

Android volley - avoid multiple requests of the same kind to the server? -

Combining PHP Registration and Login into one class with multiple functions in one PHP file -