使用ASP.NET C#存储从本地存储中的数据库代码提交的标签值 [英] Store value of label comming from database code in local storage using ASP.NET C#

查看:52
本文介绍了使用ASP.NET C#存储从本地存储中的数据库代码提交的标签值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在与电子商务网站合作,我坚持使用本地存储部分。

使用本地存储来存储产品名称和ID,由客户选择。

和问题是我的标签定义不存储产品名称和ID作为输入类型。

请帮助



我尝试了什么:



  <   h4  >  
< input name = lblpname id = lblpname type = text / > < / h4 >
< 输入 name = lblid id = lblid type = text / > <% - < input name =lblidid =lblidtype =text/> - %&g t;
<% - < h4> ;
< asp:Label ID =pnamename =lblidrunat =server>< / h4>
< asp:标签ID =idname =lblidrunat =server>
- %>



和代码是

  int  Prd = Convert.ToInt32(会话[  Product_Id]); 
var single1 =(来自 PD in drop.PRODUCT_DBM
join PS in drop.Prod_Size on PD.Product_Id等于PS .product_id
join SM in drop.Stock_Master on PD.Product_Id等于SM.Prod_Id
其中 PD.Product_Id == Prd
选择 new {PS.Size,PD.Model_Name,PD.Model_color,SM.MRP,PD.Product_Detail,PD.Product_Name,PD.Product_type}。)ToList()。FirstOrDefault();
var text1 =请求[ lblpname ];
text1 = single1.Product_Name;
// pname.Text = Request.Form [hfName.UniqueID];
lbldtl.Text = single1.Product_Detail;
lblmodelname.Text = single1.Model_Name;
lblprice.Text = single1.MRP.ToString();
lbltype.Text = single1.Product_type;
lblcolor.Text = single1.Model_color;
ddlsize.SelectedValue = single1.Size;
var text2 =请求[ lblid ];
text2 =(Prd).ToString();
id.Text =(Prd).ToString();
pname.Text = single1.Product_Name;

解决方案

试试这个...

< br $>


 <   script     type   = < span class =code-keyword> text / javascript >  


document )。ready( function (){


' #btnGet')。点击( function (){
window .localStorage.setItem( CustName< /跨度>,

i am working with e-commerce website and i stuck to local storage part.
am using local storage to store product name and id,which is selected by client.
and the problem is my label defined are not storing product name and id as its of input type.
please help

What I have tried:

<h4>
                            <input name="lblpname" id="lblpname" type="text" /></h4>
                        <input name="lblid" id="lblid" type="text" /><%--<input name="lblid" id="lblid" type="text" />--%>
                     <%--   <h4>
                            <asp:Label ID="pname" name="lblid" runat="server"></h4>
                        <asp:Label ID="id" name="lblid" runat="server">--%>


and code is

int Prd = Convert.ToInt32(Session["Product_Id"]);
            var single1 = (from PD in drop.PRODUCT_DBM
                           join PS in drop.Prod_Size on PD.Product_Id equals PS.product_id
                           join SM in drop.Stock_Master on PD.Product_Id equals SM.Prod_Id
                           where PD.Product_Id == Prd 
                           select new { PS.Size, PD.Model_Name, PD.Model_color,SM.MRP, PD.Product_Detail, PD.Product_Name, PD.Product_type }).ToList().FirstOrDefault();
            var text1 = Request["lblpname"];
            text1 = single1.Product_Name;
            //pname.Text = Request.Form[hfName.UniqueID];
            lbldtl.Text = single1.Product_Detail;
            lblmodelname.Text = single1.Model_Name;
            lblprice.Text = single1.MRP.ToString();
            lbltype.Text = single1.Product_type;
            lblcolor.Text = single1.Model_color;
            ddlsize.SelectedValue = single1.Size;
            var text2 = Request["lblid"];
            text2 = (Prd).ToString();
            id.Text = (Prd).ToString();
            pname.Text = single1.Product_Name;

解决方案

Try this...


<script type="text/javascript">


(document).ready(function () {


('#btnGet').click(function () { window.localStorage.setItem("CustName",


这篇关于使用ASP.NET C#存储从本地存储中的数据库代码提交的标签值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆