剃刀视图中的网格 [英] Web grid in razor view

查看:102
本文介绍了剃刀视图中的网格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用asp.net mvc4和razor。我基于productId = 2得到数据来自数据库。这是来自数据库的单行数据。我的问题是如何在网格中显示这一行数据。任何身体帮助我。

 {ProductId:2,ProductInfo:[{Key:Size,Value:small},{Key:color,Value 灰色},{ 关键: 性别, 值: 男},{ 关键: 价格, 值: $ 150.00},{ 关键: 应将描述 ,值:测试产品描述 -  DY},{密钥:评级,值:4},{密钥:评级,值:4} ],CategoryID:1,ManufaturerId:3,ItemNo:sku1212,ProductName:ECCO Womens Kawaii Sandals,DeletedInd:N,medImagePath1:/ Images / SmallnlargeImg /sandal1_medium1.png\",\"medImagePath2\":\"/Images/SmallnlargeImg/sandal1_medium2.png\",\"medImagePath3\":\"/Images/SmallnlargeImg/sandal1_medium3.png\",\"larImagePath1\":\"/Images/SmallnlargeImg/sandal1_large1.png larImagePath2: /图片/ SmallnlargeImg / sandal1_large2.png, larImagePath3: /图片/ SmallnlargeImg / sandal1_large3.png, smaImagePath1:/图片/ SmallnlargeIm g / sandal1_thumb1.png,smaImagePath2:/ Images / SmallnlargeImg / sandal1_thumb2.png,smaImagePath3:/ Images / SmallnlargeImg / sandal1_thumb3.png} 



我想在网格列下方显示



ProductId,CategoryID,ManufaturerId,ItemNo,ProductName,DeletedInd,LastRefreshedDate,CreatedDate,LastRefreshedUserId,CreatedUserId,EffectiveBeginDate,EndDate, UPCCode,StoreID,SKU,SKUFullName,[SupplierCode],[SupplierCodeFullName]

解决方案

150.00},{Key:Desciption,Value:测试产品描述 - DY},{Key:Rating,Value:4},{Key:Rating,Value:4}],CategoryID: 1,ManufaturerId:3,ItemNo:sku1212,ProductName:ECCO Womens Kawaii Sandals,DeletedInd:N,medImagePath1:/ Images / SmallnlargeImg / sandal1_medium1.png, medImagePath2: /图片/ SmallnlargeImg / sandal1_medium2.png, medImagePath3: /图片/ SmallnlargeImg / sandal1_medium3.png, larImagePath1: /图片/ SmallnlargeImg / sandal1_large1.png,larImagePath 2 :/图片/ SmallnlargeImg / sandal1_large2.png larImagePath3: /图片/ SmallnlargeImg / sandal1_large3.png, smaImagePath1: /图片/ SmallnlargeImg / sandal1_thumb1.png, smaImagePath2:/ Images / SmallnlargeImg / sandal1_thumb2.png,smaImagePath3:/ Images / SmallnlargeImg / sandal1_thumb3.png}



我想在网格列下面显示



ProductId,CategoryID,ManufaturerId,ItemNo,ProductName,DeletedInd,LastRefreshedDate,CreatedDate,LastRefreshedUserId,CreatedUserId,EffectiveBeginDate,EndDate,UPCCode,StoreID,SKU,SKUFullName,[SupplierCode],[ SupplierCodeFullName]


I am working on asp.net mvc4 and razor. i am getting hte below data from database based on the productId=2.this is the single row data from database.My question is how can i display this single row data in web grid.Any body help me.

{"ProductId":2,"ProductInfo":[{"Key":"Size","Value":"small"},{"Key":"color","Value":"Gray"},{"Key":"Gender","Value":"Male"},{"Key":"Price","Value":"$150.00"},{"Key":"Desciption","Value":"Test Product Description--DY"},{"Key":"Rating","Value":"4"},{"Key":"Rating","Value":"4"}],"CategoryID":1,"ManufaturerId":3,"ItemNo":"sku1212","ProductName":"ECCO Womens Kawaii Sandals","DeletedInd":"N","medImagePath1":"/Images/SmallnlargeImg/sandal1_medium1.png","medImagePath2":"/Images/SmallnlargeImg/sandal1_medium2.png","medImagePath3":"/Images/SmallnlargeImg/sandal1_medium3.png","larImagePath1":"/Images/SmallnlargeImg/sandal1_large1.png","larImagePath2":"/Images/SmallnlargeImg/sandal1_large2.png","larImagePath3":"/Images/SmallnlargeImg/sandal1_large3.png","smaImagePath1":"/Images/SmallnlargeImg/sandal1_thumb1.png","smaImagePath2":"/Images/SmallnlargeImg/sandal1_thumb2.png","smaImagePath3":"/Images/SmallnlargeImg/sandal1_thumb3.png"}


I want to display below columns for grid

ProductId,CategoryID,ManufaturerId ,ItemNo,ProductName,DeletedInd,LastRefreshedDate,CreatedDate,LastRefreshedUserId,CreatedUserId,EffectiveBeginDate,EndDate,UPCCode,StoreID,SKU,SKUFullName,[SupplierCode] ,[SupplierCodeFullName]

解决方案

150.00"},{"Key":"Desciption","Value":"Test Product Description--DY"},{"Key":"Rating","Value":"4"},{"Key":"Rating","Value":"4"}],"CategoryID":1,"ManufaturerId":3,"ItemNo":"sku1212","ProductName":"ECCO Womens Kawaii Sandals","DeletedInd":"N","medImagePath1":"/Images/SmallnlargeImg/sandal1_medium1.png","medImagePath2":"/Images/SmallnlargeImg/sandal1_medium2.png","medImagePath3":"/Images/SmallnlargeImg/sandal1_medium3.png","larImagePath1":"/Images/SmallnlargeImg/sandal1_large1.png","larImagePath2":"/Images/SmallnlargeImg/sandal1_large2.png","larImagePath3":"/Images/SmallnlargeImg/sandal1_large3.png","smaImagePath1":"/Images/SmallnlargeImg/sandal1_thumb1.png","smaImagePath2":"/Images/SmallnlargeImg/sandal1_thumb2.png","smaImagePath3":"/Images/SmallnlargeImg/sandal1_thumb3.png"}


I want to display below columns for grid

ProductId,CategoryID,ManufaturerId ,ItemNo,ProductName,DeletedInd,LastRefreshedDate,CreatedDate,LastRefreshedUserId,CreatedUserId,EffectiveBeginDate,EndDate,UPCCode,StoreID,SKU,SKUFullName,[SupplierCode] ,[SupplierCodeFullName]


这篇关于剃刀视图中的网格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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