Saturday, 10 May 2008
|
| Access UserControl Gabriel 01:53:24 |
| | Hello,
I created a UserControl (MyUserControl.ascx). At design time I added this control the a page (MyPage.aspx). No problem when I execute the page I see it.
I'd like access to some method and properties from MyPage.aspx.cd (first form Page_load but may be others).
Could you tell me how to access the method of my UserControl ?
Regards,
=================================== This list is hosted by DevelopMentor® http://www.develop.com
View archives and manage your subscription(s) at http://discuss.develop.com
|
| Options | 1 answer | Add comment |
Friday, 9 May 2008
|
| Instance vs Static + Option Brady Kelly 18:44:03 |
| | I am busy with a new ConfigHelper class, and can't seem to decide on which approach to take. The class is responsible for adjusting the config table in two databases, control and test. My dilemma is whether I make ConfigHelper a static class, and tell it which database to access for each task, or use instance methods and have one instance for each database.
=================================== This list is hosted by DevelopMentor http://www.develop.com
View archives and manage your subscription(s) at http://discuss.develop.com
|
| Options | 2 answer | Add comment |
Tuesday, 6 May 2008
|
| Hook Control Host Container Messages Brady Kelly 13:50:12 |
| | I'm busy with a bar code reading retail app, and I would like to encapsulate the code that responds to bar code inputs in a Bar Code control / component / library. I use a special character string to prefix bar codes, so the UI knows to give the bar code field focus before the barcode is sent, and a tab to leave the barcode field after the whole barcode is received.
If I were to wrap the barcode field in a separate control, how could I delegate the responsibly of detecting the start-of-code string to this control, when it doesn't have focus and doesn't receive keystrokes. I'm thinking along the lines of it installing some sort of message hook in its parent control, and focussing itself when it sees its parent receive the start-of-code string, but I have no idea where to start.
=================================== This list is hosted by DevelopMentor http://www.develop.com
View archives and manage your subscription(s) at http://discuss.develop.com
|
| Options | Add comment |
Wednesday, 30 April 2008
|
| How to create flyout menu Steve Abaffy 20:21:32 |
| | How do you create flyout menus like the ones they have in Photoshop in a Windows form application. I want to have buttons and when you hold the mouse button on a button without releasing the button it would activate the flyout menu which would hold more buttons.
The only thing I have been able to find so far is for use on web pages.
Thanks
|
| Options | Add comment |
|
| Unsafe Assembly Permissions Brady Kelly 19:46:14 |
| | We're struggling to register an unsafe assembly on a development server. The message given is:
CREATE ASSEMBLY for assembly 'Pastel.Evolution' failed because assembly 'Pastel.Evolution' is not authorized for PERMISSION_SET
Now I remember running a grant, "USE Master GRANT EXTERNAL ACCESS ASSEMBLY TO [SERVERNAME\User]" on my server, but the target server doesn't use windows auth, and you can't grant rights to 'sa'. Any ideas on how we can allow ourselves to register an unsafe assmemly?
=================================== This list is hosted by DevelopMentor http://www.develop.com
View archives and manage your subscription(s) at http://discuss.develop.com
|
| Options | 1 answer | Add comment |
|
| Limit Rows in DataTable Brady Kelly 00:46:58 |
| | I have an application under test, where I iteratively reset an export batch and then run the export for different configurations. For major testing, I wish to test each config over the full monty, 70k documents exported, but for dev testing I like to keep the rows in each section down to 500. Last night in the interests of not breaking code, I was popping 'TOP 500' into each query, but I'm sure there is a better way. Any suggestions will be appreciated. I'm using a SqlDataAdapter to fill my DataTable objects.
=================================== This list is hosted by DevelopMentor http://www.develop.com
View archives and manage your subscription(s) at http://discuss.develop.com
|
| Options | 4 answer | Add comment |
Friday, 25 April 2008
|
| Simulating a Right Click Amit Bhatnagar 21:57:09 |
| | Hi All.
I have a touch screen application where there is a need to perform a right click to expose context menus etc. The app's main point of interaction is a "toolbar" of buttons at the bottom of the screen (think Mac OSX dock, or Gnome/KDE panel, etc), so I imagine sticking a Right Click button down there.
But how would this work? I imaging sending a WM_ message for right click, but if the user moves the cursor to the target of the right click, and then has to press a button on the toolbar, the cursor is no longer on the target and thus the right click message would happen on the Right Click button on the toolbar. Essentially what I am saying is that the cursor would move off the target object down to the toolbar button when the right click message would be sent.
How can I have a button that I can press to perform a right click without having the cursor move away from the target object?
The information contained in this e-mail message is PRIVATE. It may contain confidential information and may be legally privileged. It is intended for the exclusive use of the addressee(s). If you are not the intended recipient, you are hereby notified that any dissemination, distribution or reproduction of this communication is strictly prohibited. If the intended recipient(s) cannot be reached or if a transmission problem has occurred, please notify the sender immediately by return e-mail and destroy all copies of this message. Thank you.
|
| Options | 2 answer | Add comment |
Thursday, 24 April 2008
|
| Web Server Requirements Brady Kelly 20:27:07 |
| | What would be a minimum spec for a web server with very modest usage, i.e. about 20 concurrent users, and what would be a good spec, maybe looking at reserve capacity for growth to say 50 concurrent users? I don't know where to start looking, so I'm asking the web experts here.
=================================== This list is hosted by DevelopMentor http://www.develop.com
View archives and manage your subscription(s) at http://discuss.develop.com
|
| Options | 1 answer | Add comment |
|
| Settings Reverting Brady Kelly 12:24:54 |
| | I have a small application that uses Properties.Settings to store connection strings. My problem is that every now and again, the settings revert to defaults. I haven't been able to narrow it down yet, but long ago, when addressing this problem, I was advised to use the code below to prevent this happening due to version numbers changing, I think, but it doesn't work all the time, even without version numbers changing. I call UpgradeSettings first in the Load event.
private void UpgradeSettings()
{
if (Properties.Settings.Default.CallUpgrade)
{
Properties.Settings.Default.Upgrade();
Properties.Settings.Default.CallUpgrade = false;
}
}
=================================== This list is hosted by DevelopMentor http://www.develop.com
View archives and manage your subscription(s) at http://discuss.develop.com
|
| Options | Add comment |
Wednesday, 23 April 2008
|
| Checking for state's existence Mark Aurit 17:52:06 |
| | Where is the best place to test in asp.net apps that values placed in state still exist (the person walking away from their browser after logging in thing)? Putting the check in the masterpage seemed ideal, but the page events fire first, so that isn’t a lot of help. Should I put the validation into a base page inherited by each page? Or each page’s Page_Load event? There is a lot of expertise here, I would like to hear the best practices.
Thanks, Mark
=================================== This list is hosted by DevelopMentor® http://www.develop.com
View archives and manage your subscription(s) at http://discuss.develop.com
|
| Options | 12 answers | Add comment |
|
| StateServer Kris Shanmugam 08:47:49 |
| | We've been storing some audit data / site usage data by using the Session_End event to persist some session data in a database. We cannot do this when using a StateServer (out-of-proc) as this event is not available. Any ideas on possible solutions when using a StateServer?
Thanks, Kris
=================================== This list is hosted by DevelopMentor http://www.develop.com
View archives and manage your subscription(s) at http://discuss.develop.com
|
| Options | 3 answer | Add comment |
Tuesday, 22 April 2008
|
| SqlDateTime.Parse not culture sensitive? Mark Griffiths 13:22:21 |
| | The SqlDateTime.Parse() method does not seem to be honouring the current culture. I am in the UK and have checked that System.Globalization.CultureInfo.CurrentCulture is set to "en-GB". I'm sure everyone knows that in the UK we usually format our dates as dd/MM/yyyy. From the immediate window:
?DateTime.Parse("1/2/2002").ToString("dd-MMM-yyyy") "01-Feb-2002"
?SqlDateTime.Parse("1/2/2002").Value.ToString("dd-MMM-yyyy") "02-Jan-2002"
DateTime.Parse works as expected, but SqlDateTime assumes a US format when parsing the string.
Can anybody confirm this as a bug? or am I doing something wrong?
Mark
You can read messages from the DOTNET archive, unsubscribe from DOTNET, or subscribe to other DevelopMentor lists at http://discuss.develop.com.
|
| Options | 1 answer | Add comment |
Wednesday, 16 April 2008
|
| Funny with BackGroundWorker Brady Kelly 19:37:26 |
| | I'm using the code below to delegate a database restore to a BackgroundWorker component. My problem is that the second time I execute the restore, the private method RestoreDatabase is invoked twice. The click event of the button isn't being invoked twice, so it's somewhere else. Any suggestions?
private void SetupDatabase()
{
buttonDatabaseSetup.Enabled = false;
CurrentActionStatusLabel.Text = string.Format("Restoring database {0}", WORKING_DATABASE);
DataToolBackgroundWorker.DoWork += DataToolBackgroundWorker_DoWork;
DataToolBackgroundWorker.RunWorkerAsync(new MethodInvoker(RestoreDatabase));
}
void dt_ProgressChangeEvent(double percentComplete)
{
DataToolBackgroundWorker.ReportProgress((int)percentComplete);
}
void DataToolBackgroundWorker_DoWork(object sender, DoWorkEventArgs e)
{
MethodInvoker m = e.Argument as MethodInvoker;
m.Invoke();
}
private void RestoreDatabase()
{
DataTool dt = new DataTool();
dt.ProgressChangeEvent += dt_ProgressChangeEvent;
dt.RestoreDatabase(Properties.Settings.Default.DevDBBackupPath, WORKING_DATABASE);
}
|
| Options | 3 answer | Add comment |
Tuesday, 15 April 2008
|
| online questionnaire for recruiting developers Graeme Hood 18:27:45 |
| | Does anyone know of such a tool? Hopefully allowing for different subjects and levels.
Or any other useful recruitment tips beyond the telephone converstaion?
This email message is intended only for the use of the named recipient. Information contained in this email message and its attachments may be privileged, confidential and protected from disclosure. If you are not the intended recipient, please do not read, copy, use or disclose this communication to others. Also please notify the sender by replying to this message and then delete it from your system.
|
| Options | 1 answer | Add comment |
Monday, 14 April 2008
|
| migrating vs2003 to vs2005 website project after sp1 Jim Graf 17:41:50 |
| | Hi,
Before SP1 we were able to migrate a VS2003 website to a VS2005 Web Site Project. Now it defaults to Web Application. How do I get it to convert a vs2003 so0lution to a WebSite project
Any help would be appreciated
Thanks Jim
=================================== This list is hosted by DevelopMentor http://www.develop.com
View archives and manage your subscription(s) at http://discuss.develop.com
|
| Options | 2 answer | Add comment |
Monday, 7 April 2008
|
| Async File IO is not async? Alex Ivanoff 01:53:15 |
| | A very simple test program which writes out 512 MB:
using System; using System.IO; using System.Threading;
namespace AsyncIOTest { class Program { static void Main() { FileStream file = File.Create("out.test", 0x1000, FileOptions.Asynchronous);
ManualResetEvent evt = new ManualResetEvent(false);
Byte[] buffer = new Byte[512 * 1024 * 1024]; file.BeginWrite(buffer, 0, buffer.Length, Program.OnWriteComplete, evt);
evt.WaitOne(); }
static void OnWriteComplete(IAsyncResult ar) { ManualResetEvent evt = (ManualResetEvent)ar.AsyncState;
evt.Set(); } } }
On my machine BeginWrite takes about 12 sec followed by immediate call to OnWriteComplete. A quick examination with Reflector reveals that BeginWrite and BeginRead do not satisfy most (if not all) of the requirements of a "true" async IO outlined here: http://support.microsoft.com/kb/156932.
A bug?
=================================== This list is hosted by DevelopMentor® http://www.develop.com
View archives and manage your subscription(s) at http://discuss.develop.com
|
| Options | 12 answers | Add comment |
Thursday, 3 April 2008
|
| Bubbling events on a server side control Dean Cleaver 14:44:52 |
| | I've tried to create a control that can be either a TextBox or a DropDownList, but am having trouble "bubbling" the SelectedIndexChanged event for the DropDownList (within an UpdatePanel if that makes any difference). My code is like this (snipped a bit for brevity) - is there something obvious I am missing?
Dino
using System; using System.ComponentModel; using System.Data; using System.Security.Permissions; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using AjaxControlToolkit;
namespace Client.Project.WebControls { [ DefaultEvent("SelectedIndexChanged"), DefaultProperty("Text"), ToolboxData("<{0} etailInputBox runat=\"server\"> </{0} etailInputBox>"), ] public class DetailInputBox : WebControl, IPostBackEventHandler { protected override void OnInit(EventArgs e) { Controls.Clear();
Controls.Add(this.TextBox); Controls.Add(this.DropDownList); }
protected override void Render(HtmlTextWriter writer) { if (this.IsValid || this.ReadOnly) writer.WriteLine("<div class=\"detailBlock\">"); else writer.WriteLine("<div class=\"detailBlockError\">");
writer.WriteLine(" <div class=\"detailInput\">");
if (this.DropDownList.Items.Count > 0) { this.DropDownList.SelectedIndexChanged += DropDownList_SelectedIndexChanged; this.DropDownList.RenderControl(writer); } else this.TextBox.RenderControl(writer);
writer.WriteLine(" </div>"); writer.WriteLine(" <div class=\"clear\"></div>"); writer.WriteLine("</div>"); }
[Browsable(false),] private TextBox textBox = null; /// <summary> /// Gets or sets the required text box validator. /// </summary> /// <value>The required text box validator.</value> private TextBox TextBox { get { if (textBox == null) { textBox = new TextBox(); textBox.ID = this.ID + "Text"; } return textBox; } }
[Browsable(false),] private DropDownList dropDownList = null; /// <summary> /// Gets or sets the required text box validator. /// </summary> /// <value>The required text box validator.</value> public DropDownList DropDownList { get { if (dropDownList == null) { dropDownList = new DropDownList(); dropDownList.ID = this.ID + "List"; } return dropDownList; } }
private bool isValid = true; [Browsable(false)] public bool IsValid { get { return this.isValid; } set { this.isValid = value; } }
[ Description("The Details Fields ValidationGroup"), Category("Custom Properties"), ] public string ValidationGroup { get { return this.TextBox.ValidationGroup; } set { this.TextBox.ValidationGroup = value; this.DropDownList.ValidationGroup = value; } }
public ListItemCollection Items { get { return this.DropDownList.Items; } }
public string SelectedValue { get { return this.DropDownList.SelectedValue; } }
public int SelectedIndex { get { return this.DropDownList.SelectedIndex; } set { this.DropDownList.SelectedIndex = value; } }
void DropDownList_SelectedIndexChanged(object sender, EventArgs e) { this.OnSelectedIndexChanged(e); }
public event EventHandler SelectedIndexChanged;
protected virtual void OnSelectedIndexChanged(EventArgs args) { EventHandler thisEvent = this.SelectedIndexChanged;
if (thisEvent != null) thisEvent(this, args); }
public bool AutoPostBack { get { return this.DropDownList.AutoPostBack; } set { this.TextBox.AutoPostBack = value; this.DropDownList.AutoPostBack = value; } }
public void RaisePostBackEvent(string eventArgument) { this.OnSelectedIndexChanged(EventArgs.Empty); } } }
=================================== This list is hosted by DevelopMentor http://www.develop.com
View archives and manage your subscription(s) at http://discuss.develop.com
|
| Options | 2 answer | Add comment |
|
| Automatic Properties on 2.0 Brady Kelly 04:31:28 |
| | I thought these were merely syntactical sugar offered by the 3.5 compiler, but would compile down to normal getters and setters that would work on the 2.0 framework. Yes, when I try and 'down-grade' a 3.5 project to 2.0, I get compiler errors for automatic properties. Is this just something I have to live with, or is there another way?
=================================== This list is hosted by DevelopMentor http://www.develop.com
View archives and manage your subscription(s) at http://discuss.develop.com
|
| Options | 11 answers | Add comment |
Friday, 28 March 2008
|
| ListView and tooltips on a ColumnHeader Richard Kucia 23:32:16 |
| | Now this was a surprise. I wanted to show tooltips on the ColumnHeader of a ListView in details mode. Seemed like a simple enough task, but there doesn't seem to be a straightforward way to do this.
I found out that the MouseHover event fires for a ListView but not if the mouse is over a ColumnHeader. That really surprised me.
Similarly, the ToolTip object won't fire an event when the mouse is over a ColumnHeader.
A little googling shows that this has been a long-term problem. Some solutions that have been offered include handling the MouseMove event, but that seems like too much CPU time to burn -- even the solutions offered include that warning. And besides, if the above methods don't work, I would guess that MouseMove would also come up short, unless I'm watching MouseMove over the entire form (ugh).
Any ideas, anyone? Thanks.
Rick Kucia
=================================== This list is hosted by DevelopMentor http://www.develop.com
View archives and manage your subscription(s) at http://discuss.develop.com
|
| Options | Add comment |
|
| Deployment with Merge Modules Richard Kucia 22:18:20 |
| | I can't figure out what I'm missing here --
VS2005: I have a solution with ordinary code projects and 3 deployment projects (English, German and Japanese). I need to include the same 30 data files with each of the deployment projects. So I built a MergeModule project and added all 30 data files to it. And then I added the MergeModule to each of the deployment projects. I set the deployment target for the merge module output to (application folder on the user's PC) \ "XYZ". It shows "XYZ" in the deployment project's merge module properties. The visual tree of the target PC's file system also shows the correct target for the MSM.
The subfolder XYZ is also designated in the deployment as one that should be created on the target PC. When I run the MSI, XYZ is indeed created under the application folder, as are a handful of other folders. But all 30 files go into the application folder, not the XYZ subfolder.
What did I miss? I've tried and can't find the right combination of ingredients. Thanks.
Rick Kucia
=================================== This list is hosted by DevelopMentor http://www.develop.com
View archives and manage your subscription(s) at http://discuss.develop.com
|
| Options | Add comment |
Tuesday, 25 March 2008
|
| convert XDW to PDF Guest 07:34:41 |
| | I'm trying to convert a xdw file to a pdf file with vb.net. i could convert jpeg or bmp files to a pdf file with iText, but i can't find a way to convert xdw to pdf. iText may not support xdw,i think. Is it possible to make it? |
| Options | Add comment |
Thursday, 20 March 2008
|
| Another Late Night Question Reposted R. Rogers 16:44:46 |
| | Strange formatting issue. Hopefully this shows up better:
I'm getting tired so maybe I'm missing these. I can't seem to find row and col position when editing in the VS 2008 editor. I figured out how to turn line numbers on, but that's not what I want. In the beta, VS2008 showed rol and col position down at the bottom right of the code editor window. I can't see it there anymore (installed the new VS2008 release), and there doesn't appear to be any way to toggle it on, from Tools, Options, Text Editor, C#
Also, I seem to remember that when I built (<Ctrl><Shift><B>), and the build succeeded, VS showed a small piece of text on the bottom left "Build succeeded". I may have changed an option within VS to get that. Now when I build, and there are no errors, I get no message.
Sorry for the piddly little questions, but they're bothering me.
Thanks for any advice.
Richard Rogers http://www.RichardRogers.ca/ (MSN) rogersrr_ca@hotmail.com
|
| Options | 5 answers | Add comment |
Tuesday, 18 March 2008
|
| Fault with AJAX UpdateProgress? Dean Cleaver 19:53:41 |
| | I'm using one of the UpdateProgress indicators on an UpdatePanel. I have about 3 "options" to chose from, 1 which puts 0 items in a table, 1 that puts 1 in the table, and 1 which puts 100's of items in the table.
When flicking between the first 2, everything performs as expected - very quick updates, and no progress indicator as it happens in < 1 sec. When I click on the third option, the progress indicator displays as expected. However, when then I click on one of the first 2 options, there is no progress indicator, but the update takes ages - I am guessing that the client side script is busy cleaning out the 100's of items, but not considering that to be part of the overall progress? And when I say ages, it seems to be twice as long as loading the items in the first place.
Surely the progress indicator should be triggered if it's taking the AJAX client script a long time to "clean up"?
Dino
=================================== This list is hosted by DevelopMentor http://www.develop.com
View archives and manage your subscription(s) at http://discuss.develop.com
|
| Options | Add comment |
|
| Web based report or form designer Mark Gregory 04:57:16 |
| | I would appreciate knowing if there is anything that will permit forms (reports) to be created in a web page.
My client would like to be able to move controls around a page, then save the layout. The form would then be used to enter data and print out as a report.
The solution cannot have any win form components or requirements as this has to be something that the user can do over the web.
Regards, Mark
=================================== This list is hosted by DevelopMentor http://www.develop.com
View archives and manage your subscription(s) at http://discuss.develop.com
|
| Options | 3 answer | Add comment |
Monday, 17 March 2008
|
| General Strange Error on Data Bound ComboBox Brady Kelly 12:14:34 |
| | I have a combobox bound to a BindingSource, in turn bound to a DataTable of Agent Names. Everything is handled by the VS 2008 designer, i.e. I have no custom data binding code, nor do I have any code that sets anything on the combobox. Yet, when I start my project, I get the following error. This only occurs when 'Break when thrown' is set for Framework exceptions, but surely this should only apply to my code? Is this maybe because I have the ComboBox debug symbols loaded?
InvalidArgument=Value of '0' is not valid for 'SelectedIndex'.
Parameter name: SelectedIndex
|
| Options | 1 answer | Add comment |
|