Monday, May 1, 2017
ASP.NET Example
<body>
<form id="form1" runat="server">
<div>
<asp:Label ID="Label1" runat="server" Text="Sno"></asp:Label><asp:TextBox ID="SnoTextBox"
runat="server"></asp:TextBox><br/>
<asp:Label ID="Label2" runat="server" Text="Name"></asp:Label><asp:TextBox ID="NameTextBox"
runat="server"></asp:TextBox><br/>
<asp:Label ID="Label3" runat="server" Text="Address"></asp:Label><asp:TextBox ID="AddressTextBox"
runat="server"></asp:TextBox><br/>
<asp:Button ID="Button1" runat="server" Text="Insert" onclick="Button1_Click" />
<asp:Button ID="Button2" runat="server" Text="Find" onclick="Button2_Click" />
<asp:Button ID="Button3" runat="server" Text="Update" onclick="Button3_Click" />
<asp:Button ID="Button4" runat="server" Text="Delete" onclick="Button4_Click" />
<asp:Button ID="Button5" runat="server" Text="Reset" />
<asp:SqlDataSource ID="SqlDataSource1" runat="server"></asp:SqlDataSource>
</div>
</form>
</body>
<form id="form1" runat="server">
<div>
<asp:Label ID="Label1" runat="server" Text="Sno"></asp:Label><asp:TextBox ID="SnoTextBox"
runat="server"></asp:TextBox><br/>
<asp:Label ID="Label2" runat="server" Text="Name"></asp:Label><asp:TextBox ID="NameTextBox"
runat="server"></asp:TextBox><br/>
<asp:Label ID="Label3" runat="server" Text="Address"></asp:Label><asp:TextBox ID="AddressTextBox"
runat="server"></asp:TextBox><br/>
<asp:Button ID="Button1" runat="server" Text="Insert" onclick="Button1_Click" />
<asp:Button ID="Button2" runat="server" Text="Find" onclick="Button2_Click" />
<asp:Button ID="Button3" runat="server" Text="Update" onclick="Button3_Click" />
<asp:Button ID="Button4" runat="server" Text="Delete" onclick="Button4_Click" />
<asp:Button ID="Button5" runat="server" Text="Reset" />
<asp:SqlDataSource ID="SqlDataSource1" runat="server"></asp:SqlDataSource>
</div>
</form>
</body>
Email Insertion in ASP.NET
<body>
<form id="form1" runat="server">
<div style=" width:400px; height:200px; margin:auto; background-color: #C0C0C0; padding-top:20px; padding-left:50px;">
<asp:Label ID="Label1" runat="server" Text="Name"></asp:Label> <asp:TextBox ID="NameTextBox" runat="server"></asp:TextBox><br/><br/>
<asp:Label ID="Label2" runat="server" Text="Email Id"></asp:Label> <asp:TextBox ID="EmailTextBox" runat="server"></asp:TextBox><br/><br/>
<asp:Label ID="Label3" runat="server" Text="Message"></asp:Label>
<asp:TextBox ID="MessageTextBox" runat="server"></asp:TextBox><br/><br/>
<asp:Button ID="SendButton" runat="server" Text="Send" Height="33px"
Width="68px" onclick="SendButton_Click" />
</div>
</form>
</body>
<form id="form1" runat="server">
<div style=" width:400px; height:200px; margin:auto; background-color: #C0C0C0; padding-top:20px; padding-left:50px;">
<asp:Label ID="Label1" runat="server" Text="Name"></asp:Label> <asp:TextBox ID="NameTextBox" runat="server"></asp:TextBox><br/><br/>
<asp:Label ID="Label2" runat="server" Text="Email Id"></asp:Label> <asp:TextBox ID="EmailTextBox" runat="server"></asp:TextBox><br/><br/>
<asp:Label ID="Label3" runat="server" Text="Message"></asp:Label>
<asp:TextBox ID="MessageTextBox" runat="server"></asp:TextBox><br/><br/>
<asp:Button ID="SendButton" runat="server" Text="Send" Height="33px"
Width="68px" onclick="SendButton_Click" />
</div>
</form>
</body>
Display Image in List View in ASP.NET
<body>
<form id="form1" runat="server">
<div class="Main">
<asp:ListView ID="ListView1" runat="server" GroupItemCount="3" DataSourceID="SqlDataSource1"
SelectedIndex="3">
<LayoutTemplate>
<asp:PlaceHolder ID="groupPlaceHolder" runat="server"></asp:PlaceHolder>
</LayoutTemplate>
<GroupTemplate>
<asp:PlaceHolder ID="itemPlaceHolder" runat="server"></asp:PlaceHolder>
</GroupTemplate>
<ItemTemplate>
<div class="productItem">
<div>
<asp:Image ID="Image1" runat="server" ImageUrl='<%# Eval("Pimage") %>' />
</div>
<div>
<b>
Product Id: <%# Eval("Pid") %></b></div>
<div>
Product Name: <%# Eval("Pname") %></div>
<div>
Product cost: Rs<%# Eval("Pcost") %></div>
<asp:Button ID="Button1" runat="server" Text="Add To Cart" />
</div>
</ItemTemplate>
<ItemSeparatorTemplate>
<div class="itemSeparator">
</div>
</ItemSeparatorTemplate>
<GroupSeparatorTemplate>
<div class="groupSeparator">
</div>
</GroupSeparatorTemplate>
</asp:ListView>
</div>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:ExampleConnectionString %>"
SelectCommand="SELECT * FROM [Product]"></asp:SqlDataSource>
</form>
</body>
<form id="form1" runat="server">
<div class="Main">
<asp:ListView ID="ListView1" runat="server" GroupItemCount="3" DataSourceID="SqlDataSource1"
SelectedIndex="3">
<LayoutTemplate>
<asp:PlaceHolder ID="groupPlaceHolder" runat="server"></asp:PlaceHolder>
</LayoutTemplate>
<GroupTemplate>
<asp:PlaceHolder ID="itemPlaceHolder" runat="server"></asp:PlaceHolder>
</GroupTemplate>
<ItemTemplate>
<div class="productItem">
<div>
<asp:Image ID="Image1" runat="server" ImageUrl='<%# Eval("Pimage") %>' />
</div>
<div>
<b>
Product Id: <%# Eval("Pid") %></b></div>
<div>
Product Name: <%# Eval("Pname") %></div>
<div>
Product cost: Rs<%# Eval("Pcost") %></div>
<asp:Button ID="Button1" runat="server" Text="Add To Cart" />
</div>
</ItemTemplate>
<ItemSeparatorTemplate>
<div class="itemSeparator">
</div>
</ItemSeparatorTemplate>
<GroupSeparatorTemplate>
<div class="groupSeparator">
</div>
</GroupSeparatorTemplate>
</asp:ListView>
</div>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:ExampleConnectionString %>"
SelectCommand="SELECT * FROM [Product]"></asp:SqlDataSource>
</form>
</body>
Display Image Grid View in ASP.NET
<body>
<form id="form1" runat="server">
<div id="grid">
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"
PageSize="3" AllowPaging="True"
DataSourceID="SqlDataSource1" CellPadding="2" ForeColor="Black"
GridLines="None" Height="141px" Width="397px"
BackColor="LightGoldenrodYellow" BorderColor="Tan" BorderWidth="1px" >
<AlternatingRowStyle BackColor="PaleGoldenrod" />
<Columns>
<asp:TemplateField HeaderText="Id">
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%#Eval("Id") %>'>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Name">
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%#Eval("Name") %>'>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="FatherName">
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%#Eval("Fname") %>'>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Address">
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%#Eval("Address") %>'>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Photo">
<ItemTemplate>
<asp:Image ID="Image1" runat="server" ImageUrl='<%#Eval("image") %>'> </asp:Image>
</ItemTemplate>
</asp:TemplateField>
</Columns>
<FooterStyle BackColor="Tan" />
<HeaderStyle BackColor="Tan" Font-Bold="True" />
<PagerStyle BackColor="PaleGoldenrod" ForeColor="DarkSlateBlue"
HorizontalAlign="Center" />
<SelectedRowStyle BackColor="DarkSlateBlue" ForeColor="GhostWhite" />
<SortedAscendingCellStyle BackColor="#FAFAE7" />
<SortedAscendingHeaderStyle BackColor="#DAC09E" />
<SortedDescendingCellStyle BackColor="#E1DB9C" />
<SortedDescendingHeaderStyle BackColor="#C2A47B" />
</asp:GridView>
</div>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:ExampleConnectionString3 %>"
SelectCommand="SELECT * FROM [Empolyee]"></asp:SqlDataSource>
</form>
</body>
<form id="form1" runat="server">
<div id="grid">
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"
PageSize="3" AllowPaging="True"
DataSourceID="SqlDataSource1" CellPadding="2" ForeColor="Black"
GridLines="None" Height="141px" Width="397px"
BackColor="LightGoldenrodYellow" BorderColor="Tan" BorderWidth="1px" >
<AlternatingRowStyle BackColor="PaleGoldenrod" />
<Columns>
<asp:TemplateField HeaderText="Id">
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%#Eval("Id") %>'>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Name">
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%#Eval("Name") %>'>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="FatherName">
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%#Eval("Fname") %>'>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Address">
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%#Eval("Address") %>'>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Photo">
<ItemTemplate>
<asp:Image ID="Image1" runat="server" ImageUrl='<%#Eval("image") %>'> </asp:Image>
</ItemTemplate>
</asp:TemplateField>
</Columns>
<FooterStyle BackColor="Tan" />
<HeaderStyle BackColor="Tan" Font-Bold="True" />
<PagerStyle BackColor="PaleGoldenrod" ForeColor="DarkSlateBlue"
HorizontalAlign="Center" />
<SelectedRowStyle BackColor="DarkSlateBlue" ForeColor="GhostWhite" />
<SortedAscendingCellStyle BackColor="#FAFAE7" />
<SortedAscendingHeaderStyle BackColor="#DAC09E" />
<SortedDescendingCellStyle BackColor="#E1DB9C" />
<SortedDescendingHeaderStyle BackColor="#C2A47B" />
</asp:GridView>
</div>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:ExampleConnectionString3 %>"
SelectCommand="SELECT * FROM [Empolyee]"></asp:SqlDataSource>
</form>
</body>
Subscribe to:
Posts (Atom)