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

Itemcommand and Datalist problem

Hi there,
The OnItemCommand in my datalist is acting very weirdly,
the first time the page is loaded(or anything on the
datalist is clicked for the first time) its firing only
once, but after that its firing twice. I have no idea why,
Any help would be really appreciated. Thanks in advance

Note:
I am using AutoEventWireup="true",but also checking for
Page.Ispostback in my Page_Load.
I am not setting up EnableViewState=True in my datalist.

Thanks
Kenneth
Nov 18 '05 #1
3 1855
Hi,

The MSDN documentation recommends not setting
AutoEventWireup to true: "If you do set AutoEventWireup to true, Visual
Studio will generate code to bind the events and the page framework will
automatically call events based on their names. This can result in the
same event code being called twice when the page runs. As a consequence,
you should always leave AutoEventWireup set to false when working in
Visual Studio."
(
http://msdn.microsoft.com/library/de.../en-us/vbcon/h
tml/vbconWebFormsEventModel.asp )

by the way I try it with simple form (vb,c#) and didn’t get the behavior
you mention.

Natty Gur[MVP]

blog : http://weblogs.asp.net/ngur
Mobile: +972-(0)58-888377
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 18 '05 #2
Thanks for your reply, i actually changed the
autoeventwireup to false.,but its still doing it?

-K
-----Original Message-----
Hi,

The MSDN documentation recommends not setting
AutoEventWireup to true: "If you do set AutoEventWireup to true, VisualStudio will generate code to bind the events and the page framework willautomatically call events based on their names. This can result in thesame event code being called twice when the page runs. As a consequence,you should always leave AutoEventWireup set to false when working inVisual Studio."
(
http://msdn.microsoft.com/library/default.asp? url=/library/en-us/vbcon/html/vbconWebFormsEventModel.asp )

by the way I try it with simple form (vb,c#) and didn't get the behavioryou mention.

Natty Gur[MVP]

blog : http://weblogs.asp.net/ngur
Mobile: +972-(0)58-888377
*** Sent via Developersdex http://www.developersdex.com ***Don't just participate in USENET...get rewarded for it!
.

Nov 18 '05 #3
Can you e-mail me a sample solution.

Natty Gur[MVP]

blog : http://weblogs.asp.net/ngur
Mobile: +972-(0)58-888377
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 18 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: julk | last post by:
ok im new to C# so please help. i know it is simple but hey im a rooke. the problme i am having is that i drag a DataList control into my form (webpage-.aspx) then i got o the HTML side of the...
0
by: Fabrizio | last post by:
HI, does anybody know why when i create a datalist and load templates from an external file or using the Itemplate class, is not possible to use the findcontrol method on the ItemDataBound event or...
0
by: caldera | last post by:
Hi, I have a datalist, and in this datalist I have link button. I want to databind of the link button access key. But I have following error message. Other than access key value can be binded....
2
by: Arsalan | last post by:
Well, suppose i have couple of controls in datalist and one of them is link button control how do i invoke link button controls click method in the datalist ??? Suppose link button control...
1
by: David | last post by:
Hi, This one appears a little strange to me. Here is the scenario. I load a datalist the first time a page is run. The page has a !IsPostback and the datalist gets loaded at this point. I...
0
by: Savas Ates | last post by:
/////////////////ASPX///////////////////// <asp:DataList id="DataList1" runat="server"> <ItemTemplate> <table> <tr> <td> <%# DataBinder.Eval(Container, "DataItem.CI_Billing_Email")%>
0
by: Savas Ates | last post by:
I have a simple Data list control in my user control. When I run my main page and i use response.write to see grid query it writes 2 times. I checked my query results it is true. My datalist doesnt...
1
by: Brock | last post by:
Thanks in advance... (you can see a screenshot of what my form looks like currently at http://www.juggernautical.com/DataGrid.jpg - the Datalist is super-imposed in 'design view' but the DataGrid...
1
by: lisles | last post by:
i have a datalist that displays the titles of events.When i click a title i want to display the event details like date,venue,description... outside the datalist this is my code: ...
1
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.