繁体   English   中英

如何从 aspx 页面运行 javascript function?

[英]How to run javascript function from aspx page?

我写了一些代码,有 27 个不同的函数像这样执行..

    ElseIf websiteID = 15 Then
                    parserTravelPost(hotelURL, hotelID, websiteID)
                    nextPageLink = ""
                ElseIf websiteID = 16 Then
                    parserTripAdviosr(hotelURL, hotelID, websiteID)
                    nextPageLink = ""
                ElseIf websiteID = 17 Then
                    parserTripTake(hotelURL, hotelID, websiteID)
                    nextPageLink = ""
                ElseIf websiteID = 18 Then ........

After every function i want a literal or any other way to tell the function is finished... example after the first function finish, the literal should shows example finished now starting function 2...

任何帮助/提示/代码?

谢谢

您可以模拟响应。编写 javascript 代码,或者您可以在 asp.net 中使用 registerclicentscriptBlock

//vb版本

Dim scriptText As String
    scriptText = "return confirm('Do you want to submit the page?')"
    ClientScript.RegisterOnSubmitStatement(Me.GetType(), _
        "ConfirmSubmit", scriptText)

希望能帮助到你。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM