开发者

Alternate option for RegisterClientScriptBlock, Is going for 100% javascript good option?

i have following situation

try
{
    // do something
}
catch(Exception e)
{
    RegisterClientScriptBlock();
    // **can i do this using Jquery replacing RegisterClientScriptBlock**
}

i have aspx pages which are heavily using RegisterClientScriptBlock for emitting javascript code is it a better way to write a javascript library and put directly into the page in place of RegisterClientScriptBlock

My current application calls the business logic and decides which javascript to call by using RegisterClientScriptBlock

example

c# code

RegisterStartupScript("", "<script&开发者_如何学编程gt;ShowConvertedAlertMessage('Docs:" &   Docs.Home.GetAlertMessage("OB19") & "');</script>")

Docs is the object which i am getting from the DLL

is there anyother way i can do this using jQuery


You can inject Jquery code the same way, in place of plain Javascript. Jquery at the end is Javascript code. If you are executing RegisterStartupScript when some condition is met or when an event fires in server side. I think ResigterStartUpScript is fine.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜