473,657 Members | 2,380 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,can cel 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 3044
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 <ClientSideEven ts ............... .../>

Add this to call the javascript

ClickCellButton Handler="CellBu ttonClick"


After row deleted

<itgbl:UltraWeb Grid 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_getRowByI d(cellId);
Row.deleteRow() ;
}

In <ClientSideEven ts ............... .../>

Add this to call the javascript

ClickCellButton Handler="CellBu ttonClick"


After row deleted

<itgbl:UltraWeb Grid 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

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

Similar topics

0
2529
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: Python Web-SIG <web-sig at python.org> Status: Draft Type: Informational Content-Type: text/x-rst Created: 07-Dec-2003
0
5602
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 documents. Thumbnail previews are useful for web site navigation particularly in search engines and directories such as Google, Altavista and Yahoo. The preview images provide a portion of the content of the electronic file to aid in navigation.
9
2996
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 trying to login with correct credentials it give me error: Server Error in '/PDVMgr' Application. ----------------------------------------------------------------------------
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 for documentation on a number of issues, including versioning of web service interfaces... I've spent the last few hours looking through books, Google, MSDN and surprisingly I have found little or nothing that explains/shows how to practically...
8
3138
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 project), and I would be more than wiling to pull the updated database down from the Host using FTP on a monthly basis. Its just that I need to understand how to set it up on the web site itself. The Host supports SQL. Any direction you can give would...
0
2089
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' succeeded. 'DefaultDomain': Loaded 'c:\windows\microsoft.net\framework\v1.1.4322\mscorlib.dll', No symbols loaded. 'DefaultDomain': Loaded 'c:\windows\assembly\gac\system.web\1.0.5000.0__b03f5f7f11d50a3a\system.web.dll', No symbols loaded. 'DefaultDomain':...
2
3377
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
13789
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 service run in an application pool which runs under a domain user, this domain user has permissions of accessing database and the connection to database is trusted connection. All these work well. The web application will be used in internet (not...
20
6736
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 xxx = new localhost.Service1(); localhost is not recognized by the compiler.
2
7391
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 system cannot fond the file specified error. When I comment out the line in the web config file, I get the error on the line following that. I have all the dll files in the bin folder.
0
8825
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
8605
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...
0
7327
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
6164
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
5632
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
4152
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
4304
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1955
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1615
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.