• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 374
  • Last Modified:

D8 aspx pages and dhtml and css and js

Hi all
I am new to .net, so I am looking for conceptual and practical help.

Typically an aspx file looks like

<%@ Page language="c#" Debug="true" Codebehind="ThankYouForm.pas" AutoEventWireup="false" Inherits="ThankYouForm.TWebForm2" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<html>
  <head>
    <title></title>
    <meta name="GENERATOR" content="Borland Package Library 7.1">
  </head>

  <body ms_positioning="GridLayout">
  <form runat="server">
    <asp:label id=Label1 style="LEFT: 14px; TOP: 6px" runat="server">     Thank you for your request. A link to the download site will be emailed to
    you shortly.     </asp:label>
  </form>
</body>
</html>

Q1. I assume that I am free to edit this manually, however I wish eg add in standard html.
Is this true inside a form that has runat="server" ? can I just throw in a table or a paragraph or an H1 inside that form?

Q2. In the above example, there does not seem to be any advantage in having the server build this page .. ?? or am I missing something

Q3.  I'd like to use external stylesheets. Can I edit the above like so ?

  <form class=myformclass runat="server">
    <asp:label class=mylabelclass id=Label1 style="LEFT: 14px; TOP: 6px" runat="server">     Thank you for your request. A link to the download site will be emailed to
    you shortly.     </asp:label>
  </form>

Q4. From the examples I have seen, the code is littered with embedded absolute positioning statements .. is there some way to clean this up?

Q5. Client side js and dhtml. Can I edit the above to include some client side script (eg for validation), and can I access the DOM in the normal way ?

some example code would be nice

Q6.  I have been talking about MANUALLY EDITING the generated aspx file .. it occurs to me that there might be some features in the IDE that I have not found yet that will help me  in inserting  client side script and event handlers and styles and stylesheets.. if so, where are they?

Q7.  What if I already have an existing HTML page that makes heavy use of JS and CSS and DHTML .. how can I port this, easily, to aspx?

General advice and code examples and pointers would be most welcome.

Thank you
0
Mutley2003
Asked:
Mutley2003
2 Solutions
 
Mohammed NasmanSoftware DeveloperCommented:
Hello

Q1. Yes

Q2. Most of the server side logic write into code behind class, look on the page directive "Codebehind="ThankYouForm.pas"  which the delphi class that related to this web form.

Q3. Should no problem

Q4. You need to change the PageLayout to FlowLayout instead of GridLayout

Q5. Didn't understand that

Q6. mmm, I'm not sure, but try DreamWeaver, it's the best for editing page, also has support for asp/php and asp.net

Q7. If you have Html page, just add it to the project, then convert it to aspx, and should be handled without problem

I mostly work with C# and Vb.Net for asp.net, but the same concept valid for all .net development,

HTH

regards,
Mohammed
0
 
BlackTigerXCommented:
Q1. DreamWeaver (latest version) gives you a lot more flexibility to do all that kind of stuff

Q2. The advantage is that you can change the value of that label with a value from the server (a database, configuration or whatever)
if all there is is HTML, .NET will cache that and will serve the pages pretty fast, no worry there

Q5. Yes, you can add any custom javascript and hook it to any buttons (the buttons have to be HTML Controls, not Web Controls)

Q6. for validation specifically there is the Validators (RequiredFieldValidator, CompareValidator, RangeValidator, etc...) you just drop those in your form and set the required properties (ControlToValidate, ErrorMessage, etc) and they do all the "magic" for you
0
 
Mutley2003Author Commented:
ok, I am getting there, thanks for the help
0

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now