|
| |||||||||
| Tags: aspnet, data, emptydatatemplate, message, my webpage, recordset, show message, sql server 2005 |
![]() |
| | Thread Tools | Search this Thread |
|
#1
| |||
| |||
| 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. |
|
#2
| ||||
| ||||
| 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 } |
|
#3
| |||
| |||
| 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. |
|
#4
| ||||
| ||||
| 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> |
|
#5
| ||||
| ||||
| 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 |
|
#6
| ||||
| ||||
| 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()
__________________ Grand Theft Auto 4 PC Video Game |
![]() |
|
| Thread Tools | Search this Thread |
| |
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 |