简体   繁体   English

使用 jquery 和 vb.net

[英]using jquery with vb.net

is some one try to use jquery with vb.net, like有人尝试将 jquery 与 vb.net 一起使用,例如

if InvalidUser() then show ModalDialog 
or if CreateNewUserForm.Confirm()=true then do some thing...

Thanx谢谢

My guess is that you want to execute a javascript function.我的猜测是你想执行 javascript function。 If so use ScriptManager.RegisterStartupScript如果是这样,请使用ScriptManager.RegisterStartupScript

public static void RegisterStartupScript(
    Control control,
    Type type,
    string key,
    string script,
    bool addScriptTags
)

I don't think you truly understand what it is you're asking.我不认为你真的明白你在问什么。 jQuery (or Javascript) is a client-side technology that executes in the browser . jQuery(或 Javascript)是一种在浏览器中执行的客户端技术。 ASP.NET (using VB.NET or C#) is a server-side language that executes on the server . ASP.NET(使用 VB.NET 或 C#)是在服务器上执行的服务器语言。

You cannot combine the two as in your example given that they execute on physically different machines.鉴于它们在物理上不同的机器上执行,您不能像您的示例中那样将两者结合起来。

Now, there are numerous ways to handle communication between the two components of your application, such as the example given by BrunoLM , but you'd have to be more specific to get a concrete answer.现在,有很多方法可以处理应用程序的两个组件之间的通信,例如BrunoLM给出的示例,但您必须更具体才能获得具体答案。

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

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