473,753 Members | 7,291 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Controls inside EditTemplate cause editing to end

I have a DataList control with an EditTemplate. Three of the controls in
this template include a Calendar, a Button with CommandName="up date", and a
Button with CommandName="ca ncel". Whenever I click one of these controls,
the DataList replaces the EditTemplate with the ItemTemplate. I think this
is because the method I wrote which performs the databinding is getting
called, but I don't know why or where it is getting called from. It does not
get called from my Page_Load method and I do not have an ItemCommand event
handler, so I don't know where to start testing for it. I tested to see if
my UpdateCommand event is getting called when I click the Button with
CommandName="up date" by assigning some text to a Label control, so I know
that it is never getting called. What could be causing my problem? Any help
would be appreciated. Thanks.
--
Nathan Sokalski
nj********@hotm ail.com
http://www.nathansokalski.com/
Nov 19 '05
10 1498
I am running Windows XP Pro (and I do know how to use IIS on it), however, I
cannot set the project up on it for multiple reasons. First, the project
uses an Oracle DB which I do not have. Second, because it is a group project
as part of a temp job (it is not a personal site), it needs to be running on
the company's server and be available to my partner in the job (we are
students who got hired to continue a class project from the Spring 2005
semester). I have been looking really closely at my code, but because this
is my first time doing inline editing I am trying to get a little bit of
help from someone who has done it before.
--
Nathan Sokalski
nj********@hotm ail.com
http://www.nathansokalski.com/

"S. Justin Gengo" <sjgengo@[no_spam_please]aboutfortunate. com> wrote in
message news:ur******** ******@TK2MSFTN GP12.phx.gbl...
Hmmmm,

That's going to make it hard to identify...

What type of system are you on? I develop all my code on a Windows XP Pro
system running iis locally, then I deploy the code to a development server
for testing, Staging for more real-world testing, and finally production.

Can you set up your project to run locally and debug there?

Otherwise you're going to have to just really look at your code
carefully...

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"Nathan Sokalski" <nj********@hot mail.com> wrote in message
news:%2******** ********@TK2MSF TNGP10.phx.gbl. ..
I would like to set a breakpoint in Visual Studio to find the undesired
call, but unfortunately the site is on a remote server and according to
the person in charge of the server (who is also the person who taught me
ASP.NET) the server's ability to do debugging remotely has been turned
off.
--
Nathan Sokalski
nj********@hotm ail.com
http://www.nathansokalski.com/

"S. Justin Gengo" <sjgengo@[no_spam_please]aboutfortunate. com> wrote in
message news:O0******** ******@TK2MSFTN GP10.phx.gbl...
Nathan,

You've got the solution at hand. You need to identify the undesired
call(s) to RefreshEvents() and put the If Then there.

That's really the only way to do it. If you're using Visual Studio now
is the time to set a breakpoint and see exactly what your code is
doing...

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"Nathan Sokalski" <nj********@hot mail.com> wrote in message
news:%2******** ********@TK2MSF TNGP09.phx.gbl. ..
I think you misunderstood what I meant. If I were to use the If Then
like you said, the If Then would have to go inside my RefreshEvents()
method, since that is the only place that I know is getting called
during the "undesired" databinding. However, if I did that, it would
affect the databinding when I don't want it to just like when I had the
problem before. If I knew where the "undesired" databinding was being
called from (in other words, what method calls RefreshEvents() when I
don't want it to) I could put the If Then there, but I don't know where
that is. Another solution, if it exists, would be to use an If Then with
a condition based on what method was calling it. Any ideas? Thanks.
--
Nathan Sokalski
nj********@hotm ail.com
http://www.nathansokalski.com/

"S. Justin Gengo" <sjgengo@[no_spam_please]aboutfortunate. com> wrote in
message news:uF******** ******@TK2MSFTN GP11.phx.gbl...
> Leave the if then and then call the binding code when you need to from
> those methods.
>
> --
> Sincerely,
>
> S. Justin Gengo, MCP
> Web Developer / Programmer
>
> www.aboutfortunate.com
>
> "Out of chaos comes order."
> Nietzsche
> "Nathan Sokalski" <nj********@hot mail.com> wrote in message
> news:O6******** *****@TK2MSFTNG P15.phx.gbl...
>> My DataList's EnableViewState property is set to True. I have tried
>> wrapping my binding code in an If Not IsPostBack Then statement like
>> you said, but that causes the binding to not occur at other times
>> when it does need to happen. I have a method that contains my binding
>> code which I call in my Page_Init method as well as after I make any
>> changes to the database I use as my datasource. This method is as
>> follows:
>>
>> Private Sub RefreshEvents()
>>
>> Dim events As New DataSet
>>
>> Dim myconnection As New
>> OracleConnectio n(System.Config uration.Configu rationSettings. AppSettings("co nnectionString" ))
>>
>> Dim cmdselect As New OracleCommand(" SELECT * FROM eventlist WHERE
>> eventdate<TO_DA TE('" & Date.Now.ToShor tDateString() &
>> "','MM/DD/YYYY')", myconnection)
>>
>> Dim cmddelete As New OracleCommand(" ", myconnection)
>>
>> Dim eventsadapter As New OracleDataAdapt er(cmdselect)
>>
>> 'Delete any past events and the people who registered for them
>>
>> eventsadapter.F ill(events, "eventlist" )
>>
>> If events.Tables(" eventlist").Row s.Count <> 0 Then
>>
>> For Each pastevent As DataRow In events.Tables(" eventlist").Row s
>>
>> cmddelete.Comma ndText = "DELETE FROM registered WHERE eventid=" &
>> pastevent.Item( "eventid")
>>
>> myconnection.Op en()
>>
>> cmddelete.Execu teNonQuery()
>>
>> cmddelete.Comma ndText = "DELETE FROM eventlist WHERE eventid=" &
>> pastevent.Item( "eventid")
>>
>> cmddelete.Execu teNonQuery()
>>
>> myconnection.Cl ose()
>>
>> If pastevent.Item( "details") <> "" AndAlso
>> System.IO.File. Exists(Server.M apPath("eventde tails/" &
>> pastevent.Item( "details")) ) Then
>> System.IO.File. Delete(Server.M apPath("eventde tails/" &
>> pastevent.Item( "details")) )
>>
>> Next
>>
>> End If
>>
>> 'Fill DataSet with all remaining events
>>
>> events.Clear()
>>
>> cmdselect.Comma ndText = "SELECT * FROM eventlist ORDER BY eventdate"
>>
>> eventsadapter.S electCommand = cmdselect
>>
>> eventsadapter.F ill(events, "eventlist" )
>>
>> datEditEvents.D ataSource = events
>>
>> datEditEvents.D ataBind()
>>
>> ddlDeleteEvents .Items.Clear()
>>
>> For Each existevent As DataRow In events.Tables(" eventlist").Row s
>>
>> ddlDeleteEvents .Items.Add(New
>> ListItem(CDate( existevent("eve ntdate")).ToSho rtDateString() & " " &
>> existevent("eve ntname"), existevent("eve ntid")))
>>
>> Next
>>
>> End Sub
>>
>>
>> Any other ideas? If you would like to see any of the other code I
>> use, just let me know. Thanks.
>> --
>> Nathan Sokalski
>> nj********@hotm ail.com
>> http://www.nathansokalski.com/
>>
>> "S. Justin Gengo" <sjgengo@[no_spam_please]aboutfortunate. com> wrote
>> in message news:uX******** ******@tk2msftn gp13.phx.gbl...
>>> Nathan,
>>>
>>> Make certain that your DataList control has it's viewstate property
>>> set to true and then, wherever in your code you are binding the
>>> DataList, wrap that code in:
>>>
>>> If Not IsPostBack Then
>>> '---Bind your DataList here.
>>> End If
>>>
>>> I don't know exactly where you are doing your databinding, but from
>>> what you describe I think you have identified your problem
>>> correctly. Your DataList is getting re-bound on postback.
>>>
>>> By the way, please don't post to more than one newsgroup at a
>>> time...
>>>
>>>
>>> --
>>> Sincerely,
>>>
>>> S. Justin Gengo, MCP
>>> Web Developer / Programmer
>>>
>>> www.aboutfortunate.com
>>>
>>> "Out of chaos comes order."
>>> Nietzsche
>>> "Nathan Sokalski" <nj********@hot mail.com> wrote in message
>>> news:%2******** *******@TK2MSFT NGP15.phx.gbl.. .
>>>>I have a DataList control with an EditTemplate. Three of the
>>>>control s in this template include a Calendar, a Button with
>>>>Command Name="update", and a Button with CommandName="ca ncel".
>>>>Wheneve r I click one of these controls, the DataList replaces the
>>>>EditTem plate with the ItemTemplate. I think this is because the
>>>>metho d I wrote which performs the databinding is getting called, but
>>>>I don't know why or where it is getting called from. It does not get
>>>>calle d from my Page_Load method and I do not have an ItemCommand
>>>>event handler, so I don't know where to start testing for it. I
>>>>teste d to see if my UpdateCommand event is getting called when I
>>>>click the Button with CommandName="up date" by assigning some text to
>>>>a Label control, so I know that it is never getting called. What
>>>>could be causing my problem? Any help would be appreciated. Thanks.
>>>> --
>>>> Nathan Sokalski
>>>> nj********@hotm ail.com
>>>> http://www.nathansokalski.com/
>>>>
>>>
>>>
>>
>>
>
>



Nov 19 '05 #11

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

Similar topics

0
1727
by: Renato Neves | last post by:
My problem is simple, i have a datalist control with some controls inside of EditTemplate (the problem is the same in the DataGrid). I want to have access to this controls, using javascript, but i can't. How can i do this? <Code> <script language="javascript"> document.getElementById('<%=txt1.ClientID %>').value='test'; document.getElementById('<%=txt2.ClientID %>').value='test';
5
1332
by: Dranreb | last post by:
Hello, I use a template whereby my default page contains various user controls - i.e. "Header", "Footer", "Navigation", "Content". On some occaisions I'd like to manipulate the other controls from the content control, without refreshing the default page. Currently, to change the content I refresh the default page by doing a response.redirect and referencing the new content page in the querystring. My default page includes the...
3
1882
by: Scott at Cedar Creek | last post by:
Can I put a repeater inside a FormView? Can I put a repeater inside that repeater? If so, what happens when the FormView.Mode is "Edit?" When they click the EDIT button is my repeater data also saved? Or do I have to code that manually? Thanks in advance, Scott
0
2130
by: JohnyStyles | last post by:
I have a templated user control which looks like this: ----------------------------------------------------------------- <uc:MyUserControl runat=server> <TemplateProperty> </TemplateProperty> </uc:MyUserControl> -----------------------------------------------------------------
15
2193
by: Arpan | last post by:
Consider the following code which retrieves data from a SQL Server 2005 DB table & displays it in a DataGrid: <script runat="server"> Sub Page_Load(ByVal obj As Object, ByVal ea As EventArgs) Dim dSet As DataSet Dim sqlConn As SqlConnection Dim sqlDapter As SqlDataAdapter sqlConn = New SqlConnection("Data Source=AD\SQLEXPRESS;Initial
4
15025
by: John Dalberg | last post by:
I am looking at a problem which is preventing my code to get a reference to any asp control inside a div section which has a runat=server attribute. This can be reproduced in a simple test: Create a blank webform and add this html inside the <formsection: <div id="myDiv" runat=server> <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox> </div> In the code behind, add this code in the page_load event handler:
4
2698
by: TS | last post by:
Steven, i lost this message conversation from outlook express and made a post online (see last one on this page). Please answer it as it hasn't been yet. thanks The clientID of our controls have become very long since we have 2 master pages that our pages inherit from. Some team members at
1
2167
by: Aamir Ghanchi | last post by:
Like thr subject line says. I get no intellisense in VS 2005 as well as get the compilation message "The name 'ddlCourse1' does not exist in the current context". Is there a way to have access to the controls being validated in the EditTemplate of gridview. The CustomValidator control itself is outside the gridview, but I have tried putting it in a template column of gridview alongside with Edit/ Update linked buttons but to no avail. ...
0
879
by: =?Utf-8?B?U2F2dm91bGlkaXMgSW9yZGFuaXM=?= | last post by:
How can I display a different control for my in my table, inside an ItemTemplate or EditTemplate, depending on the value of another column, the , which has values like 'STRING', 'INTEGER', 'BOOLEAN', 'DECIMAL', 'DATETIME', 'MONEY', 'SQL_LIST_VALUES'? That is, if the in a specific gridview row, has a value of 'BOOLEAN', then I want my to display a checkbox in ItemTemplate or EditTemplate and not a textbox. Also, when the is...
0
9072
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8896
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
9421
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8328
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
6869
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
6151
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
4771
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...
1
3395
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 we have to send another system
2
2872
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.