ASP MVC 3 Telerikgrid 发送 Rowvesion(byte[]) 到控制器
我有一个 Telerik MVC 3 网格,其中包含复选框列。如果用户选择多个项目并单击按钮,我需要将 id 和 byte[] 时间戳(用于并发)发送到控制器。用户可以选择任意数量的项目,所以我不想将完整的行信息传递给控制器。此外,它是点击后的回发。有没有办法在单击按钮时将 ID 和时间戳列表一起发布到控制器。提前致谢。从我的应用程序查看网格列的代码
.Columns(columns =>
{
columns.LoadSettings(Model.GridColumnSettings);
columns.Template(
@<text>
<input name="SelectedRecords" type="checkbox" value="@(item.Id))" title="Select"
@if ((Model.SelectedRecords!= null) && (Model.SelectedRecords.Contains(item.Id)))
{
<text>checked="checked"</text>
}
/>
</text>
).Title("Select").Width(23).HtmlAttributes(new { style = "text-align:center" });
I have a telerik MVC 3 grid, that contains checkbox column. if the user select multiple items and clicks a button, i need to send the id and byte[] timestamp(for concurrency) to the controller. user can select any number of items, so i dont want to bring the full row information to the controller. Also, it's a postback on the click. Is there a way to post the list of Id and timestamp together to the controller on the button click. Thanks in advance. View code of the grid columns from my app
.Columns(columns =>
{
columns.LoadSettings(Model.GridColumnSettings);
columns.Template(
@<text>
<input name="SelectedRecords" type="checkbox" value="@(item.Id))" title="Select"
@if ((Model.SelectedRecords!= null) && (Model.SelectedRecords.Contains(item.Id)))
{
<text>checked="checked"</text>
}
/>
</text>
).Title("Select").Width(23).HtmlAttributes(new { style = "text-align:center" });
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这与数据绑定有关吗?我只是短暂地搞乱了 Telerik,但确实有一个网格正在运行。我使用 ajax 来调用我的控件,如下所示:
我怀疑您可以像在操作链接中一样将变量传递给控制器(尽管我还没有尝试过这个...)
Would this be with DataBinding? I only messed with Telerik briefly, but did have a grid running. I used ajax to call my control as such:
I'd suspect you could pass variables to the controller as you would in an action link (though I've not tried this...)
对此的简单答案是使用 Convert.FromBase64String 和 Convert.ToBase64String 来发送和接收 byte[]。我发现这个来自
http://junmeng.blogspot.com/2006/05/optimistic -concurrency-control-using.html
感谢您抽出时间艾迪
The simple answer for this is using Convert.FromBase64String and Convert.ToBase64String for sending and recieving byte[]. i found this from
http://junmeng.blogspot.com/2006/05/optimistic-concurrency-control-using.html
thanks for the your time Eddie