Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Register Tags Active Topics RSS Search Mark Forums Read SiteMap

Tags: , , , , , , ,

Sponsored Links



How to show message on my webpage in the ASP.NET

Software Development


Reply
 
Thread Tools Search this Thread
  #1  
Old 23-12-2009
Member
 
Join Date: Dec 2009
Posts: 30
How to show message on my webpage in the ASP.NET

Hi everybody,

I am a IT student and developing a project in ASP.NET. In my project i want to show a message without using gridview. I am using hyperlink button for that but it have using gridview and data is shown there. When i execute my program, the record is not matching the the gridview. Can anybody help for this , i am in so hurry as i want to finish my project in one week. Other suggestion is also welcome.
Reply With Quote
  #2  
Old 23-12-2009
Modifier's Avatar
Member
 
Join Date: Jan 2008
Posts: 1,502
Show message on my webpage in the ASP.NET 2003

Can you tell me what version you have used in ASP.NET, So i will try on own myself.Also i will check thsi code on ASP.NET 2003 version and found not any error on my home page.

if(GridView1.Rows.Count==0)
{
//display your message here
Hello world
}
Reply With Quote
  #3  
Old 23-12-2009
Member
 
Join Date: Dec 2009
Posts: 30
Re: Using ASP.NET 2005 version as frontend

Actually i am using ASP.NET 2005 as front end and SQL server 2005 as back end. I will run the page through IIS 6.0 version. Thanks for reply.
Reply With Quote
  #4  
Old 23-12-2009
MindSpace's Avatar
Member
 
Join Date: Feb 2008
Posts: 1,832
Code for show message on webpage in the ASP.NET

I will try on ASP.NET 2005 and i will succeed. Please try this code and reply if found any error.

<table style="width: 60%; height:50%" border="0">
<tr style="width: 60%; height:200px" valign="top">
<td>
<asp:GridView ID="gvApplicants" runat="server" AutoGenerateColumns="False"
CellPadding="1" ForeColor="#653333"
GridLines="None" Width="80%" FooterStyle-HorizontalAlign="Left"
PagerStyle-HorizontalAlign="Left" PageSize="10" AllowPaging="True" OnRowDataBound="gvApplicants_RowDataBound" OnDataBound="gvApplicants_DataBound" OnRowEditing="gvApplicants_RowEditing" OnRowCancelingEdit="gvApplicants_RowCancelingEdit" >

<FooterStyle BackColor="#509CD7" Font-Bold="True" ForeColor="yellow" HorizontalAlign="Left" CssClass="GridView" />
<RowStyle BackColor="#EFS3FB" CssClass="GridView" />
<SelectedRowStyle Font-Bold="True" ForeColor="#335633" Font-Size="Small" BackColor="#8080FF" BorderColor="#8070FF" />
<PagerStyle BackColor="#2469BF" ForeColor="White" HorizontalAlign="Center" Font-Size="Small" />
<HeaderStyle BackColor="#507CD7" Font-Bold="True" ForeColor="Blue" CssClass="GridView" />
<AlternatingRowStyle BackColor="Pink" />
<EmptyDataTemplate>
No records found in your database
</EmptyDataTemplate>
<PagerTemplate>
</PagerTemplate>
<Columns>
<asp:BoundField Visible="false" DataField="pers_no" />
<asp:TemplateField HeaderText="Applicant Number" HeaderStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:Label ID="lblAppNo" runat="server" Width="36%" CssClass="Label" Text='<%#Eval("empno")%>'></asp:Label>
</ItemTemplate>
<ItemStyle HorizontalAlign="Right" />
<ItemStyle width= "7%" />
</asp:TemplateField>
<asp:BoundField>
<ItemStyle Width="4%" />
<HeaderStyle Width="4%" />
</asp:BoundField>
<asp:TemplateField HeaderText="Name" HeaderStyle-VerticalAlign="top">
<ItemTemplate>
<asp:Label ID="lblName" runat="server" Width="100%" CssClass="Label" Text='<%#Server.HtmlEncode((string)Eval("name"))%>'></asp:Label>
</ItemTemplate>
<ItemStyle />
</asp:TemplateField>
</Columns>
</asp:GridView>
</td>
</tr>
<tr style="border:2px">
</tr>
</table>
Reply With Quote
  #5  
Old 23-12-2009
opaper's Avatar
Member
 
Join Date: May 2008
Posts: 2,362
Use EmptyDataTemplate to show message on webpage

In your case, You should right click on grid then go to Edit Template and click on EmptyDataTemplate. Type your message as you want to display on tour website within area provided and check that. I will also try in my project and show my message on my web page.
__________________
The FIFA Manager 2009 PC Game
Reply With Quote
  #6  
Old 23-12-2009
Reegan's Avatar
Member
 
Join Date: Oct 2005
Posts: 2,299
SQL server check show message on webpage in the ASP.NET

I think you should check with SQL server 2005. As the below code, It will show message.

Dim con as new sqlconnection(str)
dim sql as string
dim count as integer
con.open()
sql ="select id,name,phoneno from shop"
dim da as new sqldataadapter(sql ,con)
dim ds as new dataset
da.fill(ds,"emp")
gridview1.datasource=ds.tables(0)

if ds.tables(0).rows.count<1 then
lable1.text="No Records found"
else
lable1.visible=false
end if
gridview1.databind()
con.close()
Reply With Quote
Reply

  TechArena Community > Software > Software Development


Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "How to show message on my webpage in the ASP.NET"
Thread Thread Starter Forum Replies Last Post
ASUS P7H55-M PRO does not show POST message Federline Motherboard Processor & RAM 4 08-04-2011 11:15 AM
Worms Armageddon show “ERRORLOG.TXT” message in windows 7 Tobile Video Games 4 30-03-2011 12:38 AM
Internet Explorer cannot display the webpage (error message) Suren Windows Security 7 05-01-2010 01:24 AM
Iphone Show no sim card message Reuben Portable Devices 3 13-07-2009 01:54 PM
IE7 error message: Navigation to the webpage was canceled John Halsey Flannery Vista Help 2 19-03-2009 01:13 PM


All times are GMT +5.5. The time now is 04:04 AM.