It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Board index Programming ASP & ASP.NET Forum

Applying conditions in aspx page

Applying conditions in aspx page

Postby fozia_izhar on Tue May 29, 2007 9:12 am

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>
&nbsp;&nbsp;<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>
&nbsp;

</div>
</form>
</body>
</html>



Pleeez tell me whats wrong with this code and how to correct it. :?:
Pleeez reply.
fozia_izhar
 
Posts: 0
Joined: Tue May 29, 2007 6:57 am
Location: India

Who is online

Users browsing this forum: No registered users and 2 guests