Click here to Skip to main content
16,012,045 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
hello,

how to get data from database in frontend asp.net pages without datagridview

and if may be possible give me java-script code i use inline JS in my web project.

this code working properly get data from database but not lucking good shape.

if you have best code plz give me.
thanks


<h3 class="color_love font_heading left-1">Our News</h3>
<div class="tabs">

<asp:SqlDataSource
ID="SqlDataSource1"
runat="server"
ConnectionString="<%$ ConnectionStrings:dbJmblissConnectionString %>"
SelectCommand="SELECT [title], [news], [PostDate] FROM [tblNews]">
</asp:SqlDataSource>
<marquee onmouseover="stop()" önmouseout="start()" margin-left="15px" direction="up" scrollamount="2" width="300" height="270" <%--behavior="alternate"--%> text-align="justify">
<div style="width:300px;font-size:17px;">

<asp:FormView ID="FormView1"
runat="server"
DataSourceID="SqlDataSource1"
AllowPaging="True" margin-left="14px" text-align="justify" >
<EditItemTemplate>
Title:
<asp:TextBox ID="TitleTextBox" runat="server" Text='<%# Bind("title") %>' />
<br /><br />
News:
<asp:TextBox ID="NewsTextBox" runat="server" Text='<%# Bind("news") %>' />
<br /><br />
PostDate:
<asp:TextBox ID="PostDateTextBox" runat="server"
Text='<%# Bind("PostDate") %>' />
<br />
<asp:LinkButton ID="UpdateButton" runat="server" CausesValidation="True"
CommandName="Update" Text="Update" />
&nbsp;<asp:LinkButton ID="UpdateCancelButton" runat="server"
CausesValidation="False" CommandName="Cancel" Text="Cancel" />
</EditItemTemplate>

<InsertItemTemplate>
Title:
<asp:TextBox ID="TitleTextBox" runat="server" Text='<%# Bind("title") %>' />
<br /><br />
News:
<asp:TextBox ID="NewsTextBox" runat="server" Text='<%# Bind("news") %>' />
<br /><br />
PostDate:
<asp:TextBox ID="PostDateTextBox" runat="server"
Text='<%# Bind("PostDate") %>' />
<br />
<asp:LinkButton ID="InsertButton" runat="server" CausesValidation="True"
CommandName="Insert" Text="Insert" />
&nbsp;<asp:LinkButton ID="InsertCancelButton" runat="server"
CausesValidation="False" CommandName="Cancel" Text="Cancel" />
</InsertItemTemplate>
<ItemTemplate>
Title:
<asp:Label ID="TitleLabel" runat="server" Text='<%# Bind("title") %>' />
<br /> <br />
News:
<asp:Label ID="NewsLabel" runat="server" Text='<%# Bind("news") %>' />
<br /> <br />
PostDate:
<asp:Label ID="PostDateLabel" runat="server" Text='<%# Bind("PostDate") %>' />
<br />
</ItemTemplate>
<PagerSettings Mode="Numeric"/>

</asp:FormView>
</div></marquee>
Posted
Updated 6-Aug-13 21:17pm
v2
Comments
[no name] 29-Jun-13 10:16am    
That would be the exact same answer you have already been given the last 2 times you asked. Please go and actually try something instead of spamming the message board.
Thanks7872 30-Jun-13 3:43am    
I dont know if you are agree with me or not. But i have gone through so many questions in last week in which OP is making question(and ultimately the development)so harder without any reason,and in some questions,even he/she wants such a functionality thats either not possible or needs invention of new framework.

We understand that sometimes clients have some specific requirements,but it does not mean a lot as per as some limitations are concerned. e.g. why to get data from database using javascript?Why to avoid using backend?Why?Ugliest logic i ever came across.If one dont know about what should be done at front or back end,then i think they should learn lil bit in this field and then go ahead....

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