本文介绍了中继器控制数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨!


我有一个中继器控件在第一列中显示ProductCode,在第1行中显示ProductDescription,在第3行中显示ProductRRP.

我需要遍历此转发器并将条目保存到sql.

如何遍历此转发器并获取值,以便可以将其分配给存储过程参数以进行插入?

谢谢!!

附注-我尝试粘贴一些代码,但代码块"无效.

Hi!


I have a repeater control displays the ProductCode in line1, ProductDescription in Line2 and ProductRRP in Line3 all in one column.

I need to loop through this repeater and save the entries to sql.

How can I loop through this repeater and get the values so that I can assign them to the stored procedure params in order to insert?

Thank you!!

P.S - I tried pasting some code but the "code block" does not work. It removes more than half on the code.

推荐答案


foreach (RepeaterItem item in Repeater1.Items)
{
  // find controls in Repeater and assign values to parameters like

  Label label1 = (Label) item.FindControl("controlname");

  // call the insert function inside the loop.
}


这篇关于中继器控制数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-20 21:14