The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Hiding Iframe src value
maha_g
post Mar 22 2012, 09:28 AM
Post #1





Group: Members
Posts: 2
Joined: 22-March 12
Member No.: 16,766



Hello
I am using an iframe as follows

<iframe id="frame1" runat="server"/>

And am setting its src value from code behind
frame1.Attributes.Add("src", "default.aspx")

I thought by doing that the value of src wont appear in view source.But after running the page and viewing source this is what i get

<iframe id="frame1" runat="server" src="default.aspx"/>

Is there a way to hide the src value from appearing in souce code?


I tried to put src="" in .aspx hoping that after run it stays the same but it was updated to src="default.aspx"

Any suggestions?
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Mar 22 2012, 10:56 AM
Post #2


Don't like donuts. Don't do MySpace.
********

Group: WDG Moderators
Posts: 15,619
Joined: 9-August 06
Member No.: 6



I suppose that's ASP. Doing it client side, with JavaScript, would get rid of the src in the HTML but it would still be visible in the JavaScript source.


--------------------
"Never go to excess, but let moderation be your guide."
- Cicero

IPB Image
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Mar 22 2012, 12:03 PM
Post #3


.
********

Group: WDG Moderators
Posts: 6,234
Joined: 10-August 06
Member No.: 7



Never heard of the RUNAT attribute before. It seems to be used for (server-side) ASP.NET scripting. Confusing by ASP.NET to add server-side code into HTML syntax like that.

QUOTE(maha_g @ Mar 22 2012, 03:28 PM) *
I thought by doing that the value of src wont appear in view source.

That would be correct if you used client-side javascript. But a server-side script outputs HTML, including the iframe's SRC value.

QUOTE(pandy @ Mar 22 2012, 04:56 PM) *

it would still be visible in the JavaScript source.

Also the user could find the URL in his browser history.


--------------------
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
patel
post Mar 23 2012, 05:22 AM
Post #4





Group: Members
Posts: 6
Joined: 22-March 12
Member No.: 16,767



if i talk about php then in the other file you made iframe code and then include the file then it surely hide the code and shows the file and hide it

so i don't know in asp or javascript you can google it..
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
maha_g
post Mar 23 2012, 06:32 AM
Post #5





Group: Members
Posts: 2
Joined: 22-March 12
Member No.: 16,766



This is ASP.net
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Mar 23 2012, 07:26 AM
Post #6


Don't like donuts. Don't do MySpace.
********

Group: WDG Moderators
Posts: 15,619
Joined: 9-August 06
Member No.: 6



The HTML source would still show everything if you use include.


--------------------
"Never go to excess, but let moderation be your guide."
- Cicero

IPB Image
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 21st November 2014 - 08:37 PM