Double databinding

L

Lloyd Sheen

I have a page just about ready to go and then I noticed all the databinding
on the page was happening twice (which really isn't nice).

I then created a small sample just to see what was going on. The page
contains just a dropdown which is databound to a SQLDatasource.

When this runs with a breakpoint on the "Dim i As Integer = 1" line it show
a breakpoint twice on the load.

Any ideas???

Lloyd Sheen



Page Source:

<%@ Page Language="VB" AutoEventWireup="false"
CodeFile="TestAccordian.aspx.vb" Inherits="TestAccordian" %>

<%@ Register Assembly="System.Web.Extensions, Version=3.5.0.0,
Culture=neutral, PublicKeyToken=31bf3856ad364e35"
Namespace="System.Web.UI" TagPrefix="asp" %>

<!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>Test Databinding Problems</title>
</head>
<body>
<form id="form1" runat="server">
<asp:DropDownList ID="GenreList" runat="server"
DataSourceID="SqlDataSource1"
DataTextField="Genre" DataValueField="Genre"
OnDataBound="GenreList_DataBound"
ToolTip="Choose only artists tagged with this genre"
Width="100px">
</asp:DropDownList>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:C:\DATABASE
FILES\MUSICINFODB.MDFConnectionString %>"
SelectCommand="SELECT [Genre] FROM [AllGenres]">
</asp:SqlDataSource>
</form>
</body>
</html>


Code Behind :

Partial Class TestAccordian
Inherits System.Web.UI.Page

Protected Sub GenreList_DataBound(ByVal sender As Object, ByVal e As
System.EventArgs) Handles GenreList.DataBound
Dim i As Integer = 1
End Sub
End Class
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,186
Members
46,740
Latest member
JudsonFrie

Latest Threads

Top