Simple ASP.Net MessageBox?

前端 未结 3 1511
独厮守ぢ
独厮守ぢ 2021-01-16 11:42

I want a simple MessageBox for ASP.Net, but everything I tried didn\'t work and I don\'t know why. The last thing I tried was this but it didn\'t work either.

Any id

3条回答
  •  迷失自我
    2021-01-16 12:38

    Is this using ajax? Is this attached to a server side event that's called when the user clicks a button?

    If so, ajax only sends data that's associated with the updatepanel in question. If so, try this ScriptManager.RegisterStartupScript((Control)ctlControl, ctlControl.GetType(), "ClientScript", "alert('foo')", true); It is important that the ctlControl is inside the updatepanel being updated.

    If you are not using ajax, is ClientScript registered elsewhere with RegisterClientScriptBlock? The client name has to be unique for every registry or it will think you are calling the same code twice.

提交回复
热议问题