在cs文件中使用标签 [英] use label in cs file

查看:104
本文介绍了在cs文件中使用标签的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在cs部分中使用label,我想将此标签与表绑定。我使用linq绑定此标签。我的代码如下:



I want to use label for in cs part an i want to bind this label with table. i am using linq for bind this label.My code like this:

var id = (from a in linq_obj.videourl_msts
                 where a.video_status == "Active"
                 select new
                 {
                     code=a.intglcode,
                     srccode = a.video_url,
                     videoname = a.video_name
                 }).ToList();




strImage.Append(" <asp:Label ID=''lbl_video'' runat=''server'' Text='''' />");



如何在标签中获取视频名称。

我在.cs文件中执行此操作。


how i get videoname in label.
I do this all in .cs file.

推荐答案



试试这个

Hi ,
try this
foreach (var item in id)
   {
       lbl_video.Text = item.video_name;
   }



最好的问候

M.Mitwalli


Best Regards
M.Mitwalli


这篇关于在cs文件中使用标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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