English 中文(简体)
作为回应, 写入一些 javascript 代码。 当 SqlData 来源1_ 删除时 write
原标题:write some javascript code in response.write when SqlDataSource1_Deleted

i 有一个通知 j-query 插件 。 i 在我的页面上( 工作100% ) 。 i text it in a event SqlData sourp1_ Deleted with the response. write 方法不起作用 protected Sub SqlData source1_Deleted( ByVal 发送者为对象, by Val e system.web.UI.Web.

最佳回答

如果您在页面中使用 Response. write , 您将会将代码置于 HTML 文档本身之前。 这意味着它将在 jQuery 或任何插件被装入之前运行 。 (此外, 它还可能导致该页面以 quirks 模式生成, 这可能会破坏整个布局 。 )

使用"http://msdn.microsoft.com/en-us/library/system.web.ui.clientscriptmanager.registerstartstartproduction.aspx" rel=“nofollow”_code>RegisterStartupScript 方法在页面中添加脚本:

Protected Sub SqlDataSource1_Deleted(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.SqlDataSourceStatusEventArgs) Handles SqlDataSource1.Deleted
  Page.ClientScript.RegisterStartupScript(Page.GetType(), "notification", "showNotification({message:  This is a sample Success notification , type:  success  });", true)
End Sub
问题回答

暂无回答




相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Transaction handling with TransactionScope

I am implementing Transaction using TransactionScope with the help this MSDN article http://msdn.microsoft.com/en-us/library/system.transactions.transactionscope.aspx I just want to confirm that is ...

System.Web.Mvc.Controller Initialize

i have the following base controller... public class BaseController : Controller { protected override void Initialize(System.Web.Routing.RequestContext requestContext) { if (...

Microsoft.Contracts namespace

For what it is necessary Microsoft.Contracts namespace in asp.net? I mean, in what cases I could write using Microsoft.Contracts;?

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签