In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article will explain in detail what to do about the pop-up message prompt that CustomButtonCallback does not support in aspxgridview. The editor thinks it is very practical, so I share it with you as a reference. I hope you can get something after reading this article.
Aspxgridveiw is a grid control of devexpress, and it works well. However, a problem encountered today is that you can no longer use response.write in the CustomButtonCallback event, because the CustomButtonCallback event is not refreshed, so it is not supported, but even if you use ScriptManager.RegisterClientScriptBlock (page, page.GetType (), "MyScript", myScript, true), it will not help. After searching the Internet for a long time, there is an official solution. The original text is as follows:
Hi Troy
To provide this functionality you should throw an exception in the CustomButtonCallback event handler and process this exception in the CallbackError event handler. Here is the simple sample:
The code is as follows:
Protected void ASPxGridView1_CustomButtonCallback (object sender, DevExpress.Web.ASPxGridView.ASPxGridViewCustomButtonCallbackEventArgs e)
{
Throw new Exception ("Here I am!")
}
The code is as follows:
If (e.message = = 'Here I amalgamated')
{
ClientErrorImage.SetVisible (true)
}
If this answer is incomplete or I misunderstood your requirements, please let me know.
Thanks
Kate.
But the actual test found a problem, throw when the background directly threw an error, this method does not work, find again.
Finally, I found the solution on the official website, the original address, my code is as follows:
The code is as follows:
Protected void ASPxGridView1_CustomButtonCallback (object sender, ASPxGridViewCustomButtonCallbackEventArgs e)
{
ASPxGridView view = sender as ASPxGridView
If (e.ButtonID = = "btnAudit")
{
Int id = 0
Int.TryParse (view.GetRowValues (e.VisibleIndex, "id") .ToString (), out id)
If (true)
{
View.JSProperties ["cpErrorMsg"] = "Audit succeeded!"
View.DataBind ()
}
Else
{
View.JSProperties ["cpErrorMsg"] = "this document has been audited!"
}
}
}
The code is as follows:
Function EndCallBack (s, e) {
If (s.cpErrorMsgears = "") {
Alert (s.cpErrorMsg)
}
}
Note here that the argument to JSProperties must start with a lowercase "cp".
This is the end of the article on "what to do if CustomButtonCallback does not support pop-up messages in aspxgridview". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it out for more people to see.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.