V
vincenthkh
I am new in ASP.net programming (but have ASP skill) and have some
problems.
I have a ASPX page. First I declare the variable, then I want to
include the different values to the variable based on some conditions
of temp1 session. Then display the value on the label. Code like this:
<script language="vb" runat=server>
Dim var1 as string = "aaa"
.........
</script>
<% if session("temp1")="1" then %>
<!--#include file="Value1.aspx"-->
<% else %>
<!--#include file="Value2.aspx"-->
<% end %>
<script language="vb" runat="server">
Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs)
lblMsg.Text = "var1: " & var1
End Sub
</script>
...............
In Value1.aspx, I assign var1 as "bbb"
<% var1 = "bbb" %>
And in Value2.aspx, I assign var1 as "ccc"
<% var1 = "ccc" %>
However, the code between <%... %> seems not assigned the value. And
always display "aaa".
Do anyone can tell me what is the problem and how I can change? Thanks.
problems.
I have a ASPX page. First I declare the variable, then I want to
include the different values to the variable based on some conditions
of temp1 session. Then display the value on the label. Code like this:
<script language="vb" runat=server>
Dim var1 as string = "aaa"
.........
</script>
<% if session("temp1")="1" then %>
<!--#include file="Value1.aspx"-->
<% else %>
<!--#include file="Value2.aspx"-->
<% end %>
<script language="vb" runat="server">
Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs)
lblMsg.Text = "var1: " & var1
End Sub
</script>
...............
In Value1.aspx, I assign var1 as "bbb"
<% var1 = "bbb" %>
And in Value2.aspx, I assign var1 as "ccc"
<% var1 = "ccc" %>
However, the code between <%... %> seems not assigned the value. And
always display "aaa".
Do anyone can tell me what is the problem and how I can change? Thanks.