Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0pass information to a DotNetNuke Modulepass information to a DotNetNuke Module
Previous
 
Next
New Post
4/3/2008 12:08 PM
 

Nathan,

I have followed your posts, and I think there might be something to them.  I was wondering if you could explain a little more about the query string paramiters

For testing purposes I have the following

 

http://localhost/Home/tabid/36/mid/373/Default.aspx"

 

From this I can get the following info

tabid = 36                                    --This is the page ID
ctl = ?     --This is the control key (same as the ‘key’ of the control in the module definitions)
mid = 373                                    --This is the module ID
UserCompetency = ?                --This is your custom query string

 I am a little hazy as to what ctl actually does, and about the UserCompetency.  I bassicly want an example of the type of query strig that DotNetNuke looks at

for example I have a paramiter on my asp page that I am trying to pass to my DotNetNuke module, and the link I have brings up my DotNetNuke module, but how do I pass my paramiter in a query string.  I want to be able to pass my value, put it in a textbox on my module and from there run a query that uses a datagrid and I know already works

 

Thanks for your help

Mike

 
New Post
4/3/2008 12:53 PM
 

Youi can use the free module SQLGridSelected view to perform the reporting  

For example - use the module to display a grid of all wanted invoices with a link to the explicit invoice as column in the grid.   The link would take you to another page with SQLGridSelectedView module that could display the detail based on the Query string value.

The first page would have a SQL Query some like ...

Select InvoiceDate, InvoiceAmount, '<a href="www.mysite.com/InvoiceDetail?Invoice=' + InvoiceNumber + '">' + InvoiceNumber + '</a>' as Link from myInvoices where ....

and the second page  (www.mysite.com/InvoiceDetail) the SQLGridSelectedView select  would be something like

Select * from myInvoices where InvoiceNumber = [QUERY:Invoice]

SQLGridSelectedView can be found at www.tressleworks.ca

Hopes this helps
Paul.

 
New Post
4/3/2008 2:00 PM
 

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

 
New Post
4/3/2008 2:19 PM
 

Mike,

I guess I should make a point to say that when your program runs “Request.QueryString("KEY")” its searching the URL for the KEY entry and will then retrieve the value associated with it. You don’t have to use “KEY”, you could use any string it’s just when “TheIDofanInvoice” is in the address bar, it makes for long URLs.

If your familiar with traditional ASP this is just like http://domain.com/site/page.asp?KEY=123 only DNN does some voodoo to it to make it people and search engine friendly. To prove my point, using your example go to:

http://localhost/Home/Default.aspx?tabid=36&mid=373 it should be the exact same page as http://loaclhost/Home/tabid/36/mid/373/Default.aspx

tabid and mid are both query string and your just adding one more to the list. It’s important to note that you can have extra strings that do nothing and the page will still work. But if your have two with the same ID you’ll cause some problems. So whatever name you put in “Request.QueryString("KEY")” must not match anything currently in your URL.

-- Nathan Rover

 
New Post
4/3/2008 4:49 PM
 

Nathan

Thanks for all your help.  I've got it figured out my final solution was

tabid = 36              the page id

mid = 373                             module id

qry = (Value to be passed)      value I made up to pass the value

Therefore

HyperLink1.NavigateUrl = "http://localhost/Home/tabid/36/mid/373/qry/" & value to be passed & "/Default.aspx"                     

 My dnn module then gets the following code in the load event

 dim qry As String = Page.ClientQueryString.ToString

if(qry.Contains("qry")) Then

qry = qry.Substring(qry.IndexOf("qry" + 4)

TextBox1.Text = qry

End If

 

 This code looks at the url whenever the module is loaded.  if the module contains qry then I know that I got to the module from my asp page.  If that is the case then the value is parsed out and put into my text box which will automatiicly run my data source.  If the url does not contain qry then I know that the user got to my moudle from the DotNetNuke site.

 

 

 

bassicly the query string of the url looks like the following

tabid = 36 mid = 373 qry = value passed

Thanks for all your help

Mike

 

 

 

 

 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0pass information to a DotNetNuke Modulepass information to a DotNetNuke Module


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out