从动态添加的图像按钮中删除提交查询



我正在研究 C#website.in 这个页面之一我需要通过代码端图像按钮动态添加手段,但它显示了提交查询。所以,现在我的问题是如何从动态添加的图像按钮中删除此提交查询

我假设您正在做这样的事情来添加图像按钮:

ImageButton imageButton = new ImageButton();
FileInfo fileInfo = new FileInfo(strFileName);
imageButton.ImageUrl = "~/img/abc.png";
imageButton.Width = Unit.Pixel(100);
imageButton.Height = Unit.Pixel(100);

我建议您value属性设置为空字符串""如下所示:

imageButton.Attributes["value"]="";

imageButton.Attributes.Add("value", "");

另请参阅此堆栈溢出帖子

希望这有帮助!

最新更新