Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Professional
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
ASP.NET 2.0 Professional If you are an experienced ASP.NET programmer, this is the forum for your 2.0 questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Professional section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old November 23rd, 2007, 07:26 AM
Authorized User
 
Join Date: Nov 2007
Location: Allahabad, UP, India.
Posts: 33
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to Display Html file into IFrame(other contro

Hello every one

There is little problem of IFrame, I have to show Html file in a IFrame, there is File upload control in the form, from there user browse a html file, I don't have to save the uploaded file, just I have to Save path of the uploaded file into an XML File. So I have to show the html file into IFrame by reading path from the XML and If user wants to show the newly uploaded file into IFrame then I have to also show uploaded file into IFrame without saving that uploaded. it will works well fine when I will save the file into server, but don't want to save the file and I have to save the file path into XML.

So how can we assign 'src' of I Frame so that without saving the file..

Following code work well when I was displayed file into IFrame after saving it.
I there is any metho through java script
Is there is any other solution, its not mandatory to show html file into IFrame.. Can we use any other control...

.cs file

protected void Page_Load(object sender, EventArgs e)
    {

    protected void Button1_Click(object sender, EventArgs e)
    {
        string path = System.IO.Path.Combine(Server.MapPath("~"),FileUpl oad1.FileName);

        FileUpload1.SaveAs(path);

        myIFrame.Attributes.Add("src", FileUpload1.FileName);
    }
}
 .aspx file

<form id="form1" runat="server">
    <div>
        <asp:FileUpload ID="FileUpload1" runat="server" />
        <asp:Button ID="Button1" runat="server" Text="Button" OnClick="Button1_Click" /></div>
        <iframe runat="server" width="100" height="100" id="myIFrame" style="width: 561px; height: 534px"></iframe>
    </form>

  #2 (permalink)  
Old November 23rd, 2007, 08:14 AM
Friend of Wrox
Points: 7,395, Level: 36
Points: 7,395, Level: 36 Points: 7,395, Level: 36 Points: 7,395, Level: 36
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Capital Federal, , Argentina.
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

Well.. I understand you don't have to save the file.. but what "path" will you store to reach the file?? the user path??

HTH

Gonzalo

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from dparsons signature and he Took that from planoie's profile
================================================== =========
My programs achieved a new certification (can you say the same?):
WORKS ON MY MACHINE
http://www.codinghorror.com/blog/archives/000818.html
================================================== =========
I know that CVS was evil, and now i got the proof:
http://worsethanfailure.com/Articles...-Hate-You.aspx
================================================== =========
  #3 (permalink)  
Old November 23rd, 2007, 08:42 AM
Authorized User
 
Join Date: Nov 2007
Location: Allahabad, UP, India.
Posts: 33
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Yes the Path which user browse from his system.

Following is my javascript function GetClientSideControl() which return client side control id of control. There is no issue regarding this GetClientSideControl() function. It is working fine..
Can we use any other control instead of IFrame.

// JScript File
function GetClientSideControl(document,ControlId)
 {
    var ctl;
    var d=document.all;
    var intLength=document.forms[0].length;
    var i=0;
    var id='';
    for(i=0;i<intLength;i++)
    {
        id=document.forms[0].item(i).id;
        if (id==ControlId)
        {
            ctl=document.forms[0].item(i);
            return ctl;
        }else
        {
            arr=id.split("_");
            for(j=0;j<arr.length;j++)
            {
                if (arr[j]==ControlId)
                {
                    ctl=document.forms[0].item(i);
                    return ctl;
                }
            }
        }
    }
    return ctl;
}

  #4 (permalink)  
Old November 23rd, 2007, 09:16 AM
Friend of Wrox
Points: 7,395, Level: 36
Points: 7,395, Level: 36 Points: 7,395, Level: 36 Points: 7,395, Level: 36
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Capital Federal, , Argentina.
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

Are you getting the user path in the upload control?

HTH

Gonzalo

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from dparsons signature and he Took that from planoie's profile
================================================== =========
My programs achieved a new certification (can you say the same?):
WORKS ON MY MACHINE
http://www.codinghorror.com/blog/archives/000818.html
================================================== =========
I know that CVS was evil, and now i got the proof:
http://worsethanfailure.com/Articles...-Hate-You.aspx
================================================== =========
  #5 (permalink)  
Old November 24th, 2007, 01:07 AM
Authorized User
 
Join Date: Nov 2007
Location: Allahabad, UP, India.
Posts: 33
Thanks: 0
Thanked 0 Times in 0 Posts
Default

yes I am getting the right path into Upload control..
I am already posted whole code into my post.
pls reply me soon..
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Screen Resolution:HTML file display problem vamsikk XSLT 2 July 4th, 2008 03:16 AM
Display as HTML austinf XSLT 1 March 6th, 2008 09:27 AM
How to display an html file inside Iframe --need u vishnu108mishra BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 1 November 16th, 2007 04:52 AM
Taking the HTML and Displaying it in iFrame NomadMan Javascript How-To 1 August 17th, 2007 12:16 AM
Display html on another computer Lionel_Neo General .NET 2 October 13th, 2004 02:15 AM



All times are GMT -4. The time now is 05:47 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.