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

Defaultbutton inside detailsview- best practise?

Hi,

I've been trying different ways of getting an insert button within a
detailsview control to be the default button when the return key is pressed.

Using a panel and itemtemplates I get the exception "{"The DefaultButton
of '' must be the ID of a control of type IButtonControl."} - why it
thinks I'm referencing ''? Is it a scope issue because the button is
within the itemtemplate?

an alternative was just sticking with a commandbutton, and
programmatically assigning the forms' default button (via the
masterpage). However this relied on reading the source, getting the
client name (e.g. ctl108) and including that in the code.. surely not an
ideal solution (not sure how arbitrary the control name is, but it's
changed a few times in my testing)

Is there a 'proper' solution I've overlooked?
any tips?

cheers,
Chris
Dec 5 '06 #1
1 2190
Not Me wrote:
I've been trying different ways of getting an insert button within a
detailsview control to be the default button when the return key is
pressed.

Using a panel and itemtemplates I get the exception "{"The DefaultButton
of '' must be the ID of a control of type IButtonControl."} - why it
thinks I'm referencing ''? Is it a scope issue because the button is
within the itemtemplate?

an alternative was just sticking with a commandbutton, and
programmatically assigning the forms' default button (via the
masterpage). However this relied on reading the source, getting the
client name (e.g. ctl108) and including that in the code.. surely not an
ideal solution (not sure how arbitrary the control name is, but it's
changed a few times in my testing)
For google groups, if noone else ;)

managed a 'fix' by using usesubmitbehavior=false on the buttons I didn't
want to fire when return is pressed. seems ok so far..

cheers,
Chris
Dec 5 '06 #2

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

Similar topics

3
by: chrisn | last post by:
Hi, (Using ASP.Net 2.0) I have a wizard control inside a detailsview control. When I attempt to call the InsertItem method on the DetailsView I get an error "ObjectDataSource...
0
by: Evert Wiesenekker | last post by:
I have a mail page with a send button containing three validators (2 required val. and 1 expression val.). The masterpage contains 3 imagebuttons. Now when I press enter the first time the...
7
by: Tim_Mac | last post by:
this is a re-post of an earlier message. i'm posting it under my MSDN alias for a better chance of reply :) when you press return in a multiline textbox, you expect to insert a newline. ...
3
by: John Mott | last post by:
Hi All, I'm trying to set the defaultbutton for a form to a button contained in a step template for a wizard control. This is the code in PreRender: switch (myWizard.ActiveStep.StepType) {...
4
by: Tim Mackey | last post by:
hi, asp.net 2. can anyone explain why this code does not work in firefox (2.0.0.1), but does work in IE 7. if you hit enter after typing something into the textbox, it should fire the Submit...
1
by: koraykazgan | last post by:
Hi all, I have a user control (ASCX). In that user control there is a panel, and inside that panel there is a textbox and a button. The panel has a DefaultButton property set, which is set to the...
1
by: gsauns | last post by:
I have a DetailsView inside a ModalPopup (using the AJAX ModalPopupExtender). I would like the user to have the ability to change the DetailsView's mode within the ModalPopup. But whenever I...
1
by: ajrock2000 | last post by:
I am using a DetailsView to display some data. I am basically getting a firstname, and lastname fields from a database (the database cannot be changed, nor the queries), and I must concatenate the ,...
3
by: Steve Prescott | last post by:
Hi Gang, I am trying to set the DefaultButton prop of a Panel so that when the user has entered his login credentials and strikes the < Enter key, he will be loggin in. The Button (btnLogin) is...
0
by: =?Utf-8?B?U2F2dm91bGlkaXMgSW9yZGFuaXM=?= | last post by:
In VS2008, I have a DetailsView control with a checkboxlist control inside its Edit template. (1) I want the checkboxlist to be dynamic and display only as many checkboxes as a user setting is...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
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...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
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)...
0
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
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
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....
0
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...

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.