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

Home Posts Topics Members FAQ

Problem with button click event handler

Hey guys, I'm doing something similar to the example below (c#
version):
http://samples.gotdotnet.com/quickst...s1.aspx&font=3[^]
Basically this sample has two different pages (cookies.aspx and
customize.aspx) . I'm implementing it in one page (i.e. when user click
the right choices from the drop down lists, and click subit button, it
should apply those properties and change the color, font size etc. Well
when I first run the page (ctrl+F5). And the very first time that I
select the properties from the lists, they get applied properly. Then
if I go back to the drop down and change, lets say the color and text
and hit submit again... it doesnt get applied and it needs the button
clicked twice (i.e except for the intial request when it works on one
click, you need the button to be clicked twice).

So it sounds like the initial GET request is working but when you
submit (that is post back) that's when its not behaving as expected.

Can someone please help...PLEASE NOTE in the original sample that you
can run from here(
http://samples.gotdotnet.com/quickst.../cookies1.aspx[^])
above that there are two pages and that could be causing this behaviour
since I only have one page but I just can't see where or how ????

Thanks for all your help
Tina

Jan 5 '07 #1
2 1231
Do you not have a dodgy

if Postback then

clause

Other than that, possibly investigate the requires postback proporty for
your button or investigate the Viewstate.

David

"technoGirl " wrote:
Hey guys, I'm doing something similar to the example below (c#
version):
http://samples.gotdotnet.com/quickst...s1.aspx&font=3[^]
Basically this sample has two different pages (cookies.aspx and
customize.aspx) . I'm implementing it in one page (i.e. when user click
the right choices from the drop down lists, and click subit button, it
should apply those properties and change the color, font size etc. Well
when I first run the page (ctrl+F5). And the very first time that I
select the properties from the lists, they get applied properly. Then
if I go back to the drop down and change, lets say the color and text
and hit submit again... it doesnt get applied and it needs the button
clicked twice (i.e except for the intial request when it works on one
click, you need the button to be clicked twice).

So it sounds like the initial GET request is working but when you
submit (that is post back) that's when its not behaving as expected.

Can someone please help...PLEASE NOTE in the original sample that you
can run from here(
http://samples.gotdotnet.com/quickst.../cookies1.aspx[^])
above that there are two pages and that could be causing this behaviour
since I only have one page but I just can't see where or how ????

Thanks for all your help
Tina

Jan 5 '07 #2
Hello Dave, I tried doing that, it doesn't effect anything. Probably
has something to do with the way events are getting fired. Did you look
at the example code I mentioned above. Please let me know if there's
anything that may come to your mind.

Thanks

On Jan 5, 12:30 am, W1ld0ne74 <W1ld0n...@hotm ail.comwrote:
Do you not have a dodgy

if Postback then

clause

Other than that, possibly investigate the requires postback proporty for
your button or investigate the Viewstate.

David

"technoGirl " wrote:
Hey guys, I'm doing something similar to the example below (c#
version):
http://samples.gotdotnet.com/quickst...s1.aspx&font=3[^]
Basically this sample has two different pages (cookies.aspx and
customize.aspx) . I'm implementing it in one page (i.e. when user click
the right choices from the drop down lists, and click subit button, it
should apply those properties and change the color, font size etc. Well
when I first run the page (ctrl+F5). And the very first time that I
select the properties from the lists, they get applied properly. Then
if I go back to the drop down and change, lets say the color and text
and hit submit again... it doesnt get applied and it needs the button
clicked twice (i.e except for the intial request when it works on one
click, you need the button to be clicked twice).
So it sounds like the initial GET request is working but when you
submit (that is post back) that's when its not behaving as expected.
Can someone please help...PLEASE NOTE in the original sample that you
can run from here(
http://samples.gotdotnet.com/quickst.../apps/cookies1...[^])
above that there are two pages and that could be causing this behaviour
since I only have one page but I just can't see where or how ????
Thanks for all your help
Tina- Hide quoted text -- Show quoted text -
Jan 5 '07 #3

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

Similar topics

0
272
by: Doug Holland | last post by:
Hi Ther I have an ASP.NET user control which contains a test panel defined as follows <asp:Panel ID="TestPanel" Runat="server" / In the OnInit method I designate an event handler to handle the user controls PreRender event and in the PreRender event handler I create a button as follows Button _Button = new Button() _Button.ID = "PRButton"
5
3038
by: Alastair Anderson | last post by:
I have created a very simple form with which I would like to update a single value in a single row of a database as a proof of concept. The relevant parts of the form are a DBWebTextBox (which is hooked into a column ORGANISATION.SHORT_NAME) and a Button which I am using as a submit button.
3
1533
by: Michael Johnson Jr. | last post by:
The problem is the following pseudo code causes you need to click buttons twice to get event. This is notable via debugging and single stepping. I can't seem to quite figure out how to do events in ASP where they need to rerender the page. I been banging my head on this for 4 days now.
1
3540
by: Thanks | last post by:
I have a routine that is called on Page_Init. It retrieves folder records from a database which I display as Link Buttons in a table cell. I set the table cell's bgcolor to a default color (say black for example). I am dynamically creating the LinkButton controls and adding them into the table cell and I've also hooked up an event handler for each LinkButton's Click event. This all works fine. Now in the Link Button's Click event...
2
2918
by: R Duke | last post by:
I have tried everything I can think of to change the visible property of a design time created control from a dynamically created control's command event handler. Here is the scenario. I have a WebForm with some textboxes, dropdownlists, a panel, imagebutton and so on. When I click on the image button (which was created at design time) I dynamically build a table. In each of row of that new table I put several cells and one cell...
4
2124
by: Jeff User | last post by:
Hi I tryed to solve this problem over in the framework.asp group, but still am having trouble. Hope someone here can help. using .net 1.1, VS 2003 and C# I have an asp.DataGrid control with a Delete button on the end of each row. I am unable to gain access to the event when the button is clicked. I don't fully understand how the click gets connected to the C# code,
5
1130
by: phil | last post by:
Hi, Is this a javascript or asp.net problem? When the button is clicked, the server event in the code-behind must be executed if the user clicked on "OK" of the Confirm and not executed if clicked on "Cancel". I tried two ways: the first here below works perfect but the second way ALWAYS executes the server event!! Can anybody explain me why? Thanks
4
1939
by: asad.naeem | last post by:
hi to all this is the problem about inheritence. I have designed a form with some essential controls which are required for every form which will inherited from it. for example i have Button1 on parent form and this button is visible to me on inherited form. The problem is: I have written a click event of the button1 on both of the forms. tell me the way if i click the button on inherited form only parents' click event will be called and...
5
2201
by: Slim | last post by:
i have a simple page, with one button button1. when click it creates a new button button 2 and adds a event handler to it. but when button 2 is clicked nothing happens, why? Partial Class test_buttons Inherits System.Web.UI.Page Dim bt2 As Button
43
2356
by: John | last post by:
Hi This .net is driving me crazy!! In VB6 I had a type which contained a couple of multi-dimentional arrays which i used to create and read records: Type AAA : Array1(10,10,2) as Integer
0
8315
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
8829
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8734
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
8508
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
8608
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...
1
6172
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5633
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
2733
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
1627
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.