Reputation: 1151
I have a simple mvc page that is being loaded in an iframe on a tab of the account record in dynamics crm, set to pass the parameters through.
this works fine, the page loads and if I right-click - properties, I get the url+parameters as expected e.g. -
http://myserver.com/?type=1&typename=account&id={816E90BE-7DBC-DD11-9E0B-001C25CFAE82}&orgname=MyOrg&userlcid=1033&orglcid=1033
However, in the controller I have
Request.QueryString["id"]
and this returns null, also Request.QueryString is null
If I load the page in a browser without the iframe Request.QueryString["id"] has the guid as expected.
What stupid thing have I missed?
Upvotes: 0
Views: 966
Reputation: 1720
I don't believe you can do this the way you want because the request for your application is coming from the iframe instead of the user. In order to do it you will need to pass your parameters in the source of the iframe like so:
<iframe id="ThePage" src="mypage.aspx?id={816E90BE-7DBC-DD11-9E0B-001C25CFAE82}"></iframe>
You can almost think of the request as being proxied. If Jack tells Jon and Jon tells Jill, Jill has no knowledge of Jack unless Jon tells her.
Let me know if this answers your question.
Upvotes: 1