473,946 Members | 10,132 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to show confirm box on textChanged event of text box in ItemTemplate of gridview

1 New Member
I've used textbox in ItemTemplate of gridview. I need a confirm box on textChanged event of the respective text box. If user confirms as Ok/Yes then continue with some code else if user clicks on Cancel/No then do some other action.
I've tried using:
Expand|Select|Wrap|Line Numbers
  1.   Page page = HttpContext.Current.Handler as Page;
  2.                     ScriptManager.RegisterClientScriptBlock(page, page.GetType(), "key2", "confirm('Do you want to update?');", true);
But I was not able to achieve desired output.
Plz' Help me with this code.
Jun 18 '10 #1
1 3490
Frinavale
9,735 Recognized Expert Moderator Expert
To prevent a postback to the server return False to the client-side (JavaScript) "onclick" event.

Try this:
Expand|Select|Wrap|Line Numbers
  1.  Page page = HttpContext.Current.Handler as Page;
  2.                     ScriptManager.RegisterClientScriptBlock(page, page.GetType(), "key2", "return confirm('Do you want to update?');", true);
-Frinny
Jun 21 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
2948
by: Fabrício de Novaes Kucinskis | last post by:
Hi all, I have a combobox control, in wich I put an autocomplete code. This code is in the TextChanged event, but when this event fires, the Text property isn't updated yet. For example, if the Text property is "Foo" and I press the letter "d", the Text property when the TextChanged event runs is "Foo". Only after the TextChanged event be processed, the KeyDown, KeyUp and KeyPress events fires and update the Text property.
2
3828
by: jbsound | last post by:
I have been banging my head against this one and I'm sure I'm missing something: Got a WinForms app in VB.NET with controls bound to a dataset. For the sake of this discussion, let's use just one text box control. When the user makes changes, the first character change in the text box will not set the underlying DataSet.HasChanges to true. Only the subsequent character change sets the DataSet.HasChanges to true. Why is that? More...
1
4593
by: Samuel Chan | last post by:
I used the textchanged event of textbox and set the autopostback property to true. The textchanged event should fire when the content of the textbox is changed and user tab out of the textbox control. However, textchanged event fires whenever there is a postback, even when I click a button that send postback. Can anybody tell we what change I should make so that textchanged event only fire when the content is changed?
0
1371
by: gaurav | last post by:
hi, I have a problem, How do i use TextChanged Event by clicking on Button. When i changed the text in text box and moving the focus from there then it is working but i have one calender popup button, what i want is when i click on that button and remove the focus from tht button by hitting Tab the TextChanged Event should work.
2
3026
by: gaurav | last post by:
hi, I have a problem, How do i use TextChanged Event by clicking on Button. When i changed the text in text box and moving the focus from there then it is working but i have one calender popup button, what i want is when i click on that button and remove the focus from tht button by hitting Tab the TextChanged Event should work.
3
5195
by: Adriana Camargo | last post by:
Hi I have to change automatically the text inside a textbox. I need to add thousand separator when I am writting in the textbox. I am using TextChanged event and when I insert a new number, i have a function that formats the complete text with thousand separator. For example, if textbox1 content is 1,234 and i added a number 5 after number 1, the result must be 15,234.
3
2630
by: Jerry Spence1 | last post by:
I would have thought that VB.Net would have improved the situation whereby it doesn't know the difference between the text changing due to the operator and text changing programmatically. I wonder why it didn't have two events for this. The only work around I can find is setting global variables or the .TAG property on mouse down and up events. Very messy. Is there another way? -Jerry
2
2337
by: pvdg42 | last post by:
Working on a web project (academic example) for a beginning VB class where there are four text boxes, each to hold four characters. I want focus to shift automatically to the next text box when the user has entered the 4th character in a given text box. I'm trying to use the TextChanged event to make this happen, but it appears as if the TextChanged event never fires? I thought it would fire each time the user entered a new character so...
8
3488
by: Zytan | last post by:
TextChanged is only called when the user modifes a control's text, not if the program does. How can I make it be called when the program modifies the text? Zytan
5
5255
by: S_K | last post by:
This is a weird problem.. I have a page with a textbox and a button (along with a bunch of other stuff). Both the textbox and the button have their SEPERATE events defined for the textchanged and click events. When I change the text in the textbox the textchanged event is called as expected. But the button click event is also called!? Whats with that?!
0
9981
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
11153
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...
0
9886
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...
1
8253
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
7426
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();...
0
6112
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
6331
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4941
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
3
3541
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.