asp转为asp.Net [英] asp to asp.Net

查看:75
本文介绍了asp转为asp.Net的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这里正在将asp文件转换为asp.net(C#),因为其中一部分我需要转换以下语法,

<%If CInt(Session( "InsProduct"))= 2并且Cstr(Session("StateID")))="FL".然后,%>
在此状态下不必强制覆盖身体伤害. < br>
<其他%>
在此状态下,必须承担身体伤害的责任. < br>
<%结束,如果%>

能否请您提供此会话的解决方案,

谢谢!!
Ragavendra

Here am doing the conversion of asp file to asp.net(C#) for that in one part i need to convert the following syntax,

<% If CInt(Session("lInsProduct")) = 2 And Cstr(Session("StateID")) = "FL" Then %>
Bodily injury coverage is not mandatory in this state. <br>
<% Else %>
Bodily injury coverage is mandatory in this state. <br>
<% End If %>

Can you please provide the solution for this converstion,

Thanks in advance!!
Ragavendra

推荐答案

可以通过多种方法来实现.我的建议是将其放入文件后面的代码中,并在页面加载时执行
,我还建议在页面上添加标签.如果您添加了带有id ="labMessage"的标签,那么代码将如下所示:
There are multiple ways to accomplish this.  My suggestion would be to put this into the code behind file and execute it on page load
I would also suggest adding a label to your page.  If you added a label with the id="labMessage" then the code would look like this:
if ((int)Session["lInsProduct"] == 2 & (string)Session["StateID"] == "FL") 
{
       labMessage.Text = "Bodily injury coverage is not mandatory in this state. <br>";
}
else
{
       labMessage.Text = "Bodily injury coverage is mandatory in this state. <br>";
}






这篇关于asp转为asp.Net的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆