Jump to content
kwilliams

Datalist Is Showing Up In Source Code, But Not On Web Page?

Recommended Posts

For some reason, the data for my datalist is showing up in the source code of the page without a problem, but it's not being displayed on the webpage. That page is just blank. Why could this happen?

Share this post


Link to post
Share on other sites

Here are more details:I've tested all of the stored procedures on the web page and within SQL Server's Management Studio, and they work great. And as I stated, the data is appearing in the source code. Thanks.ASP.NET PAGE:

   <form id="formEmployees" name="formEmployees" enctype="multipart/form-data" runat="server">		<div id="viewstatecontent">		<table width="100%" id="Employees">			<tbody>			<asp:DataList ID="dlEmployees" runat="server" OnItemDataBound="dtlEmployees_ItemDataBound" RepeatLayout="Flow">				<HeaderTemplate>					<tr>						<td>Full Name</td>					</tr>				</HeaderTemplate>				<ItemTemplate>					<tr>						<td>							<asp:Label ID="lblFullName" runat="server"></asp:Label>						</td>					</tr>				</ItemTemplate>			</asp:DataList>			</tbody>		</table>		</div>	</form></asp:Content>

VB.NET PAGE:

Partial Class employees	Inherits System.Web.UI.Page	'Assign global variables	Dim sqlConn As SqlConnection	Dim sqlCmd As SqlCommand	Dim strConnection As String	Public strJobID As String = Nothing	Private ds_details As New DataSet()	Private cmd_details As SqlDataAdapter = New SqlDataAdapter	Sub Page_Load(ByVal Sender As Object, ByVal E As EventArgs)		'Assign connection string		strConnection = System.Configuration.ConfigurationManager.AppSettings("strConn_Employees")		sqlConn = New SqlConnection(strConnection)		strJobID = Request.QueryString("JobID")		'Bind data		BindstrDbRecordID_employeedetails()	End Sub	'Bind Data to DataList Populating the Dataset	Sub BindstrDbRecordID_employeedetails()		'SELECT applications from database		cmd_details = New SqlDataAdapter("spEmployees @jobid = '" & strJobID & "'", sqlConn) 'LIVE		'Bind data		cmd_details.Fill(ds_details, "tblEmployees")		dlEmployees.DataSource = ds_details		dlEmployees.DataBind()	End Sub	'The ItemDataBound Event	Public Sub dtlEmployees_ItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DataListItemEventArgs)		Dim drv As DataRowView = CType(e.Item.DataItem, DataRowView)		If e.Item.ItemType = ListItemType.AlternatingItem Or e.Item.ItemType = ListItemType.Item Then			'Assign database values			Dim strDbFName As String = drv.Row("FName").ToString.Trim			Dim strDbMName As String = drv.Row("MName").ToString.Trim			Dim strDbLName As String = drv.Row("LName").ToString.Trim			'Assign label value			CType(e.Item.FindControl("lblFullName"), Label).Text = strDbLName & ", " & strDbMName & " " & strDbFName		End If		drv = Nothing 'Close DataRowView	End SubEnd Class

Edited by kwilliams

Share this post


Link to post
Share on other sites

For security reasons, I couldn't post the entire set of code. But that page is located within a Master Page.So I just removed all of the Master Page code for testing, and the data appears. So it's obviously a problem with the Master Page.Thanks anyway.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...