T
tshad
I have been working with setting my drop boxes to allow double clicking to
select an item.
It worked fine until I made some changes. I then stripped the page down to
the bare essentials to find out why it quit working. I found that if I
didn't have a linkbutton, it quit working?????????
If I changed the linkbutton to a regular button, it quit working.
Here is the page:
***************************************************************
<%@ Page Language="VB" trace="true" debug="true" ContentType="text/html"
ResponseEncoding="iso-8859-1" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.SqlClient" %>
<html>
<head>
<title>:: Staffing Workshop ::</title>
<script runat="server">
sub Page_load(s as object,e as eventargs)
if not IsPostBack then
session("ClientID") = "1234"
Call CheckResumes()
Me.StoredResumes.Attributes("ondblClick") =
"__doPostBack('LbxSender','')"
end if
If Request.Form("__EVENTTARGET") = "LbxSender" Then
trace.warn("Inside LbxSender")
End If
end sub
Sub CheckResumes()
Dim emailReader As SqlDataReader
Dim ConnectionString as String
=System.Configuration.ConfigurationSettings.AppSettings("MM_CONNECTION_STRING_ftsolutions")
Dim objConn as New SqlConnection (ConnectionString)
Dim CommandText as String = "Select ResumeTitle,ResumeID,CoverLetterID
from ftsolutions.dbo.ResumeTemplates where ClientID = @ClientID and Email =
@Email"
Dim objCmd as New SqlCommand(CommandText,objConn)
with objCmd.Parameters
.Add("@ClientID",SqlDbType.VarChar,20).value = session("ClientID")
.Add("@Email",SqlDbType.VarChar,45).value = session("Email")
end with
objConn.Open()
StoredResumes.DataSource=objCmd.ExecuteReader
StoredResumes.DataValueField="ResumeID"
StoredResumes.DataTextField= "ResumeTitle"
StoredResumes.databind()
End Sub
</script>
</head>
<body id="myBody" runat="server">
<form action="" method="post" runat="server">
<br>
<asp:ListBox id="StoredResumes" rows="5" columns="30"
runat="server" />
<asp:linkButton id="NewRecord" Text="New" runat="server" />
</form>
<p> </p>
</body>
</html>
*************************************************************************
This page works fine. Loads the Listbox fine. Sets the Listbox to have the
ondblClick event, which works great (it does post back and the trace.warn
displays fine.
But if I take out the line:
<asp:linkButton id="NewRecord" Text="New" runat="server" />
It quits working.
If I change it to:
<asp:Button id="NewRecord" Text="New" runat="server" />
It quits working (the button works, but the dblClick does not).
These objects are not connected, why would it have an effect?
I need to find out what is happening as 2 of my main pages are now not
working correctly.
Thanks,
Tom
select an item.
It worked fine until I made some changes. I then stripped the page down to
the bare essentials to find out why it quit working. I found that if I
didn't have a linkbutton, it quit working?????????
If I changed the linkbutton to a regular button, it quit working.
Here is the page:
***************************************************************
<%@ Page Language="VB" trace="true" debug="true" ContentType="text/html"
ResponseEncoding="iso-8859-1" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.SqlClient" %>
<html>
<head>
<title>:: Staffing Workshop ::</title>
<script runat="server">
sub Page_load(s as object,e as eventargs)
if not IsPostBack then
session("ClientID") = "1234"
Call CheckResumes()
Me.StoredResumes.Attributes("ondblClick") =
"__doPostBack('LbxSender','')"
end if
If Request.Form("__EVENTTARGET") = "LbxSender" Then
trace.warn("Inside LbxSender")
End If
end sub
Sub CheckResumes()
Dim emailReader As SqlDataReader
Dim ConnectionString as String
=System.Configuration.ConfigurationSettings.AppSettings("MM_CONNECTION_STRING_ftsolutions")
Dim objConn as New SqlConnection (ConnectionString)
Dim CommandText as String = "Select ResumeTitle,ResumeID,CoverLetterID
from ftsolutions.dbo.ResumeTemplates where ClientID = @ClientID and Email =
@Email"
Dim objCmd as New SqlCommand(CommandText,objConn)
with objCmd.Parameters
.Add("@ClientID",SqlDbType.VarChar,20).value = session("ClientID")
.Add("@Email",SqlDbType.VarChar,45).value = session("Email")
end with
objConn.Open()
StoredResumes.DataSource=objCmd.ExecuteReader
StoredResumes.DataValueField="ResumeID"
StoredResumes.DataTextField= "ResumeTitle"
StoredResumes.databind()
End Sub
</script>
</head>
<body id="myBody" runat="server">
<form action="" method="post" runat="server">
<br>
<asp:ListBox id="StoredResumes" rows="5" columns="30"
runat="server" />
<asp:linkButton id="NewRecord" Text="New" runat="server" />
</form>
<p> </p>
</body>
</html>
*************************************************************************
This page works fine. Loads the Listbox fine. Sets the Listbox to have the
ondblClick event, which works great (it does post back and the trace.warn
displays fine.
But if I take out the line:
<asp:linkButton id="NewRecord" Text="New" runat="server" />
It quits working.
If I change it to:
<asp:Button id="NewRecord" Text="New" runat="server" />
It quits working (the button works, but the dblClick does not).
These objects are not connected, why would it have an effect?
I need to find out what is happening as 2 of my main pages are now not
working correctly.
Thanks,
Tom