MVC:在razor的代码块中传递jquery var [英] MVC: pass jquery var in Code block of razor
本文介绍了MVC:在razor的代码块中传递jquery var的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
嗨!
我正在努力将一个jquery var传递给Razor中的一个Code块:
Hi!
I am struggling with passing a jquery var into a Code block in Razor :
if ($(window).scrollTop() + $(window).height() > $(document).height() - 200) {
var CurrentSeqDB = 1;
@Code
Dim UserSession As String = Session("UserSessionID")
Dim EntryID As Integer = 0
Dim context As TripRebel.LocalEntities = New TripRebel.LocalEntities()
Dim testRtsrf As Integer = Request.Params(@:CurrentSeqDB)
Dim getHotelsFromDB = (From gh In context.temp_hotels Where gh.Session = UserSession And gh.sequence = Request[""] And gh.shown = "false" Select gh).SingleOrDefault
End Code
}
任何人都可以帮我吗?
提前感谢!!
干杯
Can anyone help me with that?
thanks in advance!!
Cheers
推荐答案
(窗口).scrollTop()+
(window).scrollTop() +
(window).height()>
(window).height() >
(document).height() - 200 ){
var CurrentSeqDB = 1;
@Code
Dim UserSession As 字符串 =会话( UserSessionID)
Dim EntryID 作为 整数 = 0
Dim context As TripRebel.LocalEntities = 新 TripRebel.LocalEntities()
Dim testRtsrf As 整数 = Request.Params(@:CurrentSeqDB)
Dim getHotelsFromDB =(from gh < span class =code-keyword>在 context.temp_hotels其中gh.Se ssion = UserSession 和 gh.sequence =请求[ ] 和 gh.shown = false 选择 gh).SingleOrDefault
结束代码
}
(document).height() - 200) { var CurrentSeqDB = 1; @Code Dim UserSession As String = Session("UserSessionID") Dim EntryID As Integer = 0 Dim context As TripRebel.LocalEntities = New TripRebel.LocalEntities() Dim testRtsrf As Integer = Request.Params(@:CurrentSeqDB) Dim getHotelsFromDB = (From gh In context.temp_hotels Where gh.Session = UserSession And gh.sequence = Request[""] And gh.shown = "false" Select gh).SingleOrDefault End Code }
任何人都可以帮我吗?
提前感谢!!
干杯
Can anyone help me with that?
thanks in advance!!
Cheers
这篇关于MVC:在razor的代码块中传递jquery var的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文