如何从字符串生成器调用asp按钮事件 [英] How to call a asp button event from a string builder

查看:69
本文介绍了如何从字符串生成器调用asp按钮事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

sb.Append("<div class='btn-box'><asp:Button Text='AddtoCart' runat='server' id='btnAddtoCard" + CategoriList[i].ProductId + "' class='btn btn-success' OnClick='AddPlanToCart_Click' /></div>");
sb.Append("<div class='product-info'>");

推荐答案

字符串Buider.append只会扩展你的字符串,它不会显示你必须创建按钮对象的按钮< br $>


System.Web.Ui命名空间的按钮类你可以使用它



按钮b1 =新按钮( );

b1.text =按钮标签;

b1.Id =ButtonId;



,从这个按钮你可以发送请求,你可以给你相应的回复



我希望这会有帮助
String Buider.append will just extend your string it will not display your button for that you have to create button object

System.Web.Ui namespace's Button Class u Can Use for that

Button b1=new Button();
b1.text="button Label";
b1.Id="ButtonId";

and from this button you can send request on that you can give your appropriate response

I hope that will Help


这篇关于如何从字符串生成器调用asp按钮事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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