Mike,
Your on the correct path, let’s see if we can fill in some of the blanks. If I remember correctly, you said that you have a module that launches invoices and your trying to link directly to a particular invoice from out side of DNN and you have the ID number of the invoice.
The first step is, in your invoice module you need to have something that can request the ID from the Query string. That would be this bit of code:
Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
Try
If Not Page.IsPostBack Then
Dim _Key As Integer = 0
If Request.QueryString("KEY") IsNot Nothing Then
_Key = CType(Request.QueryString("KEY"), Integer)
End If
'Do something with _Key
End If
Catch ex As Exception
ProcessModuleLoadException(Me, ex)
End Try
End Sub
The second step is to replace “'Do something with _Key” with some thing that will actually make an invoice that corresponds with what ever ID is in _Key open. You should be able to hard code an Invoice ID into _Key and comment out the query string request. Compile and run your program and when you open it, it will show you your invoice. If it doesn’t do that then stop here and fix this part first.
Third, let’s test it from a web browser.
1) Log in to DNN as a host user.
2) Go to module definitions.
3) Select edit (the little pencil) next to your invoice module.
4) At the bottom there is a table with three columns (Control, Title, Source)
5) Find the row with the same Source as the ASCX file you put the above code in.
6) Write down exactly what is listed for this row in the “Control” column.
(If there is only one row, and/or, the “Control” column is blank, that’s ok I’ll get back to that in a minute)
7) Next go to your module that makes the Invoice and look at the address bar of your browser.
8) We are only interested in the tabid and everything after it.
9) Using your example we are going to add some things to the address.
9a) If you had a value from line 6, After the “tabid/36/” put “ctl/” followed by Your Value “/”
9b) Then put “mid/373/”
9c) Then put “KEY/” the ID number for a Invoice followed by “/Default.aspx”
10) Press Enter… if it opens an invoice it worked.
Given your example URL of http://localhost/Home/tabid/36/mid/373/Default.aspx and I’m going to assume a value for line 6 of “Invoice” and an Invoice ID number of “123” the resulting URL should look like this.
http://localhost/Home/tabid/36/ctl/Invoice/mid/373/KEY/123/Default.aspx
If the Control column in line 6 is empty then your URL should look like this
http://localhost/Home/tabid/36/mid/373/KEY/123/Default.aspx
Forth, in your non-DNN page you need to program some method of entering the ID number in a URL string then Response.Redirect() to that URL.
I hope that helps. If you have any more questions let me know.
-- Nathan Rover