.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

Passing a window.location as a (global?) variable

Posted By:      Posted Date: October 18, 2010    Points: 0   Category :ASP.Net



I have come up with form which pulls membership id, allows checkbox selections and commentry (custom feedback). The final piece that needs to be captured is the iframe's url. Now the content in the iframe is content produced by (madcap) flare.


I need to capture the window.location of the iframe url and pass that onto the asp.net masterpage. The iframe is also located in a content page. The iframes content is controlled by it's own TOC. I have added a script to this output so that each time the content (page) in the iframe changes the script alert's me of the new URL of the page just clicked/opened (this is the information I need passed as a variable).


Here is the code producing the desired alert output (page url).


<script type="text/javascript">
var locationObj = window.location;

The above produces the output I would like to capture (but instead of an alert output, I require this as a string) which will allow the insertion into my form as the final piece of information required.


I am not sure how I can convert or catch the output. Of course I would not want to use the alert function everytime the page changes, but wou

View Complete Post

More Related Resource Links

Authorize.Net ARB passing variable


The following code is Authorize.Net Sample Code provided on their website for ARB clients/merchants to use as an example.  

If you notice, there is a sample (fake) credit card number, (4111111111111111), on Program.vb at "Private Sub PopulateSubscription(ByVal request As ARBCreateSubscriptionRequest).   NOTE: there are four "Sub PopulateSubscription" on Program.vb.  I am refering to the "ARBCreateSubscriptionRequest".

My objective - Pass a variable in a TextBox on Default.aspx to replace the credit card number (4111111111111111) in Sub-PopulateSubscription. 

I assume this can be done, but I am not experienced enough to make it work properly. 

Let me be clear....I don't expect anyone to show me how to code a program to communicate with Authorize.Net, because from reading other posts, many people don't want to offer any help regarding Authorize.Net because they haven't worked with it before.  What I am asking, is for someone to show me how to Pass a variable from a Form to a Class, in a way that will work given the Sample code I have provided. 

I hope someone can help.  Should be just a walk in the park for some of you.

------------------THIS IS Program.vb-------------------------
'D I S C L A I M E

SSRS 2005 SP3 - Instr function with Global Variable fails in Subscriptions

Hi I have a very simple expression in a text box in my report:  INSTR(Globals!ReportServerUrl,"Report").  This expression should return the integer value of where the string "Report" appears in the Global variable for the ReportServerUrl.  Simple enough.  This works fine for generating the report directly through report manager, and in my case returns a value of 20. However when run as a subscription and emailed to myself the value returned is 0. This suggests that the search string does not appear in the Global variable. In the reportserver config file the URLroot tag contains the correct server address - http://myserver/reportserver. Does anyone know why i should be experiencing this issue with my subscriptions?  Your help would be much appreciated! Thanks Guy  Guy

Passing Table Variable to Stored Procedure

My stored procedure expects a uniqueidentifier as a parameter.  However, this unique identifier is stored in a table variable, which looks like this:DECLARE @TableGiftGuid table ( GiftGuid uniqueidentifier )When I try to execute a stored procedure by passing the GiftGuid like so:EXEC my_procedure (SELECT GiftGuid FROM @TableGiftGuid) I get an error. What I ended up doing is declaring another variable, storing the GiftGuid into it and then passing the variable to the stored procedure like this: DECLARE @TableGiftGuid table ( GiftGuid uniqueidentifier ) DECLARE @GiftGuid uniqueidentifieDECLARE @TableGiftGuid table ( GiftGuid uniqueidentifier ) DECLARE @GiftGuid uniqueidentifier SET @GiftGuid = (SELECT GiftGuid FROM @TableGiftGuid) EXEC my_procedure @GiftGuidThat works, but is there a more elegant way of doing this?

Passing Rowdelimiter and Columndelimiter as a variable

I have a SSIS package in which I am using Flat file destination. I need to pass the Column Delimiter and Row Delimiter using variable. I have used a variable for the RowDelimiter property of Flat File Connection Manager using SSIS expression. But I dont know why it is not picking up the value from the variable. It is alway picking up the value which is defined in the Flat File Connection Manager editor and not from the variables. For the Column Delimiter I am not even able to find a place to set the value for this. Is it due to bug or I am missing something over here ? Any help would be highly appreciated. Thanks!!

Setting a session variable OR passing along information in Javascript

Hello, Form1 needs to send information to Form 2. Form2  opens in it's own window and is sized smaller. I need to send information to Form2 in order to set parameters in the query in Form2. At first I was just going to use an asp button control and load up some session variables, then I remembered that in order to have the next screen (Form2) open in its own window and be able to size it, I had to use an input type="Button" and use Javascript to open the new window like this:<script type="text/javascript"> function open_win() { window.open("/Accounts/Form2.aspx","_blank","toolbar=no, location=yes, directories=no, status=yes, menubar=no, scrollbars=yes, resizable=yes, copyhistory=yes, width=1000, height=500"); } </script> But by doing this, I don't know how to pass the information along I need for Form2. How can I pass variable information to Form2?  The data comes from two textboxes on Form1: txtStartDate and txtEndDate. Thank you. 

Passing a global parameter/argument to a workflow


I am using a hosted workflow designer to allow users to create their workflows. I would like them to be able to execute the workflow in a 'Test' mode, so I am trying to pass a parameter that indicates it is test mode.

In addition to the workflow being run from the rehosted designer, it will also be getting executed by an automated Workflow Console Application. So when the workflow is executed from the rehosted designer, it should execute in test mode. When it is executed from the console application, it should execute in production mode.

I thought I would just be able to pass a paramter indicating which mode to run it in, but the only way I can seem to get it to work is to have an Activity already on the workflow and setup the Argument for them through the designer and assign the expression prior to run time. The problem is that the user starts out with a blank workflow with no activities on it. I do not know which activity the user is going to add to the workflow, and I don't want them to have to be able to figure out how to configure arguments. It is an argument that should just always be there.

All the activities that I've made available to the user are inherited from a base class which inherits from NativeActivity. So is there anyway to dynamically bind the activities to the argument passed in at runtime in the base class?

I am invoking

Passing data to a Controller from global.asax


Hello all! I'm in a situation where I need to pass some information (state) to a base controller from which all of my controllers derive. In my global.asax, I'm calling a web service to get some state about the user. This state applies to every page in my web app, so the base controller needs to know about it. The state consists of about 4 fields. Is there a standard way to do this? 

I'm using ASP.NET MVC 2.

Thanks in advance for your time!


Passing a value from a WPF page to its parent's window


Hi  ,

 I have a wpf application that contains a window  and a page.The page is dispaly inside the window using a frame.

I want to pass some values from thhe page to window's textbox. This window never closes and page will display withing the frame.



Can someone please help me. Sample code would be appreciated.



Accessing static variable in global.ashx file


Hi All ,

I want to access the static variable in my global.ashx file  I am using classname.variable name for accessing the variable but the variable name dose not appear.Can someone tell me how to access static varialbe in *.ashx file.

How to get the Package level Variable collections (Global Variable) in Script Task


Hi All,

I have the requirement like read all the Variables in Script Component Task, which includes variables available at package level and their values, global variables declared at package.


Currently are two ways to read the variables but which are not suitable for my requirement


1) Mentioning the variables at Script designer window as ReadOnlyVariables or ReadWriteVariables



Want to know how to add a variable to the watch window.


Hi there,

I am using SSIS 2008

Want to know how to add a variable to the watch window.

I need to know the value of the variable when i run the SSIS task.  For this I have setup a break point and running in debug mode,

the execution stops at the break point  and the watch window is open, but couldnt add anything to it.

Any help much appriciated

Its greyed out. When I right click the watch window, i could see the add watch option but that too is greyed out.


Global variable


Hello all!

I need to declare a variable that is global so i can evaluate roles permissions on page load.

How can i do this?

Thanks in advance!

Passing variable into function in SQL Server from Access



I am trying to call a function in SQL Server 2005 from Access 2003.  It works fine with the constant value, but fails with a variable of the same value.  This works:

strSQL = "SELECT * FROM functionName (constantValue)"
rs.Open strSQL, cn 

But when I use variable in the parameter, I get error.  I have tried creating parameter objects in Access, but couldn't execute it and don't know if this is a way to go anyway.

Would appreciate for any help or suggestion.


Thank you

SSIS Parent/Child Package variable passing



I have having trouble getting my hands around how to retrieve variables from a parent package.  I read about the Environment variables and Configuration File at the parent package level and the Parent Package variable at the child level.

Here are my questions:

1.  Can you only store/retrieve 1 variable in a config file at a time?

2.  Does the child package have to define the variables and if so, do they have to be the same names as the parent package?

This seems so more more complex then the DTS2000 way of passing variables to and from packages.

Any help would be appreciated.

Thanks in advance,

Gordon Radley



question on passing variable to Ajax Extender Toolkit Slideshow


I need to create a slideshow that displays all the images in a folder that have filenames that match a specific criteria.  The criteria is based on a querystring.  Is there a way to get a the querystring into the slideshow's webservice?  If not, does anyone have any suggestions?  I've been looking and looking but everything I've seen has one or more things that I need that it can't do.

global variable



i am working on a web site. my application is simple dot net application and back hand is sql server. to reduce the hacking of the site can any one suggest me some tips.

i wanna to know that when ever the user login i am creating the session variable is that the safe one Or shall i need to create the application variable for that ?

Passing xml in javasript variable to server side



I am creating the new XML in javascript and assigning it to javascript variable and assigning it to html hidden field. But in server side I am not able to retrive its value when I debug hidden field shows [object object] in server side.

How can I solve the above mentioned problem? Is there any other better method exist?



ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend