Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

A little backround. We are currently re-creating our inhouse Access 2000 application into an ASP.NET intranet application. We are starting with recreating all of our reports into Crystal reports.

 

I have created a user button that will pull up the asp.net application from Access with the following url. My question is how do I get the parameters that I am passing into my global aspx file? I was able to do it when I was calling an aspx page, but when I switch to htm page I cannot see where I can get these parameters.

 

here is the string url

 

http ://localhost/CrystalPrototype/Main.htm?ClientID=W73037&UserID=Millini%20Wills

 

any help would be greatly appreciated!

Posted

I put that in and this is the error I got:

 

Request is not available in this context

 

here is my code in the global aspx file

 

'This call is required by the Component Designer.

InitializeComponent()

 

myClientID = Request.QueryString("ClientID")

myUserID = Request.QueryString("UserID")

Posted

In the page_init of the page that is calling for these variables here is the code

 

Try

myClientID = (Request.QueryString("ClientID")) '"W73058"

myUserID = (Request.QueryString("UserID"))

TextBox1.Text = myClientID

 

Catch ex As Exception

Dim errcode As String

errcode = ex.ToString

Label3.Text = errcode

 

End Try

 

 

I recieve no error, but the variables are set to nothing.

Posted

still doesn't work.

 

Perhaps (um yeah) I should have mentioned that the aspx that the variables need to be set from, are inside the frame on the Main.htm page.

 

Like I said earlier, the passing of the parameters worked until I put this page into a frame.

Posted

I figured out how to do this, I am going to post it here in case anyone else comes across this situation.

 

First I created a new aspx page and copied the HTML from my "main.htm" page that I was passing the parameters to.

 

I reset my code in Access to reflect this.

 

I then put this code in my global.asax page

 

Sub Session_Start(ByVal sender As Object, ByVal e As EventArgs)

' Fires when the session is started

Session("params") = Request.Params

End Sub

 

 

I then placed this code in the page that needed the parameters

 

Try

myClientID = (Session("params"))("ClientID")

myUserID = Session("params")("UserID")

TextBox1.Text = myClientID

Label4.Text = myUserID

Catch ex As Exception

Dim errcode As String

errcode = ex.ToString

Label3.Text = errcode

End Try

 

 

Best of all it works!!!! YAY!

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...