|
In your Global.asax , I believe you need to add the following :-
protected Sub Application_BeginRequest(ByVal sender as Object, ByVal e as System.EventArgs)<br />
<br />
Dim incoming As HttpContext = HttpContext.Current<br />
incoming.RewritePath("http://Project1") <br />
<br />
End Sub
Steve Jowett
-------------------------
Sometimes a man who deserves to be looked down upon because he is a fool, is only despised only because he is an 'I.T. Consultant'
|
|
|
|
|
It shows an error that the virtual path "http://project1" doesnt exist
|
|
|
|
|
I am using to forms (Transactions Form and ProductList Form)
The transactions form is a parent form and there is a button to show the productlist form which shows all the available products in a gridview control.I am using showdialog method to open the productlist form.Once the productlist form is open then user can not do anything on the parent form unless he close the productlist form which I think is clear from showdialog method.
Now what I want is that when user select any row from the datagridview from productlist form and click ok button then the value of the first column of the selected row should be updated in the parent form's textbox (txtProduct) and the productlist form will be closed.
The datagridview on the productlist form is bound to a datatable.
Any idea how I can pass the value from the child form to parent form?
Thanks in advance
Ejaz
|
|
|
|
|
Someone may suggest modifying the constructor of the forms, or having a method to pass the data, etc. However, Pete O'Halon with slap anyone that suggests that. You should implement the Model-view-controller design pattern.[^] Read up on it. It'll make you a better "developer"
I'm going to become rich when I create a device that allows me to punch people in the face over the internet.
"If an Indian asked a programming question in the forest, would it still be urgent?" - John Simmons / outlaw programmer
|
|
|
|
|
This is help for u..
use this stmt in child window javascript
window.returnValue=document.getElementById('<%=hfldConCatStr.ClientID%>').value;
use this in parent window
var retVal=window.showModalDialog('dsfdf.aspx');
|
|
|
|
|
Ejaz Bhai!
try this, Its simple to implement....
in Parent Form use this:
<br />
dim myVal as integer<br />
Public Property SetVal() As Integer<br />
Get<br />
Return myVal <br />
End Get<br />
Set(ByVal value As Integer)<br />
myVal = value<br />
End Set<br />
End Property<br />
in child form:
dim parentObj as [parentForm]
parentObj.SetVal = [Any Integer Valu]
now close child form and use variable 'myVal' in parent form as output from child form.
colgateas900197
|
|
|
|
|
I normally make data and view objects and every view can access the data so it can easily be shown and changed. The data object is globally and unique. If data gets changed you got to trigger an update, in your case check whether the dialog returns with OK => Reload from data object.
Greetings from Germany
|
|
|
|
|
Hello there,
I m really stuck on one thing i have searched almost every where on the internet but so far no solution so thats why i m positing my problem here.
I have to develop a program that will copy or upload an excel file to a ftp server, this part is completed but the problem is that my client is behind proxy, so basically have to send through proxy. There is class ftpwebrequest but it work for framework 2 and above and i have use framework 1.1.
If anyone know a solution or link, i ll be grateful.
Thanks in advance.
|
|
|
|
|
Hi friends..
I am running a login form in Vb.net.I get stack overflow exception.(in Public Sub New()..).wat could be the reason and how to solve it..?
Someone help in this regard as early as possible..
Thanks & Regards,
Balaguru
|
|
|
|
|
Resursion maybe? Difficult to tell without seeing the source code.
Steve Jowett
-------------------------
Sometimes a man who deserves to be looked down upon because he is a fool, is only despised only because he is an 'I.T. Consultant'
|
|
|
|
|
Hi,
the most common way to get a stack overflow is by calling a property (get or set)
that by mistake references itself, rather than the object data it is supposed to access.
Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips:
- before you ask a question here, search CodeProject, then Google;
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get;
- use PRE tags to preserve formatting when showing multi-line code snippets.
modified on Tuesday, January 29, 2008 11:51:02 AM
|
|
|
|
|
In my VB.net application I want to make sure that only one instance of application is running at a time on a client computer. Furthermore I want to perform following tasks:
1. My application should accept a command line argument (Customer Id).
2. Pass this argument to already running instance of the application.
3. Search and load customer data from database and display the respected form in the existing instance.
I have managed to restrict multiple instance by using Process object and easily accepted command line arguments by using My.Application.CommandLineArgs collection.
Public Sub Main()
Dim tempProcess As Process
tempProcess = checkInstance() ' A function which validates current process
If tempProcess Is Nothing Then
Application.Run(New frmWelcome)
Else
Dim hwnd As Int32
hwnd = tempProcess.MainWindowHandle.ToInt32
Try
If hwnd > 0 Then
If IsWindowVisible(hwnd) = False Then
ShowWindowAsync(hwnd, ShowWindowConstants.SW_MAXIMIZE)
End If
SwitchToThisWindow(hwnd, True)
SetForegroundWindow(hwnd)
SetActiveWindow(hwnd)
LoadContact() 'A function which extracts command line argument and call a function from existing running instance.
Application.Exit()
End If
Catch ex As Exception
MsgBox(ex.Message)
End Try
End If
End Sub
When I call a function from existing instance I get an error 'Unable to create window handle'.
Basically I am not an experienced VB.Net programmer, I will appreciate if someone have a look into it and help me out. I will be very thankful if someone pass me an example.
Many thanks
Nas
|
|
|
|
|
Isn't this a copy of a previous post[^]? And were possible solutions not given in this thread[^]>
Perhaps you need to consider an alternative approach to resolving your issue?
Steve Jowett
-------------------------
Sometimes a man who deserves to be looked down upon because he is a fool, is only despised only because he is an 'I.T. Consultant'
|
|
|
|
|
Yes it was the copy of my previous post. In my last thread I have been asked to search on MSMQ but during search I found out .Net Remoting is also a possible solution. My development level is not upto standard that I could decide what technology should be used and how exactly to tailor it to meet the requirement. I just need initial guidance.
Many thanks
|
|
|
|
|
I think, from what you have said previously, that Remoting is NOT what you require as you are only interested in the application already running on the local PC, therefore MSMQ is most likely to be the simplest solution.
There are some very good kick start guides to MSMQ on the web.
Steve Jowett
-------------------------
Sometimes a man who deserves to be looked down upon because he is a fool, is only despised only because he is an 'I.T. Consultant'
|
|
|
|
|
Just an after-throught :-
To check that the program is the first instance, try this code :-
'Check to see if already running<br />
Dim currentProcess As Process = Process.GetCurrentProcess()<br />
Dim allProcesses() As Process = Process.GetProcessesByName(currentProcess.ProcessName)<br />
<br />
If allProcesses.Length > 1 Then<br />
'already running<br />
Else<br />
'not already running<br />
End If
You could also pass the necessary parameter via a file. For instance write an file somewhere, containing the necessary parameters and use a FileSystemWatcher to monitor the file for changes.
Depands how slick you want it, but the simplest options are usually the best.
Steve Jowett
-------------------------
Sometimes a man who deserves to be looked down upon because he is a fool, is only despised only because he is an 'I.T. Consultant'
|
|
|
|
|
Many thanks Steve, I am looking into MSMQ and your idea of writing a file seems solving the problem.
Nas
|
|
|
|
|
In my label i want to display hh:mm:ss
this i want to show continuously on my web form .
i am developing web based application.
Please help me how i can do this through the java script.....
|
|
|
|
|
This is a VB forum not a JavaScript. Try posting in the Web Development forum.
Steve Jowett
-------------------------
Sometimes a man who deserves to be looked down upon because he is a fool, is only despised only because he is an 'I.T. Consultant'
|
|
|
|
|
Hello!
I am developing a drawing application using VB2005. I draw my objects on drawing area, work with it ... and finally on SAVE i write all the properties of drawing object to dataset and write its XML file to save on local drive.
If for drawing something i create a pen:
Dim myNewPen As New Pen(CType(panBoxColor.BackColor, Color))<br />
currentCont.setMyColor = myNewPen<br />
how can i store that 'Pen' to Dataset Table so that when i write to XML it could be saved and when i reopen that XML file VIA dataset, i could redraw my control by initializing its properties from Dataset Table ?
Thanks for any help.
colgateas900197
|
|
|
|
|
You can't save the Pen object itself. Store the information needed to recreate the Pen object.
Experience is the sum of all the mistakes you have done.
|
|
|
|
|
Hi all,
I've a problem in ListView management. The problem is the following:
when the ListView looses the focus, the currently selected item in the
ListView looses the selection: the selection in the ListView is not mantained
switching from a control to another in the user interface.
How can I solve this problem ? I'd like to let the ListView to mantain
the selection.
Thanks a lot !
|
|
|
|
|
Create a variable that stores the selection in the listview at the moment it gets made or changed. As an added bonus it is also easier to clean up if you have to, for example due to another choice made elsewhere on your form.
My advice is free, and you may get what you paid for.
|
|
|
|
|
Hi guys an gals,
I have a form using databinding to a dataset. Whenever the user navigates to another record I check if datasource.HasChanges is true, and if so I ask whether the user wants to save changes. All this works perfect on my pc, but on the users' pcs it basically asks to save on EVERY navigate and even form load, even though there were NO changes made.
Here is the code snippet:
Private Sub OrganisationBindingSource_CurrentChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles OrganisationBindingSource.CurrentChanged<br />
Try<br />
If Me.OrganisationBindingSource.DataSource.HasChanges = True Then<br />
If (MessageBox.Show("Record has changed. Save changes?", "Save", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation) = Windows.Forms.DialogResult.Yes) Then<br />
Me.OrganisationBindingSource.EndEdit()<br />
Me.SoftwareBindingSource.EndEdit()<br />
Me.ContactBindingSource.EndEdit()<br />
Me.QuoteBindingSource.EndEdit()<br />
Me.OrganisationTableAdapter.Update(Me.CRMDataSet.Organisation)<br />
Me.SoftwareTableAdapter.Update(Me.CRMDataSet.Software)<br />
Me.ContactTableAdapter.Update(Me.CRMDataSet.Contact)<br />
Me.QuoteTableAdapter.Update(Me.CRMDataSet.Quote)<br />
Else<br />
Try<br />
Me.OrganisationBindingSource.CancelEdit()<br />
Me.SoftwareBindingSource.CancelEdit()<br />
Me.ContactBindingSource.CancelEdit()<br />
Me.QuoteBindingSource.CancelEdit()<br />
Me.OrganisationBindingSource.DataSource.RejectChanges()<br />
Catch<br />
End Try<br />
End If<br />
End If<br />
Catch err As Exception<br />
MessageBox.Show(err.ToString.Replace("'", ""))<br />
DH.RunQuery("INSERT INTO Log_Error (Message, Process) VALUES ('" & err.ToString.Replace("'", "") & "', '" & Me.Name & "')")<br />
End Try<br />
End Sub
Any ideas on what could cause this? As I say, this does not happen on my pc, so I dont know how to debug it???
Thanks in advance
Ed
|
|
|
|
|
Hi Ed,
This code snippet shows the code that gets executed when the user navigates. You say that this code gets executed at the wrong time (also). So it seems to me that you're looking in the wrong place. If you debug this it will always run correctly, and apparently also on the other pc. You will have to look at the code that precedes the navigation event. Somewhere a piece of code is triggering the event or allowing some user action or background process, which your pc does not allow, either by configuration or because of some program that is running on either pc.
Good luck,
Johan
My advice is free, and you may get what you paid for.
|
|
|
|