Results 1 to 25 of 25

Thread: Showing a web page inside a literal control.

  1. #1

  2. #2

    Thread Starter
    Super Moderator Wokawidget's Avatar
    Join Date
    Nov 2001
    Location
    Headingly Occupation: Classified
    Posts
    9,632

    Re: Showing a web page inside a literal control.

    Nothing shows as that function has nothing to do with what I want. Hahaha.

    Boooo...OK, does anyone know the correct function for this?

    WOka

  3. #3
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,173

    Re: Showing a web page inside a literal control.

    Use an IFRAME

  4. #4

  5. #5
    Big D Danial's Avatar
    Join Date
    Jul 2000
    Location
    ASP.Net Forum
    Posts
    2,877

    Re: Showing a web page inside a literal control.

    this.Literal1.Text= "<iframe height=500 width=500 src='http://www.vbfourms.com'></iframe>";

    Hope it helps.
    Last edited by Danial; Jun 4th, 2005 at 04:31 PM.
    [VBF RSS Feed]

    There is a great war coming. Are you sure you are on the right side? Atleast I have chosen a side.

    If I have been helpful, Please Rate my Post. Thanks.

    This post was powered by :

  6. #6

    Thread Starter
    Super Moderator Wokawidget's Avatar
    Join Date
    Nov 2001
    Location
    Headingly Occupation: Classified
    Posts
    9,632

    Re: Showing a web page inside a literal control.

    Yup. Spot on cheers, just what I wanted
    But that's c#.net isn't it?

    for VB it's almost the same just minus the ;
    VB Code:
    1. Literal1.Text= "<iframe height=500 width=500 src='http://www.vbfourms.com'></iframe>"
    I'm splitting hairs. Bad Woka *slap*

    So, here's the big question. If you were writing a portal would u show the pages (components) of the portal like that?

    Woof

  7. #7
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,173

    Re: Showing a web page inside a literal control.

    No, I wouldn't.

    I'd make a web user control and include that in my page.

  8. #8

    Thread Starter
    Super Moderator Wokawidget's Avatar
    Join Date
    Nov 2001
    Location
    Headingly Occupation: Classified
    Posts
    9,632

    Re: Showing a web page inside a literal control.

    So, you''d have a web user control and then pass some values to some custom functions?

    Inside the control would you use an Iframe?

    Woof

  9. #9

    Thread Starter
    Super Moderator Wokawidget's Avatar
    Join Date
    Nov 2001
    Location
    Headingly Occupation: Classified
    Posts
    9,632

    Re: Showing a web page inside a literal control.

    OK. This is the test app I have been playing with.
    The idea is that the buttons (or links) will be DB driven, for different components/apps that get installed on the portal.

    The params code is rough, in fact the whole things rough, but it's only demoing a concept and is not actual production code.

    SO, if you were writing a portal would this be a good start?

    Woka
    Attached Files Attached Files

  10. #10
    Big D Danial's Avatar
    Join Date
    Jul 2000
    Location
    ASP.Net Forum
    Posts
    2,877

    Re: Showing a web page inside a literal control.

    I am not sure what you are requirements are, but i would suggest you have a look at DotNetNuke Portal. Its open source and written in VB.Net. We have just started using it at work and I have written plugins/modules to extend its functionality to met our business needs. It has been creted with the co-opertion of MS and endorsed by MS too. Its worth a look i would say if you are planning to write a portal. You may be able to use its core functionality and simply extend it to meet your needs.

    http://www.dotnetnuke.com/
    Last edited by Danial; Jun 5th, 2005 at 09:57 AM.
    [VBF RSS Feed]

    There is a great war coming. Are you sure you are on the right side? Atleast I have chosen a side.

    If I have been helpful, Please Rate my Post. Thanks.

    This post was powered by :

  11. #11

    Thread Starter
    Super Moderator Wokawidget's Avatar
    Join Date
    Nov 2001
    Location
    Headingly Occupation: Classified
    Posts
    9,632

    Re: Showing a web page inside a literal control.

    Have looked at that in the past, but not recently. Admittedly, when I have looked at it in the past my knowledge of .NET was no where near what it is now, so I found it extremelt confusing and complicated.
    Installing it again now.

    OK. IMO I don't like using IFrames
    Regardless, of where this is right or wrong, does anyone know how to put the web page into a literal control without using iframes...so that when I do a view source I see the entire source, and not just that for the Main.aspx page.

    Woka

  12. #12
    Big D Danial's Avatar
    Join Date
    Jul 2000
    Location
    ASP.Net Forum
    Posts
    2,877

    Re: Showing a web page inside a literal control.

    Have looked at that in the past, but not recently. Admittedly, when I have looked at it in the past my knowledge of .NET was no where near what it is now, so I found it extremelt confusing and complicated.
    Installing it again now.
    Yes its a bit confusing intially, once you spend some time and get your head around it, its not really that complex. Also you dont need to understand how it works 100%, you just need to know how you can create Modules and intigrate it to DNN. I have written step by step guide, I will post it when you get to that part.

    OK. IMO I don't like using IFrames
    Regardless, of where this is right or wrong
    Same here, i had found many disadvantages.

    does anyone know how to put the web page into a literal control without using iframes...so that when I do a view source I see the entire source, and not just that for the Main.aspx page.

    Woka
    Here is how i would get the source and place it into a literal control. Its in C# if you have problem converting it let me know

    Code:
    	public static string GetSource(string webAddress) 
    		{ 
    			try 
    			{ 
    				WebRequest WReq =  WebRequest.Create(webAddress); 
    				WebResponse WResp = WReq.GetResponse(); 
    				// get the stream of data 
    				StreamReader sr = new StreamReader(WResp.GetResponseStream(), Encoding.ASCII); 
    				string strTemp = ""; 
    				
    				strTemp = sr.ReadToEnd()
    				sr.Close(); 
    			} 
    			catch (WebException WebExcp) 
    			{ 
    				//MessageBox.Show(WebExcp.Message); 
    			} 
    			return strTemp; 
    		}
    [VBF RSS Feed]

    There is a great war coming. Are you sure you are on the right side? Atleast I have chosen a side.

    If I have been helpful, Please Rate my Post. Thanks.

    This post was powered by :

  13. #13
    Addicted Member
    Join Date
    Aug 2004
    Location
    Cape Town, South Africa
    Posts
    149

    Re: Showing a web page inside a literal control.

    I dont have an answer for you, but why don't u try using placeholders and user controls? They are easy to work with and simple to design...

  14. #14

    Thread Starter
    Super Moderator Wokawidget's Avatar
    Join Date
    Nov 2001
    Location
    Headingly Occupation: Classified
    Posts
    9,632

    Re: Showing a web page inside a literal control.

    I am

    How on earth do you get DotNetNuke to install the DB and all the SPs etc?

    I can't find any documentation anywhere....Aghhhh. It's just been one of those days

    Woof

  15. #15

  16. #16
    Big D Danial's Avatar
    Join Date
    Jul 2000
    Location
    ASP.Net Forum
    Posts
    2,877

    Re: Showing a web page inside a literal control.

    Quote Originally Posted by Wokawidget
    I am

    How on earth do you get DotNetNuke to install the DB and all the SPs etc?

    I can't find any documentation anywhere....Aghhhh. It's just been one of those days

    Woof
    First time I tried installing DNN it took me 3 days of trying to install it
    .

    The documentation is in your C:\DotNetNuke\Documentation\Public\DotNetNuke Installation Guide.pdf folder.

    Make sure you create the DB with Proper Permission and Specify your ServerName, Username and Password details in the Web.Confi File, before you start your installation. The Element Name is "SiteSqlServer" in the web.config that you need to modify.

    What error are you getting?

    As for getting the source here is a similar code in VB.Net http://www.vbforums.com/showthread.p...ght=webrequest
    [VBF RSS Feed]

    There is a great war coming. Are you sure you are on the right side? Atleast I have chosen a side.

    If I have been helpful, Please Rate my Post. Thanks.

    This post was powered by :

  17. #17

    Thread Starter
    Super Moderator Wokawidget's Avatar
    Join Date
    Nov 2001
    Location
    Headingly Occupation: Classified
    Posts
    9,632

    Re: Showing a web page inside a literal control.

    Right, got it working
    Found the documentation after I posted. D'oh!

    What I was doing wrong was something to do with SQL server permissions for the user Woof.
    In the end I just changed the login to use SA and then it installed everything.

    Having a play now.
    Can't get it to run in .NET IDE as it says I am not allowed to debug. I have had this error before on other apps, but have forgotten what needs doing.

    I know Debug needs to = True in the config section, but it does.

    woof

  18. #18
    Big D Danial's Avatar
    Join Date
    Jul 2000
    Location
    ASP.Net Forum
    Posts
    2,877

    Re: Showing a web page inside a literal control.

    You dont have VS.Net 2005 by any chance do you?If so then make sure your application is using Framework Version 1.1xx isntead of 2.xxx, you can specify that in the IIS by clicking on Property of the IIS Application.

    Also make sure Debug is enabled in the Project itself. You can check it by Right Clicking on Individual Project with-in your solution (in your case "DotNetNuke") and slecting "Configuratin Properties" and make sure "ASP.Net Debugging" is checked.

    These are 2 possible reasons why you are not able to debug in the .Net IDE.

    Hope it helps.
    [VBF RSS Feed]

    There is a great war coming. Are you sure you are on the right side? Atleast I have chosen a side.

    If I have been helpful, Please Rate my Post. Thanks.

    This post was powered by :

  19. #19

    Thread Starter
    Super Moderator Wokawidget's Avatar
    Join Date
    Nov 2001
    Location
    Headingly Occupation: Classified
    Posts
    9,632

    Re: Showing a web page inside a literal control.

    OK...played with Nuke a bit.
    Still can't convert your C# code I suck. Can I ask for some help?

    What do you know about MaterPages?

    Woka

  20. #20
    Big D Danial's Avatar
    Join Date
    Jul 2000
    Location
    ASP.Net Forum
    Posts
    2,877

    Re: Showing a web page inside a literal control.

    OK...played with Nuke a bit.
    Still can't convert your C# code I suck. Can I ask for some help?
    Ofcourse, here is the VB.Net version, just put a button and a Literal control on your form.

    VB Code:
    1. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    2.         Dim StrURL As String = "http://www.vbforums.com"
    3.  
    4.         Dim objRequest As WebRequest = WebRequest.Create(StrURL)
    5.         Dim objResponse As WebResponse = objRequest.GetResponse()
    6.  
    7.         Dim strmReader = New StreamReader(objResponse.GetResponseStream())
    8.  
    9.  
    10.         Dim strContent As String = strmReader.ReadToEnd()
    11.  
    12.         Me.Literal1.Text = strContent
    13.     End Sub

    What do you know about MaterPages?
    I have read about MasterPages, but have never actualy used them. According to my understanding MasterPage is a sort of Template which you can design in asp.net 2.0 and then use that your base page. This will allow you to design a look and feel of your site once and then simply use that same design in every page. A kind of like a skin in DotNetNuke...

    I havent done much asp.net 2.0 yet, only tried with the new IDE when VS.Net 2005 expresss came out. Just got my VS.Net 2005 Beta 2 CD on the post yesterday, will install it soon and start using it. Heard a lot of good things specially for VB.Net users.

    What is that you want to know about MasterPages?


    Hope it helps.
    [VBF RSS Feed]

    There is a great war coming. Are you sure you are on the right side? Atleast I have chosen a side.

    If I have been helpful, Please Rate my Post. Thanks.

    This post was powered by :

  21. #21

    Thread Starter
    Super Moderator Wokawidget's Avatar
    Join Date
    Nov 2001
    Location
    Headingly Occupation: Classified
    Posts
    9,632

    Re: Showing a web page inside a literal control.

    You've told me enough
    I don't have the Beta 2 on my PC. Not sure if I should put it on and develop in that or stick with 2003. What do you think?

    Cheers for the VB code

    One problem I have found with this is that it requires a virtual directory...would it be possible to have a folder with a web page in it, which would be relative to the root of my main aspx page, or would I need a Virtual Directory?

    Woka

  22. #22
    Big D Danial's Avatar
    Join Date
    Jul 2000
    Location
    ASP.Net Forum
    Posts
    2,877

    Re: Showing a web page inside a literal control.

    You've told me enough


    I don't have the Beta 2 on my PC. Not sure if I should put it on and develop in that or stick with 2003. What do you think?
    I have VS.Net 2002, 2003 and 2005 beta running side by side without any problem on my home machine. Only issue is when creating asp.net application you manually need to specify that you are using Framework Version 1.1 if you are not using VS.Net 2005 thats all. You can easily do that in IIS. I havent isntalled it in my work PC yet, i will wait for a while befor I do that .

    Cheers for the VB code
    You are very welcome.

    One problem I have found with this is that it requires a virtual directory...would it be possible to have a folder with a web page in it, which would be relative to the root of my main aspx page, or would I need a Virtual Directory?
    Woka
    I assumed the page you are reading were from external source thats why I suggested WebRequest. For that yes they will need to be in a virtual directory with a fully formed URL or IP.

    What exactly are you trying to do? Are you loading aspx pages(Created by You) within your project? If so then simply create them as Web User Control (ascx) and use LoadControl to load them into a Literal Control at runtime rather then using WebRequest code I gave you. That will far more efficient and you would not need virtual folder, just the path of the .ascx file. I posted an example on this forum, just look few thread down you will see. If not I will post an example tomorrow..

    You could try LoadControl on .aspx page, but i dont know if it will work as i have never tried them .

    Hope it helps.

    Apologies if I mislead you. Didnt read your first few post properly..


    Good luck, time for bed
    Last edited by Danial; Jun 12th, 2005 at 08:15 PM.
    [VBF RSS Feed]

    There is a great war coming. Are you sure you are on the right side? Atleast I have chosen a side.

    If I have been helpful, Please Rate my Post. Thanks.

    This post was powered by :

  23. #23

    Thread Starter
    Super Moderator Wokawidget's Avatar
    Join Date
    Nov 2001
    Location
    Headingly Occupation: Classified
    Posts
    9,632

    Re: Showing a web page inside a literal control.

    Nope you didn't mislead me. You gave me answers to the questions I ask. Sometimes it's good for people to make their own mistakes and go down the wrong road now and again.
    So hmmmm, loadings web controls, that's how MaterPages works doesn't it???

    I am writting a portal, but I wanted to try out many ways of of achieving this, and their pros and cons.

    Woka

  24. #24
    Big D Danial's Avatar
    Join Date
    Jul 2000
    Location
    ASP.Net Forum
    Posts
    2,877

    Re: Showing a web page inside a literal control.

    Sometimes it's good for people to make their own mistakes and go down the wrong road now and again.
    Totally agree...

    So hmmmm, loadings web controls, that's how MaterPages works doesn't it???

    I am writting a portal, but I wanted to try out many ways of of achieving this, and their pros and cons.
    I have not looked at the innerworking of masterPage, but in essence it is simply a aspx page which contains a <Form> tag, and when you include it in your page, all additional html and controls are added between the <form></form> tag. You would not be able to modify the MasterPage only the ChildPage.

    For your case LoadControl method will be the most efficient and the correct way to use. I think even DotNetNuke uses LoadControl for their Portal.

    I will try put together an example of LoadControl, if I get a chance in few hours or when I get home.

    Here are few examples I found on the net which might be helpful.
    http://aspalliance.com/565
    http://www.codeproject.com/aspnet/Lo...SerControl.asp

    Hope it helps.
    [VBF RSS Feed]

    There is a great war coming. Are you sure you are on the right side? Atleast I have chosen a side.

    If I have been helpful, Please Rate my Post. Thanks.

    This post was powered by :

  25. #25
    Big D Danial's Avatar
    Join Date
    Jul 2000
    Location
    ASP.Net Forum
    Posts
    2,877

    Re: Showing a web page inside a literal control.

    Woka here is an simple example of Loading control dynamically.

    Hope it helps.
    Attached Files Attached Files
    [VBF RSS Feed]

    There is a great war coming. Are you sure you are on the right side? Atleast I have chosen a side.

    If I have been helpful, Please Rate my Post. Thanks.

    This post was powered by :

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width