Hi vrindavani,
Check below sample. You need to change the where condition. Remove the Image null check condition.
In html page set the runat="server" property to img tag and set visible property by checking with not String.IsNullOrEmpty of Image column.
As in the screenshot you can see in Page1 Image is visible for 1st record which is empty but in Page2 Image is not displaying as the condition is checked in Page2.
So where you what to hide apply the logic.
HTML
CS
Page1
<asp:Repeater runat="server" ID="Rp_Study">
<ItemTemplate>
<div class="sports-news mb20 well4">
<div class="row">
<div class="col-sm-3" style="margin-top: 20px;">
<a href="Study.aspx?id=<%#Eval("ID") %>">
<img src='<%#string.Concat("StkMktImg/",Eval("Image")) %>' style="border: thin solid #C0C0C0; height: 150px; width: 250px;" /></a>
</div>
<div class="col-sm-6" style="margin-top: 20px;">
<div class="sports-title mb20" style="padding-left: 30px;">
<a href="Study.aspx?id=<%#Eval("ID") %>">
<h3 style="color: red"><%#Eval("Title") %> </h3>
</a>
</div>
<div class="sports-title mb10" style="padding-left: 30px;">
<a href="Study.aspx?id=<%#Eval("ID") %>" class="btn btn-primary1">Read More
</a>
</div>
</div>
</div>
</div>
</ItemTemplate>
</asp:Repeater>
<asp:Button Text="Display" runat="server" OnClick="OnRedirect" />
Page2
<asp:Repeater ID="Rp_stud" runat="server">
<ItemTemplate>
<div class="col-sm-12 well4">
<div class="col-sm-12">
<asp:Label ID="lbl_id" Visible="false" runat="server" Text='<%#Eval("ID") %>'></asp:Label>
<h3 class="preventcopy" style="font-weight: bold; font-size: large; margin-top: 3%;"><%#Eval("Title") %> | <%=DateTime.Now.ToShortDateString() %></h3>
<img class="fancybox" runat="server" visible='<%#!string.IsNullOrEmpty(Eval("Image").ToString()) %>' src='<%#string.Concat("StkMktImg/",Eval("Image")) %>' style="height: 325px; width: 100%; object-fit: cover;" />
<div class="sports-title mb10">
<p class="preventcopy" style="text-align: justify; font-size: large; font-weight: normal;"><%#Eval("Paragraph") %></p>
</div>
</div>
<a href="Study.aspx?id=<%#Eval("ID") %>"></a>
</div>
</ItemTemplate>
</asp:Repeater>
VB.Net
Page1
<asp:Repeater runat="server" ID="Rp_Study">
<ItemTemplate>
<div class="sports-news mb20 well4">
<div class="row">
<div class="col-sm-3" style="margin-top: 20px;">
<a href="Study.aspx?id=<%#Eval("ID") %>">
<img src='<%#String.Concat("StkMktImg/", Eval("Image")) %>' style="border: thin solid #C0C0C0; height: 150px; width: 250px;" /></a>
</div>
<div class="col-sm-6" style="margin-top: 20px;">
<div class="sports-title mb20" style="padding-left: 30px;">
<a href="Study.aspx?id=<%#Eval("ID") %>">
<h3 style="color: red"><%#Eval("Title") %> </h3>
</a>
</div>
<div class="sports-title mb10" style="padding-left: 30px;">
<a href="Study.aspx?id=<%#Eval("ID") %>" class="btn btn-primary1">Read More
</a>
</div>
</div>
</div>
</div>
</ItemTemplate>
</asp:Repeater>
<asp:Button Text="Display" runat="server" OnClick="OnRedirect" />
Page2
<asp:Repeater ID="Rp_stud" runat="server">
<ItemTemplate>
<div class="col-sm-12 well4">
<div class="col-sm-12">
<asp:Label ID="lbl_id" Visible="false" runat="server" Text='<%#Eval("ID") %>'></asp:Label>
<h3 class="preventcopy" style="font-weight: bold; font-size: large; margin-top: 3%;"><%#Eval("Title") %> | <%=DateTime.Now.ToShortDateString() %></h3>
<img class="fancybox" runat="server" visible='<%# Not String.IsNullOrEmpty(Eval("Image").ToString) %>' src='<%#String.Concat("StkMktImg/", Eval("Image")) %>' style="height: 325px; width: 100%; object-fit: cover;" />
<div class="sports-title mb10">
<p class="preventcopy" style="text-align: justify; font-size: large; font-weight: normal;"><%#Eval("Paragraph") %></p>
</div>
</div>
<a href="Study.aspx?id=<%#Eval("ID") %>"></a>
</div>
</ItemTemplate>
</asp:Repeater>
Namespaces
C#
using System.Configuration;
using System.Data;
using System.Data.SqlClient;
VB.Net
Imports System.Configuration
Imports System.Data
Imports System.Data.SqlClient
Code
C#
Page1
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
BindDetails();
}
}
private void BindDetails()
{
string constr = ConfigurationManager.ConnectionStrings["conString"].ConnectionString;
using (SqlConnection con = new SqlConnection(constr))
{
string query = "select top 10 st.[ID] ,sm.[Title],st.[Image] from Child st , Parent sm where sm.St_ID = st.ID order by st.id asc";
using (SqlCommand cmd = new SqlCommand(query))
{
cmd.Connection = con;
using (SqlDataAdapter sda = new SqlDataAdapter(cmd))
{
DataTable dt = new DataTable();
sda.Fill(dt);
Rp_Study.DataSource = dt;
Rp_Study.DataBind();
}
}
}
}
protected void OnRedirect(object sender, EventArgs e)
{
Response.Redirect("Page2.aspx");
}
Page2
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
loadRecord();
}
}
private void loadRecord()
{
string constr = ConfigurationManager.ConnectionStrings["conString"].ConnectionString;
using (SqlConnection con = new SqlConnection(constr))
{
string query = "select top 10 st.[ID] ,sm.[Title],st.[Image],st.[paragraph] from Child st , Parent sm where sm.St_ID = st.ID order by st.id asc";
using (SqlCommand cmd = new SqlCommand(query))
{
cmd.Connection = con;
using (SqlDataAdapter sda = new SqlDataAdapter(cmd))
{
DataTable dt = new DataTable();
sda.Fill(dt);
Rp_stud.DataSource = dt;
Rp_stud.DataBind();
}
}
}
}
VB.Net
Page1
Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
If Not IsPostBack Then
BindDetails()
End If
End Sub
Private Sub BindDetails()
Dim constr As String = ConfigurationManager.ConnectionStrings("conString").ConnectionString
Using con As SqlConnection = New SqlConnection(constr)
Dim query As String = "select top 10 st.[ID] ,sm.[Title],st.[Image] from Child st , Parent sm where sm.St_ID = st.ID order by st.id asc"
Using cmd As SqlCommand = New SqlCommand(query)
cmd.Connection = con
Using sda As SqlDataAdapter = New SqlDataAdapter(cmd)
Dim dt As DataTable = New DataTable()
sda.Fill(dt)
Rp_Study.DataSource = dt
Rp_Study.DataBind()
End Using
End Using
End Using
End Sub
Protected Sub OnRedirect(ByVal sender As Object, ByVal e As EventArgs)
Response.Redirect("Page2.aspx")
End Sub
Page2
Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
If Not IsPostBack Then
loadRecord()
End If
End Sub
Private Sub loadRecord()
Dim constr As String = ConfigurationManager.ConnectionStrings("conString").ConnectionString
Using con As SqlConnection = New SqlConnection(constr)
Dim query As String = "select top 10 st.[ID] ,sm.[Title],st.[Image],st.[paragraph] from Child st , Parent sm where sm.St_ID = st.ID order by st.id asc"
Using cmd As SqlCommand = New SqlCommand(query)
cmd.Connection = con
Using sda As SqlDataAdapter = New SqlDataAdapter(cmd)
Dim dt As DataTable = New DataTable()
sda.Fill(dt)
Rp_stud.DataSource = dt
Rp_stud.DataBind()
End Using
End Using
End Using
End Sub
Screenshot