Hello,
Controls on webpage:
- Datagrid
- TextBox
Datagrid has Delete button:
<asp:TemplateColumn HeaderText="Borrar">
<HeaderStyle Width="10%"></HeaderStyle>
<ItemStyle HorizontalAlign="Center"></ItemStyle>
<ItemTemplate>
<asp:ImageButton id="btnDelete" runat="server"
CommandName="Delete"></asp:ImageButton>
</ItemTemplate>
</asp:TemplateColumn>
At function MyDatagrid_ItemCreated , I add attributes to that Delete
button. So, when the user click on Delete button, then it's showed a
confirmation message before to proceed to delete the record.
Private Sub MyDatagrid_ItemCreated(ByVal sender As System.Object, ByVal
e As System.Web.UI.WebControls.DataGridItemEventArgs) Handles
MyDatagrid.ItemCreated
If (e.Item.ItemIndex -1) Then
Dim mydeletebutton As TableCell
mydeletebutton = e.Item.Cells(0)
mydeletebutton.Attributes.Add("onclick", "return alert('Are
you sure you will delete record...?');")
End If
End Sub
Now my problem is that the user has to write on the TextBox. When user
focus on the TextBox and then press ENTER, then it is showed windows
message: 'Are you sure you will delete record...?'.
I tried to put hide buttons on the webpage, but no success.
Allways when the user hit ENTER on the TextBox, the message appears on
screen.
This function is never raised:
Private Sub MyTextBox_TextChanged(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles MyTextBox.TextChanged
' Some code goes here ....
End Sub
How could I solve that?
Thank you! 1 5387
MyTextBox_TextChanged will not fire until postback as this is a server
side event.
when the user is pressing enter, it is firing the clientside onclick
event of the delete button, which is why the alert box is showing.
one thing is that if you don't want it to behave like this, the delete
button should not be receiving focus.. try setting the focus to the
default button you want to react to on enter.
hope this helps
~kcf
On Nov 17, 10:40 am, "Big George" <jbet...@gmail.comwrote:
Hello,
Controls on webpage:
- Datagrid
- TextBox
Datagrid has Delete button:
<asp:TemplateColumn HeaderText="Borrar">
<HeaderStyle Width="10%"></HeaderStyle>
<ItemStyle HorizontalAlign="Center"></ItemStyle>
<ItemTemplate>
<asp:ImageButton id="btnDelete" runat="server"
CommandName="Delete"></asp:ImageButton>
</ItemTemplate>
</asp:TemplateColumn>
At function MyDatagrid_ItemCreated , I add attributes to that Delete
button. So, when the user click on Delete button, then it's showed a
confirmation message before to proceed to delete the record.
Private Sub MyDatagrid_ItemCreated(ByVal sender As System.Object, ByVal
e As System.Web.UI.WebControls.DataGridItemEventArgs) Handles
MyDatagrid.ItemCreated
If (e.Item.ItemIndex -1) Then
Dim mydeletebutton As TableCell
mydeletebutton = e.Item.Cells(0)
mydeletebutton.Attributes.Add("onclick", "return alert('Are
you sure you will delete record...?');")
End If
End Sub
Now my problem is that the user has to write on the TextBox. When user
focus on the TextBox and then press ENTER, then it is showed windows
message: 'Are you sure you will delete record...?'.
I tried to put hide buttons on the webpage, but no success.
Allways when the user hit ENTER on the TextBox, the message appears on
screen.
This function is never raised:
Private Sub MyTextBox_TextChanged(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles MyTextBox.TextChanged
' Some code goes here ....
End Sub
How could I solve that?
Thank you!
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Eric Smith |
last post by:
I'm writing a DTD for a simulator to save the state of the simulated
machine, such as register and memory contents. In this particular
application, it is not expected that the generated XML will...
|
by: Colin Cogle |
last post by:
-------
Line 47, column 8: there is no attribute "id"
<DIV id="LeftNavigation" style="position:absolute; left:8px; top:6px;
width:200p
-------
Line 47, column 31: there is no attribute "style"...
|
by: nicolas.sanguinetti |
last post by:
Hi, I want to add custom attributes to my xhtml documents to use with
my DOM scripts.
For example, I want to have some tags -say, the <h1>- have an attribute
and a .
The thing is that I also...
|
by: Bret Pehrson |
last post by:
I've converted a non-trivial C++ library to managed, and get the following
unhelpful linker error:
Assignment.obj : error LNK2022: metadata operation failed (80131195) : Custom
attributes are...
|
by: Brian |
last post by:
NOTE ALSO POSTED IN
microsoft.public.dotnet.framework.aspnet.buildingcontrols
I have solved most of my Server Control Collection property issues.
I wrote an HTML page that describes all of the...
|
by: Samuel M. Smith |
last post by:
I have been playing around with a subclass of dict wrt a recipe for
setting dict items using attribute syntax.
The dict class has some read only attributes that generate an
exception if I try to...
|
by: sagar |
last post by:
Hello everyone,
I am developing a AJAX based IM application. I use javascript to
dynamically generated small windows using nested <div> within the
web-page.
I use the following ways to set...
|
by: Nathan Sokalski |
last post by:
I add several JavaScript events (onchange, onkeypress, etc.) to Controls
using the Add method of the Attributes collection. However, if the
JavaScript code contains certain characters, such as & or...
|
by: Rafe |
last post by:
Hi,
I'm working within an application (making a lot of wrappers), but the
application is not case sensitive. For example, Typing obj.name,
obj.Name, or even object.naMe is all fine (as far as...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
by: PapaRatzi |
last post by:
Hello,
I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: Defcon1945 |
last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
|
by: Shællîpôpï 09 |
last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
|
by: af34tf |
last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
| | |