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.AppSet tings("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 5 3025
The interesting thing is you can just put a nothing link (no id, test,
event) anywhere on the page and it will cause the page to work. But the
linkbutton must be visible.
I added the following to the 2 pages that quit working and all of a sudden
they worked fine.
<asp:linkButton runat="server" />
This makes no sense !!!!!
It works fine as a bandaid, but not a proper solution.
Tom
"tshad" <ts**********@ftsolutions.com> wrote in message
news:eF*************@TK2MSFTNGP15.phx.gbl... 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.AppSet tings("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
makes perfect sense.
you wrote client code that calls __doPostBack(), the routine used by
autopostback (javascript) controls. you need an autopostback control on the
page for this to be available. a linkbutton works, but a standard asp:button
is actually a submit button, and does not require javascript to postback. if
a control is maked invisible, its not rendered, so it just like its not on
the page.
-- bruce (sqlwork.com)
"tshad" <ts**********@ftsolutions.com> wrote in message
news:eF*************@TK2MSFTNGP15.phx.gbl... 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.AppSet tings("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
"Bruce Barker" <br******************@safeco.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl... makes perfect sense.
you wrote client code that calls __doPostBack(), the routine used by autopostback (javascript) controls. you need an autopostback control on the page for this to be available. a linkbutton works, but a standard asp:button is actually a submit button, and does not require javascript to postback. if a control is maked invisible, its not rendered, so it just like its not on the page.
I'd never heard that one before.
I don't think any of the other places where it shows how to set up double
clicking do they talk about needing another control to make it work.
I assumed that the double click event is self contained to the control it is
connected to as well as Javascript (not asp.net). What else could I use on
the page to make it work other than a link button.
The invisible problem does make sense.
Thanks,
Tom -- bruce (sqlwork.com)
"tshad" <ts**********@ftsolutions.com> wrote in message news:eF*************@TK2MSFTNGP15.phx.gbl...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.AppSet tings("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
the code you add to the dblclick is
"__doPostBack('LbxSender','')"
for the client javascript function __doPostBack to exist, you need an
autopostback control on the page. if you just need a postback try:
"document.forms[0].submit();"
-- bruce (sqlwork.com)
"tshad" <ts**********@ftsolutions.com> wrote in message
news:eD**************@TK2MSFTNGP15.phx.gbl... "Bruce Barker" <br******************@safeco.com> wrote in message news:%2****************@TK2MSFTNGP10.phx.gbl... makes perfect sense.
you wrote client code that calls __doPostBack(), the routine used by autopostback (javascript) controls. you need an autopostback control on the page for this to be available. a linkbutton works, but a standard asp:button is actually a submit button, and does not require javascript to postback. if a control is maked invisible, its not rendered, so it just like its not on the page.
I'd never heard that one before.
I don't think any of the other places where it shows how to set up double clicking do they talk about needing another control to make it work.
I assumed that the double click event is self contained to the control it is connected to as well as Javascript (not asp.net). What else could I use on the page to make it work other than a link button.
The invisible problem does make sense.
Thanks,
Tom -- bruce (sqlwork.com)
"tshad" <ts**********@ftsolutions.com> wrote in message news:eF*************@TK2MSFTNGP15.phx.gbl...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.AppSet tings("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
"Bruce Barker" <br******************@safeco.com> wrote in message
news:uT*************@TK2MSFTNGP15.phx.gbl... the code you add to the dblclick is
"__doPostBack('LbxSender','')"
for the client javascript function __doPostBack to exist, you need an autopostback control on the page. if you just need a postback try:
"document.forms[0].submit();"
Where would I put that?
For an autopostback, could I just put that on the asp:listbox line?
Thanks,
Tom -- bruce (sqlwork.com)
"tshad" <ts**********@ftsolutions.com> wrote in message news:eD**************@TK2MSFTNGP15.phx.gbl... "Bruce Barker" <br******************@safeco.com> wrote in message news:%2****************@TK2MSFTNGP10.phx.gbl... makes perfect sense.
you wrote client code that calls __doPostBack(), the routine used by autopostback (javascript) controls. you need an autopostback control on the page for this to be available. a linkbutton works, but a standard asp:button is actually a submit button, and does not require javascript to postback. if a control is maked invisible, its not rendered, so it just like its not on the page.
I'd never heard that one before.
I don't think any of the other places where it shows how to set up double clicking do they talk about needing another control to make it work.
I assumed that the double click event is self contained to the control it is connected to as well as Javascript (not asp.net). What else could I use on the page to make it work other than a link button.
The invisible problem does make sense.
Thanks,
Tom -- bruce (sqlwork.com)
"tshad" <ts**********@ftsolutions.com> wrote in message news:eF*************@TK2MSFTNGP15.phx.gbl... 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.AppSet tings("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
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Richard A. Lowe |
last post by:
I'm using P/Invoke to call SendInput (using code culled
from these newsgroups!) to send mouse events to a window.
But I'm unsure how to send double-clicks. A VB6 article I
saw on SendInput...
|
by: Lalit Bhatia |
last post by:
Hi
when focus is on a cell in datagrid. double click event does not occur.
when I double click on rowheader, columnheader then this event fires.
I am using DataGridTableStyle in the grid.
...
|
by: active |
last post by:
I've been working on a problem for a few days now. I do not get a
Double-Click event fired for a ListView when I double click.
I now find that if I double click with the right button it works OK....
|
by: active |
last post by:
I've been working on a problem for a few days now. I do not get a
Double-Click event fired for a ListView when I double click.
I now find that if I double click with the right button it works OK....
|
by: Neil Wallace |
last post by:
Hi,
This is an odd one. I've been struggling to get "double click" to work well
for my controls.
The same event handler works perfectly for buttons, but not for labels.
Can anyone tell me...
|
by: Siv |
last post by:
Hi,
I have a ListView control in a Windows application, currently single
clicking a customer name in this list, selects the customer and displays
their details in text boxes to the right of the...
|
by: Armando |
last post by:
I have an app (A2000) where I am letting the user move an object on the
screen. I use the OnClick for a command button event to modify the object's
Top (or Left) properties, but you can only click...
|
by: Jim Devenish |
last post by:
I have an unbound form that displays all the days of the year as a
calendar. It has 12 rows of text boxes with either 29,30 or 31 in
each row. Text box names are of the form: display_01_01,...
|
by: Tom |
last post by:
Double clicking the title bar to toggle a form between full screen
size and the previous size is a great feature.
Can someone please explain how to programmatically double click the
title bar?
...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM).
In this month's session, the creator of the excellent VBE...
|
by: DolphinDB |
last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation.
Take...
|
by: Aftab Ahmad |
last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below.
Dim IE As Object
Set IE =...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
by: ArrayDB |
last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
|
by: PapaRatzi |
last post by:
Hello,
I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
| |