Problem in Asp page cannot get data from a html page

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Vkas
    New Member
    • Feb 2009
    • 78

    Problem in Asp page cannot get data from a html page

    my html page is (default.html)
    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <title>BWR&MD</title> 
        <meta http-equiv="Content-Type" content="text/html; charset=windows-1252" />
        <meta content="Microsoft FrontPage 4.0" name="GENERATOR" />
        <meta content="FrontPage.Editor.Document" name="ProgId" />
    </head>
    <body>
        <center>
            <p>
                &nbsp;</p>
            <p style="text-align: center">
                &nbsp;<br />
                <br />
                <br />
                <br />
                <strong><em><span style="color: #cc33ff">BY THE NAME OF ALLAH&nbsp;</span></em></strong></p>
            <form action="try.asp" method="post">
                <p>
                    &nbsp;&nbsp;&nbsp;&nbsp; Name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;: 
                    <input type="text" size="20" name="Name" />
                    <br />
                    <br />
                 &nbsp;&nbsp;&nbsp; Password : 
                   <input type="password" size="20" name="Pas" />
                </p> 
                Color&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : 
                <select size="1" name="Color">
                    <option selected="selected">Red</option>
                    <option>Green</option>
                    <option>Blue</option>
                </select>
                <br />
                <br />
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
                <input type="submit" value="  LOGIN   " name="B1" />
                <p>
                    <font color="#660000">Developed <span style="color: #000000">By ATptech</span></font></p>
                <p>
                    &nbsp;</p>
            </form>
        </center>
    </body>
    </html>
    my asp page (try.asp) with c# as coding
    Code:
    <%@ Page Language="C#"Debug="true" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <title>Test</title>
    </head>
    <body>
        <h4> Welocme Students user.aspx shown with vb as a coding page</h4>
        <%
       [B][I]' (HOW CAN I GET DATA FROM That Htm page form in try.asp page )[/I][/B]
    %>
    </body>
    </html>
    Can any one tell how to code in c# to get data ???
    Last edited by jhardman; Feb 1 '10, 06:49 AM. Reason: added code tags
  • jhardman
    Recognized Expert Specialist
    • Jan 2007
    • 3405

    #2
    1- You cannot code an ASP page (file extension .asp or .jsp) in C#. The possible languages are jscript (which has a similar language syntax to C#, but I don't know anyone who uses it, so I couldn't help you with that) and VBScript (the language most of us use). You could write ASP.NET pages (file extension .aspx) in C#. If that is what you are trying to do, please post in the ASP.NET forum (notice this is the ASP forum, not the ASP.NET forum). Looking over the code you have above it looks like you have pulled code from some ASP.NET sources and some ASP sources. Please note that although they are both Microsoft technologies, they are not compatible.

    2- Getting form inputs in ASP is very easy, for example, if you wanted to just print out the form input you could say this:
    Code:
    <h4> Welocme Students</h4>
    <%
    response.write request.form("Name")
    %>
    </body>
    </html>
    Please let me know if this helps.

    Jared

    Comment

    Working...