I'm new to ASP.NET and seems I screwed up my Web Form page that is based off of a Master.
It seems I mixed some invalid html codes but can't figure out why.
<%# Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Clips.aspx.cs" Inherits="Clip.Clips" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<asp:EntityDataSource ID="entityDataSource" runat="server" ConnectionString="name=ClipEnt" DefaultContainerName="ClipEnt" EnableDelete="True" EnableFlattening="False" EnableInsert="True" EnableUpdate="True" EntitySetName="Clips" EntityTypeFilter="Clip" OnSelecting="EntityDataSource_Selecting">
</asp:EntityDataSource>
<asp:GridView ID="GridView1" runat="server" AllowPaging="True" AllowSorting="True" DataSourceID="entityDataSource">
<Columns>
<asp:CommandField ShowDeleteButton="True" ShowEditButton="True" ShowSelectButton="True" />
</Columns>
</asp:GridView>
<div>
<h1>Sending Email</h1>
<table>
<tr>
<td>From:</td>
<td>
<asp:TextBox ID="txtFrom" runat="server" Width="250px"></asp:TextBox>
</td>
</tr>
<tr>
<td>From EMail:</td>
<td>
<asp:TextBox ID="txtFromEmail" runat="server" Width="250px"></asp:TextBox>
</td>
</tr>
<tr>
<td>To:</td>
<td>
<asp:TextBox ID="txtTo" runat="server" Width="250px"></asp:TextBox>
</td>
</tr>
<tr>
<td>To Email:</td>
<td>
<asp:TextBox ID="txtToEmail" runat="server" Width="250px"></asp:TextBox>
</td>
</tr>
<tr>
<td>Subject:</td>
<td>
<asp:TextBox ID="txtSubject" runat="server" Width="250px"></asp:TextBox>
</td>
</tr>
<tr>
<td>Message:</td>
<td>
<asp:TextBox ID="txtMessage" runat="server" TextMode="MultiLine" Height="138px"
Width="467px"></asp:TextBox>
</td>
</tr>
<tr>
<td colspan="2" align="right">
<asp:Button ID="btnSend" runat="server" Text="Send Email"
onclick="btnSend_Click" />
</td>
</tr>
</table>
<asp:Label ID="Label1" runat="server" ForeColor="Blue" />
</div>
</form>
</body>
</html>
</asp:Content>
In the masterpage you have something like this:
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<asp:ContentPlaceHolder ID="head" runat="server">
</asp:ContentPlaceHolder>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
</asp:ContentPlaceHolder>
</div>
</form>
</body>
</html>
You only need to have this stripped markup in the content page. Notice that I have removed DOCTYPE, <html>, <head>, <body> and <form> tags from content page - they will be rendered from Site.Master master page.
<%# Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Clips.aspx.cs" Inherits="Clip.Clips" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<asp:EntityDataSource ID="entityDataSource" runat="server" ConnectionString="name=ClipEnt" DefaultContainerName="ClipEnt" EnableDelete="True" EnableFlattening="False" EnableInsert="True" EnableUpdate="True" EntitySetName="Clips" EntityTypeFilter="Clip" OnSelecting="EntityDataSource_Selecting">
</asp:EntityDataSource>
<asp:GridView ID="GridView1" runat="server" AllowPaging="True" AllowSorting="True" DataSourceID="entityDataSource">
<Columns>
<asp:CommandField ShowDeleteButton="True" ShowEditButton="True" ShowSelectButton="True" />
</Columns>
</asp:GridView>
<div>
<h1>Sending Email</h1>
<table>
<tr>
<td>From:</td>
<td>
<asp:TextBox ID="txtFrom" runat="server" Width="250px"></asp:TextBox>
</td>
</tr>
<tr>
<td>From EMail:</td>
<td>
<asp:TextBox ID="txtFromEmail" runat="server" Width="250px"></asp:TextBox>
</td>
</tr>
<tr>
<td>To:</td>
<td>
<asp:TextBox ID="txtTo" runat="server" Width="250px"></asp:TextBox>
</td>
</tr>
<tr>
<td>To Email:</td>
<td>
<asp:TextBox ID="txtToEmail" runat="server" Width="250px"></asp:TextBox>
</td>
</tr>
<tr>
<td>Subject:</td>
<td>
<asp:TextBox ID="txtSubject" runat="server" Width="250px"></asp:TextBox>
</td>
</tr>
<tr>
<td>Message:</td>
<td>
<asp:TextBox ID="txtMessage" runat="server" TextMode="MultiLine" Height="138px"
Width="467px"></asp:TextBox>
</td>
</tr>
<tr>
<td colspan="2" align="right">
<asp:Button ID="btnSend" runat="server" Text="Send Email"
OnClick="btnSend_Click" />
</td>
</tr>
</table>
<asp:Label ID="Label1" runat="server" ForeColor="Blue" />
</div>
</asp:Content>
Some points to remember when developing an asp.net web site -
asp.net web forms can contain only one form tag with the attribute runat='server'. So, when a web form inherits from a masterpage, it inherits the form tag from the master page. therefore, no need to add a form tag separately to the web form.
Common parts of the page should be placed in the master page, where as changing parts should be placed in the web forms that inherit the master page. Site headers and footers are static to every page. so they should be placed on the master page. contents of the web site changes from page to page. so they should be placed on the web forms that inherit the master page.
Links to common resources, i.e. site style sheets and javascript files should also be placed once in the masterpage. web forms that inherit the masterpage will automatically inherit them.
these are some of the things by following which you can easily develop web forms with master pages.
Related
<%# Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true"
CodeFile="Feedback.aspx.cs" Inherits="Feedbackajax" Title="Star Bus: Feedback" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
<style type="text/css">
</style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="content1" runat="Server">
<div id="innertitle">
<table align="center" style="margin-bottom:25px">
<tr align="left">
<td align="left">
<strong>
<asp:Label ID="lblheat" runat="server" Text="Feedback" Font-Size="X-Large" ForeColor="#F7990D"></asp:Label>
</strong>
<br />
</td>
</tr>
</table>
</div>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder2" runat="Server">
<div id="rightContent">
<div class="mainText" id="maintextBox">
<!-- Body Content Starts -->
<div id="formBody" style="margin:0 auto;text-align:center">
<table cellspacing="3" cellpadding="0" border="0" align="center" style="text-align:left">
<tbody>
<tr>
<td height="30">
<strong><span>Name: </span></strong>
</td>
<td valign="middle">
<asp:TextBox ID="txtname" runat="server" />
<asp:RequiredFieldValidator ID="rfvnaem" ErrorMessage="*" ControlToValidate="txtname"
runat="server" />
</td>
</tr>
<tr>
<td height="30">
<strong><span>Email:</span></strong>
</td>
<td valign="middle">
<asp:TextBox ID="txtemail" runat="server" />
<asp:RequiredFieldValidator ID="rfvemail" ErrorMessage="*" ControlToValidate="txtemail"
runat="server" />
<asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ErrorMessage="Enter the Vaild Email ID"
ControlToValidate="txtemail" ValidationExpression="\w+([-+.']\w+)*\w+([-.]\w+)*\.\w+([-.]\w+)*" />
</td>
</tr>
<tr>
<td height="30">
<strong><span>Phone:</span></strong>
</td>
<td valign="middle">
<asp:TextBox ID="txtph" runat="server" />
<asp:RangeValidator ID="rangeph" ControlToValidate="txtph" Text="Invalid Phone" Type="Double"
MinimumValue="1" MaximumValue="9999999999" runat="server" />
</td>
</tr>
<tr>
<td height="30">
<strong><span>Subject:</span></strong>
</td>
<td valign="middle">
<div id="txtHint">
<asp:DropDownList CssClass="form" tyle="width: 130px" ID="dlsubject" runat="server"
Width="133px">
<asp:ListItem Text="Bus service" Value="Bus service"></asp:ListItem>
<asp:ListItem Text="website" Value="website"></asp:ListItem>
<asp:ListItem Text="schedules" Value="schedules"></asp:ListItem>
<asp:ListItem Text="Other" Value="Other"></asp:ListItem>
</asp:DropDownList>
</div>
</td>
</tr>
<tr>
<td>
<strong><span style="vertical-align:middle">Comment:</span></strong><br />(Max 1000 char)
</td>
<td class="style1">
<asp:TextBox ID="txtcomment" runat="server" MaxLength="1000" TextMode="MultiLine"
Height="75px" Width="235px" />
<asp:RequiredFieldValidator ID="rfvcomment" ErrorMessage="*" ControlToValidate="txtcomment"
runat="server" />
</td>
</tr>
<tr>
<td> </td>
<td colspan="2">
<asp:Button ID="btnsubmit" runat="server" Text="Submit" OnClick="btnsubmit_Click" />
</td>
</tr>
</tbody>
</table>
</div>
<!-- Body Content Ends -->
</div>
</div>
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="ContentPlaceHolder3" runat="Server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="ContentPlaceHolder4" runat="Server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
</asp:Content>
This is my ASP.NET project that I have already created. But now I have the need to convert this project to ASP.NET Core 2.1 or later.
I am finding it difficult to do it as there is a lot that has changed.
I would like to get the assistance of the expertise on how I could do it please.
My greatest problem is not knowing how to replace certain place holders and tag helpers to the newer version.
Regards
I am trying to implement a bootstrap's crousal and navbar using asp.net's master page
but nothing is apearing in the pages i tried to implement master page
Master page code
<%# Master Language="C#" AutoEventWireup="true"
CodeBehind="Survey.master.cs" Inherits="SurveySystem.Survey" %>
<!DOCTYPE html>
<html>
<head runat="server">
<title></title>
<asp:ContentPlaceHolder ID="head" runat="server">
</asp:ContentPlaceHolder>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:ContentPlaceHolder ID="body" runat="server">
<asp:Image ID="Image1" runat="server"
src="~/ProjectImage/download (2).jpg"/>
</asp:ContentPlaceHolder>
</div>
</form>
</body>
</html>
Form on which i tried to implement master page
<%# Page Language="C#" AutoEventWireup="true" CodeBehind="SignUp.aspx.cs"
Inherits="SurveySystem.SignUp" MasterPageFile="~/Survey.Master" %>
<asp:Content runat="server" ID="Content1" ContentPlaceHolderID="body" >
<h3 align="center">
Sign Up to Create Your Survey
</h3>
<table >
<tr>
<td class="auto-style1" colspan="2">
<asp:Label ID="Label1" runat="server" Text="First
Name*">
</asp:Label>
</td>
<td class="auto-style2">
<asp:TextBox ID="TextBoxFirstName" runat="server"
placeholder="First Name" class="form-control"></asp:TextBox>
</td>
</tr>
<tr>
<td class="auto-style1" colspan="2">
<asp:Label ID="Label2" runat="server" Text="Middle
Name"></asp:Label>
</td>
<td class="auto-style2">
<asp:TextBox class="form-control" ID="TextBoxMiddleName"
runat="server" placeholder="Middle Name"></asp:TextBox>
</td>
</tr>
<tr>
<td class="auto-style1" colspan="2">
<asp:Label ID="Label3" runat="server" Text="Last Name">
</asp:Label>
</td>
<td class="auto-style2">
<asp:TextBox ID="TextBoxLastName" class="form-control"
runat="server" placeholder="Last Name"></asp:TextBox>
</td>
</tr>
<tr>
<td class="auto-style1" colspan="2">
<asp:Label ID="Label5" runat="server" Text="Email*">
</asp:Label>
</td>
<td class="auto-style2">
<asp:TextBox ID="TextBoxEmail" runat="server"
class="form-control" placeholder="Email"></asp:TextBox>
</td>
</tr>
<tr>
<td class="auto-style1" colspan="2">
<asp:Label ID="Label4" runat="server" Text="Password*">
</asp:Label>
</td>
<td class="auto-style2">
<asp:TextBox ID="TextBoxpassword" runat="server"
class="form-control" TextMode="Password" placeholder="Password">
</asp:TextBox>
</td>
</tr>
<tr>
<td class="auto-style1" colspan="2">
<asp:Label ID="Label6" runat="server" Text="Confirm
Password*"></asp:Label>
</td>
<td class="auto-style2">
<asp:TextBox ID="TextBoxConfirm" TextMode="Password"
runat="server" class="form-control" placeholder="Confirm Password">
</asp:TextBox>
</td>
</tr>
<tr>
<td colspan="2">
<asp:FileUpload ID="UserFileUploadImage" runat="server"
/>
</td>
<td class="auto-style2">
<asp:Image ID="UserImagUpload" class="img-rounded"
runat="server" Width="150px" Height="150px" />
</td>
</tr>
<tr>
<td colspan="3" align="center">
<asp:Button ID="ButtonSignUp" runat="server"
Text="SignUp" OnClick="ButtonSignUp_Click" />
</td>
</tr>
<tr>
<td colspan="2">
* Mendatory Fields (You Must Fill these Fields)
</td>
</tr>
</table>
</asp:Content>
Here is the all code i am implementing but it isnt showing me any thing of Bootstrap crousal and navbar
You have placed image inside the asp ContentPlaceHolder which is wrong.
As the name suggest It is just a place holder and anything you want to put inside it must be put in the WebForms Content tags.
Your code should look like this:
Master
<%# Master Language="C#" AutoEventWireup="true" CodeBehind="Survey.master.cs" Inherits="SurveySystem.Survey" %>
<!DOCTYPE html>
<html>
<head runat="server">
<title></title>
<asp:ContentPlaceHolder ID="head" runat="server">
</asp:ContentPlaceHolder>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Image ID="Image1" runat="server" src="~/ProjectImage/download (2).jpg" />
<asp:ContentPlaceHolder ID="body" runat="server">
<%-- Dont write any code here --%>
</asp:ContentPlaceHolder>
</div>
</form>
</body>
</html>
WebForms
<%# Page Language="C#" AutoEventWireup="true" CodeBehind="SignUp.aspx.cs" Inherits="SurveySystem.SignUp" MasterPageFile="~/Survey.Master" %>
<asp:Content runat="server" ID="Content2" ContentPlaceHolderID="head"></asp:Content>
<asp:Content runat="server" ID="Content1" ContentPlaceHolderID="body">
<h3 align="center">Sign Up to Create Your Survey
</h3>
<table>
<tr>
<td class="auto-style1" colspan="2">
<asp:Label ID="Label1" runat="server" Text="First Name*"></asp:Label>
</td>
<td class="auto-style2">
<asp:TextBox ID="TextBoxFirstName" runat="server" placeholder="First Name" class="form-control"></asp:TextBox>
</td>
</tr>
<tr>
<td class="auto-style1" colspan="2">
<asp:Label ID="Label2" runat="server" Text="Middle Name"></asp:Label>
</td>
<td class="auto-style2">
<asp:TextBox class="form-control" ID="TextBoxMiddleName" runat="server" placeholder="Middle Name"></asp:TextBox>
</td>
</tr>
<tr>
<td class="auto-style1" colspan="2">
<asp:Label ID="Label3" runat="server" Text="Last Name"></asp:Label>
</td>
<td class="auto-style2">
<asp:TextBox ID="TextBoxLastName" class="form-control" runat="server" placeholder="Last Name"></asp:TextBox>
</td>
</tr>
<tr>
<td class="auto-style1" colspan="2">
<asp:Label ID="Label5" runat="server" Text="Email*"></asp:Label>
</td>
<td class="auto-style2">
<asp:TextBox ID="TextBoxEmail" runat="server" class="form-control" placeholder="Email"></asp:TextBox>
</td>
</tr>
<tr>
<td class="auto-style1" colspan="2">
<asp:Label ID="Label4" runat="server" Text="Password*"></asp:Label>
</td>
<td class="auto-style2">
<asp:TextBox ID="TextBoxpassword" runat="server" class="form-control" TextMode="Password" placeholder="Password"></asp:TextBox>
</td>
</tr>
<tr>
<td class="auto-style1" colspan="2">
<asp:Label ID="Label6" runat="server" Text="Confirm Password*"></asp:Label>
</td>
<td class="auto-style2">
<asp:TextBox ID="TextBoxConfirm" TextMode="Password" runat="server" class="form-control" placeholder="Confirm Password"></asp:TextBox>
</td>
</tr>
<tr>
<td colspan="2">
<asp:FileUpload ID="UserFileUploadImage" runat="server" />
</td>
<td class="auto-style2">
<asp:Image ID="UserImagUpload" class="img-rounded" runat="server" Width="150px" Height="150px" />
</td>
</tr>
<tr>
<td colspan="3" align="center">
<asp:Button ID="ButtonSignUp" runat="server" Text="SignUp" OnClick="ButtonSignUp_Click" />
</td>
</tr>
<tr>
<td colspan="2">* Mendatory Fields (You Must Fill these Fields)
</td>
</tr>
</table>
</asp:Content>
Master :
<%# Master Language="C#" AutoEventWireup="true" CodeBehind="MasterPageName.master.cs" Inherits="ApplicationName.MasterPageName" %>
....
<asp:ContentPlaceHolder ID="head" runat="server">
</asp:ContentPlaceHolder>
</head>
<body>
<form runat="server">
<div class="row">
<div class="col-md-12">
<div>
<asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
</asp:ContentPlaceHolder>
</div>
</div>
</div>
<!-- END PAGE CONTENT-->
</div>
</form>
</body>
Pages :
<%# Page Title="" Language="C#" MasterPageFile="~/MasterPageName.Master" AutoEventWireup="true" CodeBehind="PageName.aspx.cs" Inherits="ApplicationName.FolderExistsIFHave.PageName" culture="auto" meta:resourcekey="PageResource1" uiculture="auto" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<h1>Blank Page</h1>
</asp:Content>
If normal table means I got output otherwise how do i get it? My aspx page:
<%# Page Title="" Language="VB" MasterPageFile="~/UserRegistration.master" AutoEventWireup="false"
CodeFile="Default.aspx.vb" Inherits="_Default" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6/jquery.min.js" type="text/javascript"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js" type="text/javascript"></script>
<link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="Stylesheet" type="text/css" />
<script type="text/javascript">
$(function() {
$("[id$=txtdate]").datepicker({
showOn: 'button',
buttonImageOnly: true,
buttonImage: 'image/datepicker2.jpg'
});
});
</script>
<br />
<br />
<div align="center">
<asp:Label ID="label2" CssClass="label" runat="server"></asp:Label>
</div>
<div align="center">
<asp:TextBox ID="txtdate" DataFormatString="{0:MM/dd/yyyy}" AutoPostBack="true" runat="server" Width="107px"></asp:TextBox>
</div>
<br />
<br />
<table id="Table1" align="center" border="1" runat="server">
<tr>
<th>
TeamName
</th>
<th>
TeamMember
</th>
</tr>
<tr>
<td>
<asp:Label ID="lbl1" runat="server"> Team A </asp:Label>
</td>
<td>
<asp:CheckBoxList ID="cblbind" runat="server">
<asp:ListItem Text="Sinthu"></asp:ListItem>
<asp:ListItem Text="susi"></asp:ListItem>
<asp:ListItem Text="siva"></asp:ListItem>
</asp:CheckBoxList>
</td>
</tr>
<tr>
<td>
<asp:Label ID="Label1" runat="server"> Team B </asp:Label>
</td>
<td>
<asp:CheckBoxList ID="CheckBoxList1" runat="server">
<asp:ListItem Text="kavya"></asp:ListItem>
<asp:ListItem Text="subathra"></asp:ListItem>
<asp:ListItem Text="mani"></asp:ListItem>
<asp:ListItem Text="sunila"></asp:ListItem>
</asp:CheckBoxList>
</td>
</tr>
</table>
<div align="center">
<asp:Button ID="btnSubmit" Text="SUBMIT" runat="server" />
</div>
<br />
<br />
Here I put the values directly so I can get them easily.
If team name values and team member values are in the database it means how i can bind these items using a table? If the listview gridview means using bound event, what can I use in the table and how i can get the required output?
I had my TabContainer but when I run the TabContainer didn't display .
<asp:TabContainer ID="TC_Article" runat="server" ActiveTabIndex="0" Width="100%"
Visible="true">
<asp:TabPanel ID="Add" runat="server">
<HeaderTemplate>
Add New</HeaderTemplate>
<ContentTemplate>
<div class="gridpading" id="div" runat="server">
<table border="0" cellspacing="0" style="border-style: solid; border-width: 1px;"
runat="server" visible="False">
<tr id="tr_body" runat="server" visible="False">
<td align="left" width="150px" class="CDtxt" runat="server">
<asp:Label ID="lbl_Body" runat="server" Text="Article_Body"></asp:Label>
</td>
<td align="left" class="CDtxt" runat="server">
<table>
<tr>
<td valign="top">
<cc1:Editor ID="Ed_Body" runat="server" Height="340px" Width="100%" />
</td>
</tr>
</table>
</td>
<td style="width: 194px" runat="server">
</td>
</tr>
</table>
</div>
</ContentTemplate>
</asp:TabPanel>
</asp:TabContainer>
I added the Register
<%# Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit.HTMLEditor"
TagPrefix="cc1" %>
There is problem in Register tag in Namespace and also add script manager in page. Try this.
<%# Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
I am trying to put a Label control within a panel control. the panel control is supposed to enable the user scroll down when the label content grows bigger than the panel capacity.
<%# Page Language="C#" AutoEventWireup="true" CodeFile="EventReviewPage.aspx.cs"
Inherits="EventReviewPage" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<table>
<tr>
<td>
<asp:Label ID="Label1" runat="server" Text="Event Log: "></asp:Label>
</td>
<td>
<asp:TextBox ID="txtLog" runat="server"></asp:TextBox>
</td>
<td>
<asp:CheckBox ID="chkAll" runat="server" OnCheckedChanged="chkAll_CheckedChanged"
AutoPostBack="True" />
</td>
</tr>
<tr>
<td>
<asp:Label ID="Label2" runat="server" Text="Source: "></asp:Label>
</td>
<td>
<asp:TextBox ID="txtSource" runat="server"></asp:TextBox>
</td>
</tr>
</table>
</div>
<div>
<asp:Button ID="cmdGet" runat="server" Text="Get Records" OnClick="cmdGet_Click" />
</div>
<asp:Panel ID="Panel1" runat="server" BorderStyle="None" ScrollBars="Vertical">
<asp:Label ID="lblResult" runat="server" Text=""></asp:Label>
</asp:Panel>
</form>
</body>
</html>
The asp:Panel warps the text with a div, but you do not have specify a height for this panel, so their height is always fit the height of your data, and thats why you do not see scroll bar for that div.
If you set both height and width you see the scroll bar.
For example
<asp:Panel ID="Panel1" runat="server" BorderStyle="None"
ScrollBars="Vertical" Height="80px" Width="180px">