|
The most important thing to realize is that ASP.NET is all server-side code (with the help of a couple javascript files to help with form validation). Popping up a window is completely client-side. The server can't tell the client to open a window or direct the browser to a new window - all it can do is generate and send content.
So, the server click event needs to use Page.RegisterClientScriptBlock or Page.RegisterStartupScript to register a fragment of javascript that will do this.
It's not that hard to do at all, but if you want more help, ask in the ASP.NET forum where this question should've been posted originally.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Awesome, dude. Thanks!
Joel
|
|
|
|
|
I am trying to find a specific record in the results of an SQL statement. Bascially, in non-technical terms, a query or filter on the result of a query (let's not get hung up on semantics). The data on that record is then going to be passed on to another query, but unless it has a bearing on the solution or you are interested, I won't go on about the specifics.
Thanks much....
ab
|
|
|
|
|
aberger56 wrote:
I won't go on about the specifics
With that it's rather vague, so here is a question: Are you using a stored procedure? More details on your situation will help those in the forums help answer your question.
- Nick Parker My Blog | My Articles
|
|
|
|
|
OK, here goes...
We are tying to implement a table-driven locate system to our application. Some forms (calling forms) will have a locate button on them. If they have the button, there will be records on table app_locates for that form.
app_Locates has 4 fields:
al_FormName, which holds the name of the calling form
al_FieldName, which holds the internal name of the field on which the locate can be done
al_ExternalFieldName, which is what the user will see
al_FileName, the table on which the field lives.
When the locate button on the calling form is clicked, the name of the calling form is passed to the LDB, which queries app_locates for the records which have al_FormName = the calling form's name. So, if we are on the orders form, we may get 3 records returned from app_Locates.
On the LDB, we create a radio button for each of the records returned from the query, in this case 3 radio buttons. The text that goes along with the button is the al_ExternameFieldName, so that the user sees "Customer" and not "ord_Cust", "Order Num" and not ord_OrdNum. Also on the LDB is a text box, an OK button, and a Cancel button.
So, the user clicks the Customer radio button, enters Smith in the text box, and we query the appropriate table for the information. This is where the question comes in...
let's say app_locates has 5 records:
al_FormName al_FieldName al_ExternalFieldName al_filename
icode ic_Cust Customer iCode
ordmaint om_Cust Customer orders
ordmaint om_Date Order Date orders
ordmaint om_Zip Zip Code cust
shipping sm_Cust Customer shipping
Being as the Calling Form is ordmaint, the middle 3 records are returned. The form shows with 3 radio buttons, with the External Field Name shown as the associated text.
In theory, when the user picks a radio button and enters some text in the text box, we have the info we need to find the appropriate record on the al_filename so that we can put the correct info on the calling form. The query would be:
"select * from " + app_locates.al_filename + " where " + app_locates.al_FieldName + " = " + ldb.textbox.text
The problem is, how do I find the correct record out of the 3 returned from the first query (against app_locates) to populate the second query.
I hope this makes some degree of sense. The end result is that we can add a locate field to a form simply by adding a record to app_locates.
Thanks for the help....
aberger
|
|
|
|
|
Hi
Well like you know, the developers most bring to the reallity the dreams of the boss. Now I'm tryin' to get insane with MapXtreme 2004, this is easy to show a map and ... nothing more I can't do. I wanna display the data table into a datagrid, but I can't. Someone here had used this software?? I try with the developers guide, but It's hard for me, I get confused with the namespace MapInfo.Data .
So any help, thanks.
----
hxxbin
|
|
|
|
|
You best shot for support like that, is the company that developed the library. Considering there are thousands of libraries, controls, and whatnot out there, it's very unlikely anyone has used the product.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
In the code below I load an image into a PictureBox using the Image.FromFile method. When I am done with that image I would like to release it so that I can delete it from the hard drive. However, even after I set the PictureBox's Image property to another image I still can not delete it. Obviously my process still has a handle to the file but I can't find a way to release that handle. I tried looking through the methods and properties of pictureBox1.Image but I did not see anything that looked useful. Any ideas?
------------------
pictureBox1.Image= Image.FromFile(MyFile);
pictureBox1.Image = Image.FromFile(AnotherFile);
System.IO.File.Delete(MyFile); //This fails becuase MyFile is "in use by another process"
|
|
|
|
|
Got it. Thanks.
------------------
pictureBox1.Image= Image.FromFile(MyFile);
pictureBox1.Image.Dispose();
pictureBox1.Image = Image.FromFile(AnotherFile);
System.IO.File.Delete(MyFile);
|
|
|
|
|
i was just about to say, Dispose the Image. When you Dispose an object, it releases any unmanaged resources it has open, including file handles.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi
I would like to catch an exception and then exit the method. There is a lot of code after the catch test and I was wanting to exit at that point rather without running through the rest of the code. Is there an 'exit' for a method? I have looked but cannot find anything.
Thanks in advance.
Stephen
|
|
|
|
|
|
I'm currently monitoring an service I wrote and notice in Task Manager the thread counts and handles are growing slowly and not releasing. I do the normal closing of connections and call the "dispose" method and set my objects = null. Am I missing something?
The application does the following.
1. Sink a rename file event using the "FileMonitor.EnableRaisingEvents".
2. Connect to a db using the ADODB.DLL and run SP and walk thru a recordset.
3. Walking thru a directory to see if certain files are present.
4. Create up to 17 processes objects and execute .cmd files (asynchronously) that runs ISQ and DTS packages.
5. Enumerate thru the process and check if the processes have exited.
These are the things I do to cleanup:
1. Close the recordset object and connect and call the “dispose” method. Also call the dispose on the db wrapper object.
2. Close all the processes and dispose them.
3. Set each class object equal to null.
When the service starts it only uses 8 threads and 148 handles, since it has ran twice the thread count is 12 and handles equal 307. Again any help is appreciated.
M.E. Guzman
|
|
|
|
|
|
I have an application for PocketPC devices running .net cf in which I need to trap the disposed event of a form. What should occur is this:
1. user click on the add button
2. they get a new form allowing them to add new information.
3. They click the add button and the add form disposes of itself after updating the data base.
4. the original form now needs to refresh the data on screen to reflect changes.
Being new to dot net I realize that I can do this easily by capturing the disposed action of the add form, but I can't quite figure out how to make it happen.
Any help is greatly appreciated.
-Andy Nortrup
|
|
|
|
|
Handling the Component.Disposed event would be pointless: the object is disposed - i.e., cleaned-up - before the event is fired.
Instead, call Form.ShowDialog on your add form. When the method returns, see if DialogResult.OK (or whatever is appropriate) was returned. At this point, the Form is still valid, so you can grab values like so:
using (AddForm form = new AddForm())
{
if (form.ShowDialog() == DialogResult.OK)
{
someTextBox.Text = form.SelectedItem;
}
} Using the using block like this makes sure that the modal form is disposed even if an exception is thrown. This is necessary for modal forms or you'll notice a decrease in performance and available memory over time.
This is the best way of creating a prompt box. If your form that needs to reflect the changes instantiates and shows the prompt form, then this is the most simple an extensible way of doing it (you can easily reuse your form).
Also, the Form.Closing and Form.Closed events - which are the proper events to use in order to refresh data - are not available in the .NET CF.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Many thanks, got it to do exactly what I needed.
-Andy
|
|
|
|
|
Is this possible? I don't want to merge Microsoft's .NET assemblies into the final build, but I don't want to have the distribution package to have all the little DLL files that the EXE depends on that I've written. In C++ you could do this--it was a linker option, I think.
Yeah, yeah, the idea is NOT to do this--I know. But what if I want to?
Marc
Microsoft MVP, Visual C#
MyXaml
MyXaml Blog
|
|
|
|
|
Marc Clifton wrote:
Yeah, yeah, the idea is NOT to do this--I know. But what if I want to?
There is program called assembly linker that can do that for you. Alternatively, just decompile all the files (i hope you know perl) and remove the interacting references from the source as well as duplicate entrypoints, then just recompile and you set
top secret xacc-ide 0.0.1
|
|
|
|
|
leppie wrote:
There is program called assembly linker that can do that for you.
Thanks!
leppie wrote:
Alternatively...
That sounded like a big "alternatively" task.
Marc
Microsoft MVP, Visual C#
MyXaml
MyXaml Blog
|
|
|
|
|
|
Nick Parker wrote:
Have you read about this: Assembly Linker (Al.exe)[^]
Thanks! Leppie got to it first. Never heard of it before.
Marc
Microsoft MVP, Visual C#
MyXaml
MyXaml Blog
|
|
|
|
|
Is it possible to play an AVI-file (Xvid) from within my C# application? I word prefer to have a panel where the video i played, but mayby it is only possible to start an extern player like Zoom Player. Is so, how do you start an extern player from a C# program? - and yes I am a newbee
|
|
|
|
|
You can try the Windws Media Player ActiveX Control:
1. Right-Click the toolbox, choose "Customize Toolbox..."
2. On the COM tab select "Windows Media Player".
3. Drag a Media Player onto the form.
4. Set the file name in the properties box.
5. Run the application - you see your video running in the Media Player control.
If you want to dive deeper into AVI handling, you can try playing the video yourself with managed DirectX or the
|
|
|
|
|
If you use the ActiveX Control like Corinna suggested maybe a look at the Media Player SDK on MSDN will be useful.
Another player can be started by calling Process.Start method. See the documentation for the Process class for more information.
If you want to control the started application you have to P/Invoke SendMessage to send message towards it. It think there was an article how to this with Media Player here on CodeProject.
www.troschuetz.de
|
|
|
|