CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6

Thread: Using HTML pages with ASP.NET websites

  1. #1
    Join Date
    Jun 2006
    Posts
    645

    Using HTML pages with ASP.NET websites

    Hi,
    I have already posted this Q in ASP.NET forums without much luck. But since it involves fair amount of C#, I would like to post the same on this forum.
    I want to know whether we can directly leverage HTML pages and controls with a server side code (business logic) in C# (or other .NET language)?
    More details of this discussion can be found at:
    Anybody done this or atleast come across such an architecture?
    Thanks,
    Bhushan

  2. #2
    Join Date
    Jul 2006
    Posts
    297

    Re: Using HTML pages with ASP.NET websites

    Theres nothing wrong with using ASP.NET it's all how you code it. If you use all the server controls available and the built in .NET Ajax you're going to have very messy html code which in fact does render slow.

    It's not the HTML Page itself that is faster its the lack of processing that has to go on to get the data and transform it. ASP.NET does have a little overhead for the pages just because of the framework it uses to construct all the controls.

    Lets say you did manage to get an HTML page with business logic, you're still going to have to run that same C# code to get whatever data you needed or process something and it's not going to do that any faster just because its an HTML page. So now you're left with the only difference being the small overhead for loading a .aspx page. Also assuming that such technology did exist where you could use an HTML page with business logic and that a framework based around that technology was any quicker than ASP.NET.

    I guess what i'm trying to say is that HTML pages aren't "Faster" because they do things quicker. It's because they're limited and all they need to do is be requested by the browser and rendered. When you start involving any type of business logic you loose all that extra speed. Stick with ASP.NET and stay away from using most of the Built-In controls that seem to make you're life 10x easier like GridViews / .NET Ajax try to use the Repeater control as much as possible its much lighter weight and just as powerful once you learn to use it. Stay away from the controls that are horribly inefficient and you'll be fine using ASP.NET.

  3. #3
    Join Date
    Jun 2006
    Posts
    645

    Re: Using HTML pages with ASP.NET websites

    Hey ...first of all thanks for the detailed reply to my Q
    I meant exactly the same. Rendering HTML to the browser is just a part of what I asked here. At this point, I am thinking in terms of possiblities of knowing another architecture. Whether it would be efficient or not remains a bigger topic of discussion because there are a lot of issues in that. First let me ask one Q: Can C# or VB.NET as an OO language interact directly with the HTML pages? By interaction, I mean the server side code and the class, events and namespaces that have such a functionality in .NET framework? Also let us break down this big Q into small pieces...
    - Can HTML page have a direct interaction with C#?
    - Can Java Script run on server side ?? I know it runs on client side...
    - Can Javascript act as a connecting layer between C# and HTML thus making it possible?
    - Can we get hold of browser and then do the honors of interacting with doc object exposed by it? - And thus interact with the content in it which happens to be HTML, Java script and CSS?
    - Are there any interfaces exposed by .NET for building such type of architecture?
    So looking at these Q, you can see where I am going....If my fears come true, it might take me to no where....but I will try my luck...anywayz I am just thinking of a possibility and no one is going grab me and ask me to meet any deadlines....
    So the Q still remains...sorry if my post Q before was misleading as to what I was intending to ask...
    Thanks,
    Bhushan

  4. #4
    Join Date
    Jul 2006
    Posts
    297

    Re: Using HTML pages with ASP.NET websites

    One thing you need to realize about HTML is it doesn't do ANYTHING. Its a markup language, all it knows how to do is display data. HTML doesn't even know that 1 + 2 = 3. JavaScript is used to manipulate the HTML / CSS and thats it. Because of the security issues JavaScript cannot connect to C# code, the closest thing you will get is AJAX but even then you're going from JavaScript to HTTP to C# to HTTP to JavaScript.

  5. #5
    Join Date
    Jun 2006
    Posts
    645

    Re: Using HTML pages with ASP.NET websites

    Yes ....u r right ...that is what I want....HTML to Javascript....Java script tp C#. I am just trying to divulge one of the architectures I have seen. Let me tell u more...they had been AJAX-like thing before MS launched it! I mean they just implemented the javascript Asynchronously. I cannot explain, but it certainly helps in component oriented approach. That said, from your perspective, there would be some loss of performance and I agree to that. But the Asynchronous functionality they implemented I never got a chance to learn about that. May be a deeper look in to AJAX would help me to do so. Again, I am not justifying any one approach over the other...but still trying to get to know how it would be done....
    Thanks,
    Bhushan

  6. #6
    Join Date
    Oct 2009
    Posts
    3

    Re: Using HTML pages with ASP.NET websites

    First thing U should know that HTML is a mark up language. It doesn't has own browser. And it doesn't do anything. As monalin told HTML to JavaScript and JavaScript to C# that's totally correct. Thanksssssssssss...................Keep post...............


    ________________________________

    http://www.4net-technologies.co.uk/

Posting Permissions

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


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)