Click here to Skip to main content
15,894,362 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I am uday satardekar

I have one asp.net application.

I have write database code on page load in search.aspx.cs file and retriveing some result.


Now i have to bind/show that result in search.aspx source which contain all html view


Like

C#
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="searchexporters.aspx.cs" Inherits="searchexporters" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
<html>
<head>
</head>
 
<body>
<img src="images/viewdetails.jpg" width="98" height="20" border="0">
 
</body>


Here i want

C#
ds[1].tables["count"].tostring();
this value from .aspx.cs file

How I can achieve this?

Thanks in advance.
Posted
Updated 13-Sep-11 23:18pm
v2
Comments
imaa2amha 14-Sep-11 5:18am    
if i understand wut ur saying you can use ListView control to show your data

in design define a label lblcount
in code behind after retrieving data write
lblcount.text=ds.tables["count"].rows[0]["Count"].toString()


if you need to bid more than one row then take a gridview control in aspx page
 
Share this answer
 
Comments
udusat13 14-Sep-11 5:26am    
Thanks........
But sir i am not using .net control.I have to show result in table control.because my results are dynamic.
There are many ways to do this.. one way is to use XML HTTP Ajax concept.

Below link would be useful for you.

http://www.dotnettwitter.com/2011/05/how-to-implement-xml-http-ajax-in.html[^]
 
Share this answer
 
in your .cs file write that
C#
 public String returnData(){
   return ds[1].tables["count"].tostring();
}


Then in your .aspx file you can call this function by,You can put this where do you want to show this data

HTML
<%=returnData()%>
 
Share this answer
 
v2
Comments
udusat13 14-Sep-11 5:35am    
Thanks..............

Its working...
hilmisu 14-Sep-11 6:11am    
no problem =)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900