473,503 Members | 1,671 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

VB.NET Web-App: Inside webgrid control for any button the coding is executed twice

49 New Member
hi

i have a webgrid control and i have used template columns to display data from the database in the webgrid.
But when i use edit,update,cancel and any buttons inside webgrid ,it is executed twice and because of this on second time execution i m getting error.

Can ayone Help
Dec 13 '07 #1
14 3025
radcaesar
759 Recognized Expert Contributor
What is the error message you got ?

Is it a buttoncolumn or templatecolumn ?

Change the autoeventwirup to false and try.

If not RE me.
Dec 13 '07 #2
baburk
111 New Member
To delete row use javascript
Expand|Select|Wrap|Line Numbers
  1.         function CellButtonClick(gridId, cellId) 
  2.         {
  3.             var Row = igtbl_getRowById(cellId);
  4.             Row.deleteRow();
  5.         }
In <ClientSideEvents ................../>

Add this to call the javascript

ClickCellButtonHandler="CellButtonClick"


After row deleted

<itgbl:UltraWebGrid OnDeleteRow = "" <-- Event Fires.

Here you handle what you want
Dec 13 '07 #3
durga2005
49 New Member
To delete row use javascript

function CellButtonClick(gridId, cellId)
{
var Row = igtbl_getRowById(cellId);
Row.deleteRow();
}

In <ClientSideEvents ................../>

Add this to call the javascript

ClickCellButtonHandler="CellButtonClick"


After row deleted

<itgbl:UltraWebGrid OnDeleteRow = "" <-- Event Fires.

Here you handle what you want


hi

i have used vb coding
Expand|Select|Wrap|Line Numbers
  1. Protected Sub wgLanguages_DeletingCommand(ByVal sender As Object, ByVal e As C1.Web.C1WebGrid.C1DeletingCommandEventArgs) Handles wgLanguages.DeletingCommand  
  2. Dim id As Integer
  3.         id = WebGrid1.DataKeys.Item(e.Item.ItemIndex)
  4.         Dim strDelete As String
  5.         strDelete = "Delete from toys where ID=" + id.ToString
  6.         Dim delcmd As SqlCommand
  7.         delcmd = New SqlCommand(strDelete, conn)
  8.         Try
  9.             conn.Open()
  10.             delcmd.ExecuteNonQuery()
  11.             conn.Close()
  12.             bindDataGrid()
  13.         Catch ex As Exception
  14.             MsgBox(ex.Message)
  15.         End Try
  16. End sub
Dec 13 '07 #4
durga2005
49 New Member
What is the error message you got ?

Is it a buttoncolumn or templatecolumn ?

Change the autoeventwirup to false and try.

If not RE me.


hi

its a template column
Dec 13 '07 #5
durga2005
49 New Member
What is the error message you got ?

Is it a buttoncolumn or templatecolumn ?

Change the autoeventwirup to false and try.

If not RE me.

since every time i click ,two times it is getting executed.
Actually while deleting , on first time execution it is deleted
but on second time execution i m getting error
Dec 13 '07 #6
radcaesar
759 Recognized Expert Contributor
Remove this lines in your aspx declaration page and try

OnDeleteCommand="xxx"
OnItemDataBound="xxx"
Dec 13 '07 #7
durga2005
49 New Member
Remove this lines in your aspx declaration page and try

OnDeleteCommand="xxx"
OnItemDataBound="xxx"


hi
if i delete that how that event will fire
Dec 13 '07 #8
durga2005
49 New Member
Remove this lines in your aspx declaration page and try

OnDeleteCommand="xxx"
OnItemDataBound="xxx"

hi

great .its working now

but i could not understand how its working.can you explain
Dec 13 '07 #9
radcaesar
759 Recognized Expert Contributor
Note the first line of ur method, u wrote the functionality in DeletingCommand and then u have this event handler for DeleteCommand.
Dec 13 '07 #10
durga2005
49 New Member
Note the first line of ur method, u wrote the functionality in DeletingCommand and then u have this event handler for DeleteCommand.

hi

but still i cant understand.please can you explain clearly
Dec 13 '07 #11
durga2005
49 New Member
Note the first line of ur method, u wrote the functionality in DeletingCommand and then u have this event handler for DeleteCommand.

hi

but still i cant understand.please can you explain clearly
Dec 13 '07 #12
radcaesar
759 Recognized Expert Contributor
Its because of AutoEventwireup. What u set autoeventwireup in ur code ? true/false ?
Dec 13 '07 #13
durga2005
49 New Member
Its because of AutoEventwireup. What u set autoeventwireup in ur code ? true/false ?

i didnt use that property
Dec 14 '07 #14
durga2005
49 New Member
Its because of AutoEventwireup. What u set autoeventwireup in ur code ? true/false ?

it is set to false.but i didnt set that
it has been set automatically
Dec 14 '07 #15

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

Similar topics

0
2517
by: Phillip J. Eby | last post by:
PEP: 333 Title: Python Web Server Gateway Interface v1.0 Version: $Revision: 1.1 $ Last-Modified: $Date: 2004/08/27 17:30:09 $ Author: Phillip J. Eby <pje at telecommunity.com> Discussions-To:...
0
5587
by: Mike | last post by:
Sites using thumbnail preview for world wide web file navigation and searching. Below are list of sites that are either researching or providing thumbnail preview images for online web...
9
2970
by: Marina Anufreichik | last post by:
Hi, After deploymnet web application on web server I can access page on local machine and login fine but when I'm trying to access web site from remote machine I can see login page, but when I'm...
2
528
by: PatrickSA | last post by:
Hi, Am new to web services, so apologies for the basic nature of the question - and apologies in advance if this is the wrong newsgroup. We're building a new web service and I'm looking around...
8
3120
by: John Baker | last post by:
Hi: I am URGENTLY in need of some book or web site OR tool that will help me integrate a relatively simple access application into a web page or pages. This is a time recording system (by...
0
2081
by: Erick Lopez | last post by:
When I send my web page to browser in ouput windows recibe this message and the web page the error BC32400 Please Help me Auto-attach to process ' aspnet_wp.exe' on machine 'TABLET'...
2
3363
by: Jeff | last post by:
Hey asp.net 2.0 My asp.net 2.0 project has got a assembly load problem: Some of my web.config settings: <membership defaultProvider="AH_MembershipProvider" userIsOnlineTimeWindow="15">
3
13760
by: =?Utf-8?B?RGFuZGFuIFpoYW5n?= | last post by:
Now I have a web application, a web service and a SQL Server database. The Web application will invoke the web service, the web service invokes the SQL Server stored procedure. I let the web...
20
6706
by: =?Utf-8?B?cmtibmFpcg==?= | last post by:
I was executing the steps given in http://suppor.microsoft.com/kb/308359 for testing a sample web service application. However, the following line gives a compilation error: localhost.Service1...
2
7387
by: =?Utf-8?B?YW5vbg==?= | last post by:
I am not sure if this is the right forum. Environment : Windows server 2008, IIS 7.0 I get the 'Could not load the file or assembly 'blowery.web.httpCompress' or one of its dependencies. The...
0
7280
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,...
0
7332
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...
1
6991
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...
1
5014
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...
0
4673
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...
0
3167
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...
0
3154
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1512
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 ...
0
382
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...

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.