fozia_izhar
Joined: 29 May 2007 Posts: 1 Location: India
|
Posted: Tue May 29, 2007 10:12 am Post subject: Applying conditions in aspx page |
|
|
Hi freinds,
I want to execute code of my aspx page on the basis of "if and else condition".But now it is firing both if and else code, means it is not considering any conditional looping.Below is the code of my aspx page, please check where i m wrong.
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="test.aspx.vb" Inherits="test" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataSourceID="SqlDataSource1">
<Columns>
<asp:HyperLinkField DataTextField ="heading_t" dataNavigateUrlFields ="navlinks_t" /></Columns>
</asp:GridView>
<br />
<asp:Repeater ID="rept" runat="server" DataSourceID="SqlDataSource1">
<ItemTemplate>
<set-var lft="<%# eval("disptype") %>">
<if> <get-var lft="left"><then>
<table><tr><td>
<item id="<%# eval("links_t") %>">
<div class="news">
<b><span style="text-align:center; background-color:Lime; font-size:medium " ><%#Eval("heading_t")%></span></b>
</td></tr>
<tr><td>
<asp:Image ID="Image1" Height="60" Width="60" runat="server" />
</td>
<td><span style="background-color:Yellow; font-size:small; " ><%#Eval("comment_t")%></span>
</div></item>
</td></tr>
</table>
</then>
<else>
<table><tr><td>
<item id="<%# Eval("links_t") %>">
<div class="news">
<b><span style="text-align:center; background-color:Lime; font-size:medium " ><%#Eval("heading_t")%></span></b>
<br />
</td></tr>
<tr><td>
<span style="background-color:Yellow; font-size:small; " ><%#Eval("comment_t")%></span>
</td>
<td>
<asp:Image ID="imag1" Height="60" Width="60" runat="server" />
</div></item>
</td></tr>
</table>
</else>
</if>
</ItemTemplate>
</asp:Repeater>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString1 %>"
ProviderName="<%$ ConnectionStrings:ConnectionString1.ProviderName %>" SelectCommand="SELECT heading_t, comment_t, navlinks_t, links_t, imgurl, disptype, priority FROM user_news_t">
</asp:SqlDataSource>
</div>
</form>
</body>
</html>
Pleeez tell me whats wrong with this code and how to correct it.
Pleeez reply. |
|