G
Guest
(This is about a site in our interanet)
I have an aspx page which has a iframe on it. I would like my page to be
called by get paramters passing into it a paramter called url and I
dynamically create a link based on the passed url and make it the source of
my iframe . by this way people can link to my default.aspx and pass required
get paramter to show an html page stored in a folder in home page of my site.
Problem is that if there is space get paramter , it is dropped when I assign
it to the src of the iframe ,so iframe cannot show the page.
I asked the users to send me encoded url and I decoded in my page , but
still the same problem exists:
I would appreciate your help:
here is the code:
<%
string iURL = Request.QueryString["url"];
if (iURL == null)
iURL = "shared%20documents/default.html";
else
{
string fullLink =
Microsoft.SharePoint.WebControls.SPControl.GetContextWeb(Context).Url + "/" +
iURL;
try
{
//Check to see if the page exist
HttpWebRequest userReq = (HttpWebRequest)WebRequest.Create(fullLink);
userReq.AllowAutoRedirect=false;
userReq.Credentials = System.Net.CredentialCache.DefaultCredentials;
HttpWebResponse serverResponse = (HttpWebResponse) userReq.GetResponse();
if(serverResponse.StatusCode != HttpStatusCode.OK)
{
iURL= "shared%20documents/Error.html";
}
}
catch(Exception ex)
{
iURL= "shared%20documents/Error.html";
}
}
%>
<iframe id="WebpartWPQ1" name="frame1" width="100%" frameBorder="0"
src=<%=iURL%> ddf_src=<%=iURL%>>
</iframe>
I have an aspx page which has a iframe on it. I would like my page to be
called by get paramters passing into it a paramter called url and I
dynamically create a link based on the passed url and make it the source of
my iframe . by this way people can link to my default.aspx and pass required
get paramter to show an html page stored in a folder in home page of my site.
Problem is that if there is space get paramter , it is dropped when I assign
it to the src of the iframe ,so iframe cannot show the page.
I asked the users to send me encoded url and I decoded in my page , but
still the same problem exists:
I would appreciate your help:
here is the code:
<%
string iURL = Request.QueryString["url"];
if (iURL == null)
iURL = "shared%20documents/default.html";
else
{
string fullLink =
Microsoft.SharePoint.WebControls.SPControl.GetContextWeb(Context).Url + "/" +
iURL;
try
{
//Check to see if the page exist
HttpWebRequest userReq = (HttpWebRequest)WebRequest.Create(fullLink);
userReq.AllowAutoRedirect=false;
userReq.Credentials = System.Net.CredentialCache.DefaultCredentials;
HttpWebResponse serverResponse = (HttpWebResponse) userReq.GetResponse();
if(serverResponse.StatusCode != HttpStatusCode.OK)
{
iURL= "shared%20documents/Error.html";
}
}
catch(Exception ex)
{
iURL= "shared%20documents/Error.html";
}
}
%>
<iframe id="WebpartWPQ1" name="frame1" width="100%" frameBorder="0"
src=<%=iURL%> ddf_src=<%=iURL%>>
</iframe>