473,403 Members | 2,354 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

asp:Button not firing on first click when in PopupControlExtender

Hi all,

I'm really stuck trying to figure the following out. I have been
working on a shopping portal where you can select products from a list
inside a repeater on the bottom of the page and on each row, once
clicked you can enter a quantity and add it to your cart automatically
on top (using UpdatePanel). Everything seems to be working fine when I
created a dummy DataTable and did a bind but now that I'm actually
reading the contents of my DataTable from a database it just does fire
the first time you click the Add button (second time is fine) which is
really odd (seems like bug). As soon as I change it to read from my
own generated DataTable (same columns) it works fine. On each row
there is Plus sign once clicked opens up a popup (using
PopupControlExtender) containing a Qty textbox and an Add button. I
even set a breakpoint on my rptAvailableProducts_ItemCommand which is
doesn't catch the event the first time you click Add. However, second
time clicked works fine.

I've included a sample code below. Anyone knows why it's not firing
the first time? why the event is lost?

<asp:Panel ID="Panel1" runat="server" CssClass="popupControl">
<asp:UpdatePanel runat="server" ID="up1">
<ContentTemplate>
<div class="subArea1">
<!-- hidden value -->
<span class="sku">SKU:</span<asp:Label ID="lblSKU" runat="server"
Text='<%# Eval("SKU") %>'></asp:Label><br />
<asp:Label ID="lblProductName" runat="server" Text='<%#
Eval("ProductName") %>'></asp:Label>

<div style="text-align:right;">

QTY: <asp:TextBox ID="tbxQty" CssClass="qtyTextBox1" runat="server"
AutoPostBack="true"></asp:TextBox<asp:RangeValidator ID="rvtbxQty"
runat="server" ControlToValidate="tbxQty" Display="Dynamic"
ErrorMessage="* Quantity incorrect" MinimumValue="1"
MaximumValue="1000000" Type="Integer"></asp:RangeValidator>

<asp:Button ID="btnAdd1" runat="server" CssClass="btnPopupAdd"
Text="Add" CommandArgument="1" CommandName="Click"
UseSubmitBehavior="False" /><br />
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>

</asp:Panel>

<cc1:PopupControlExtender ID="PopupControlExtender1" runat="server"
TargetControlID="iAdd1"
PopupControlID="Panel1" Position="Bottom" OffsetY="10" />

.cs

protected void rptAvailableProducts_ItemCommand(object source,
RepeaterCommandEventArgs e)
{
if (e.CommandName == "Click")
{ ...
....
....
Thanks all
Oct 2 '08 #1
1 4870
In UpdatePanel add Triggers section with AsyncPostBack and assign the said
buttons controlID there

Then you are done.

"mazdotnet" <ma*******@gmail.comwrote in message
news:a3**********************************@k30g2000 hse.googlegroups.com...
Hi all,

I'm really stuck trying to figure the following out. I have been
working on a shopping portal where you can select products from a list
inside a repeater on the bottom of the page and on each row, once
clicked you can enter a quantity and add it to your cart automatically
on top (using UpdatePanel). Everything seems to be working fine when I
created a dummy DataTable and did a bind but now that I'm actually
reading the contents of my DataTable from a database it just does fire
the first time you click the Add button (second time is fine) which is
really odd (seems like bug). As soon as I change it to read from my
own generated DataTable (same columns) it works fine. On each row
there is Plus sign once clicked opens up a popup (using
PopupControlExtender) containing a Qty textbox and an Add button. I
even set a breakpoint on my rptAvailableProducts_ItemCommand which is
doesn't catch the event the first time you click Add. However, second
time clicked works fine.

I've included a sample code below. Anyone knows why it's not firing
the first time? why the event is lost?

<asp:Panel ID="Panel1" runat="server" CssClass="popupControl">
<asp:UpdatePanel runat="server" ID="up1">
<ContentTemplate>
<div class="subArea1">
<!-- hidden value -->
<span class="sku">SKU:</span<asp:Label ID="lblSKU" runat="server"
Text='<%# Eval("SKU") %>'></asp:Label><br />
<asp:Label ID="lblProductName" runat="server" Text='<%#
Eval("ProductName") %>'></asp:Label>

<div style="text-align:right;">

QTY: <asp:TextBox ID="tbxQty" CssClass="qtyTextBox1" runat="server"
AutoPostBack="true"></asp:TextBox<asp:RangeValidator ID="rvtbxQty"
runat="server" ControlToValidate="tbxQty" Display="Dynamic"
ErrorMessage="* Quantity incorrect" MinimumValue="1"
MaximumValue="1000000" Type="Integer"></asp:RangeValidator>

<asp:Button ID="btnAdd1" runat="server" CssClass="btnPopupAdd"
Text="Add" CommandArgument="1" CommandName="Click"
UseSubmitBehavior="False" /><br />
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>

</asp:Panel>

<cc1:PopupControlExtender ID="PopupControlExtender1" runat="server"
TargetControlID="iAdd1"
PopupControlID="Panel1" Position="Bottom" OffsetY="10" />

.cs

protected void rptAvailableProducts_ItemCommand(object source,
RepeaterCommandEventArgs e)
{
if (e.CommandName == "Click")
{ ...
...
...
Thanks all
Oct 2 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: esoroka | last post by:
Hello, Trying to run a script what start ASP button: document.Form1.all.click(); It is work one time only. Next script ignore it. Where can be problem??? A full script is as follows:
14
by: Sinity | last post by:
Anyone knows the method/codes to disable the clicked button after first click by using .aspx-- to prevent people to click many time when waiting for the server response. I tried to do this by...
6
by: Rod Snyder | last post by:
I'm trying to set up a page with an asp.net link button that would send a user to a certain page and on page load execute a specific stored procedure tied to the button on the previous page. The...
1
by: Timothy V | last post by:
Hi, How do i make an asp:Button execute its Click event when the Enter key is pressed? Thanks in advance, Tim.
2
by: Ed Chiu | last post by:
Hi, I would like to add a <asp:button> to a webform. When user click on this button, the page will connect to SQL server and update tables, then the browser window will be closed. I know how...
8
by: tatemononai | last post by:
I had a beautiful script that was running, well, just beautifully. But then I decided to take a button that fired an event and place it inside a <asp:table. The event WILL NOT FIRE INSIDE THE...
5
by: csgraham74 | last post by:
Hi guys, I posted regarding this issue the other day but i still dont have an answer to my problem. Basically i have imported asp.net pages from dreamweaver into visual studio. Ive added a...
3
by: needin4mation | last post by:
Hi, I have an asp:button that has a ShowModalDialog script attribute added to it. When the ShowModalDialog opens the user is supposed to select some data which is then sent back to the calling...
8
by: SAL | last post by:
Hello, I have a button on a webform that has an OnClick event defined as such: <asp:Button ID="btnSearchByName" runat="server" Text="Search By Name" OnClick="btnSearchByName_Click" Width="152px"...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.