473,386 Members | 1,795 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,386 software developers and data experts.

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

1
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 3467
Frinavale
9,735 Expert Mod 8TB
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
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...
2
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...
1
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...
0
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...
2
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...
3
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...
3
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...
2
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...
8
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
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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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,...

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.