473,657 Members | 2,489 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

asp:Button not firing on first click when in PopupControlExt ender

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
PopupControlExt ender) containing a Qty textbox and an Add button. I
even set a breakpoint on my rptAvailablePro ducts_ItemComma nd 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="popup Control">
<asp:UpdatePane l runat="server" ID="up1">
<ContentTemplat e>
<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="lblProductN ame" runat="server" Text='<%#
Eval("ProductNa me") %>'></asp:Label>

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

QTY: <asp:TextBox ID="tbxQty" CssClass="qtyTe xtBox1" runat="server"
AutoPostBack="t rue"></asp:TextBox<asp :RangeValidator ID="rvtbxQty"
runat="server" ControlToValida te="tbxQty" Display="Dynami c"
ErrorMessage="* Quantity incorrect" MinimumValue="1 "
MaximumValue="1 000000" Type="Integer"> </asp:RangeValida tor>

<asp:Button ID="btnAdd1" runat="server" CssClass="btnPo pupAdd"
Text="Add" CommandArgument ="1" CommandName="Cl ick"
UseSubmitBehavi or="False" /><br />
</div>
</div>
</ContentTemplate >
</asp:UpdatePanel >

</asp:Panel>

<cc1:PopupContr olExtender ID="PopupContro lExtender1" runat="server"
TargetControlID ="iAdd1"
PopupControlID= "Panel1" Position="Botto m" OffsetY="10" />

.cs

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

Then you are done.

"mazdotnet" <ma*******@gmai l.comwrote in message
news:a3******** *************** ***********@k30 g2000hse.google groups.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
PopupControlExt ender) containing a Qty textbox and an Add button. I
even set a breakpoint on my rptAvailablePro ducts_ItemComma nd 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="popup Control">
<asp:UpdatePane l runat="server" ID="up1">
<ContentTemplat e>
<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="lblProductN ame" runat="server" Text='<%#
Eval("ProductNa me") %>'></asp:Label>

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

QTY: <asp:TextBox ID="tbxQty" CssClass="qtyTe xtBox1" runat="server"
AutoPostBack="t rue"></asp:TextBox<asp :RangeValidator ID="rvtbxQty"
runat="server" ControlToValida te="tbxQty" Display="Dynami c"
ErrorMessage="* Quantity incorrect" MinimumValue="1 "
MaximumValue="1 000000" Type="Integer"> </asp:RangeValida tor>

<asp:Button ID="btnAdd1" runat="server" CssClass="btnPo pupAdd"
Text="Add" CommandArgument ="1" CommandName="Cl ick"
UseSubmitBehavi or="False" /><br />
</div>
</div>
</ContentTemplate >
</asp:UpdatePanel >

</asp:Panel>

<cc1:PopupContr olExtender ID="PopupContro lExtender1" runat="server"
TargetControlID ="iAdd1"
PopupControlID= "Panel1" Position="Botto m" OffsetY="10" />

.cs

protected void rptAvailablePro ducts_ItemComma nd(object source,
RepeaterCommand EventArgs 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
2792
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
7181
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 adding a java script for the button. But, useless.. Please help! Thank you
6
3854
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 link would be in a nav area and be something like "update". It would send the user to the main page and execute the stored procedure associated with the update functionality. I'm new to this area of .NET and would appreciate any suggestions,...
1
1272
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
4074
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 to connect to SQL server and update tables but I don't know how to close browser window after that. The SQL server part is on the server side, closing window is on client side.
8
3879
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 TABLE!?! When I move the button outside the table, it works just fine. Inside the table, it doesn't. What gives?
5
1964
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 few controls that ive copied in from another asp.net page that i built within visual studio. The problem is that the asp:button does not fir an event and therefore my code behind it wont work. The page load event is firing correctly so i think the...
3
1975
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 .aspx page and that data sent back is placed in a hidden textbox for processing when the form posts back from the asp:button (the same button that called the ShowModalDialog windows, calls the window and then postsback). This works fine.
8
17552
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" EnableViewState="False" CausesValidation="False" /> the btnSearchByName_Click event fires the second time the button is clicked but not the first. Is there something I'm missing on getting the thing to fire the first time it's clicked instead...
0
8305
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8726
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8503
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8603
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7320
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4301
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2726
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1944
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1604
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.