473,395 Members | 1,462 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Basic question

I'm having a bit of trouble understanding how to get an
asp.net page to look and feel like the asp page I have
already created. It's a basic login page, which I have
attempted to create in the vs html editor as so (just the
form code):

<form id="Form1" method="post" runat="server">

<asp:table id="Table1" runat="server"
HorizontalAlign="Center" CssClass="LogInHead"
Width="300px">

<asp:TableRow CssClass="LogIn">
<asp:TableCell Text="Log In to EPES"></asp:TableCell>
</asp:TableRow>

</asp:table>

<asp:table id="Table2" HorizontalAlign="Center"
CssClass="LogInBody" Width="300px" Runat="server">

<asp:TableRow>
<asp:TableCell CssClass="LogInDesc" Text="User
ID:"></asp:TableCell>
<asp:TableCell CssClass="LogInCtrl">
<asp:TextBox ID="txtUID" runat="server" Width="150px"
MaxLength="20" />
</asp:TableCell>
</asp:TableRow>

<asp:TableRow>
<asp:TableCell CssClass="LogInDesc"
Text="Password:"></asp:TableCell>
<asp:TableCell CssClass="LogInCtrl">
<asp:TextBox ID="txtPassword" Runat="server"
Width="150px" MaxLength="20" TextMode="Password" />
</asp:TableCell>
</asp:TableRow>

<asp:TableRow>
<asp:TableCell>
<asp:Button ID="btnSubmit" Runat="server" Text="Log In" />
</asp:TableCell>
</asp:TableRow>
</asp:table>
</form>

I have tried to drag a button on to the table control in
the designer (which didn't work). The method I have used
above displays the page the way I want it to, but I can't
seem to find a way to link the controls (specifically the
button) to a server-side event.

Any help (or any links) would be greatly appreciated.

Paul K
Nov 17 '05 #1
3 1531
the table control you are using is for showing data or programatically
adressing it somehow. for your example you do not neet this, draw a
normal table instead (from the menu bar, bot the toolbox). ie use
<table>, not <asp:table>.

jj

Paul K wrote:
I'm having a bit of trouble understanding how to get an
asp.net page to look and feel like the asp page I have
already created. It's a basic login page, which I have
attempted to create in the vs html editor as so (just the
form code):

<form id="Form1" method="post" runat="server">

<asp:table id="Table1" runat="server"
HorizontalAlign="Center" CssClass="LogInHead"
Width="300px">

<asp:TableRow CssClass="LogIn">
<asp:TableCell Text="Log In to EPES"></asp:TableCell>
</asp:TableRow>

</asp:table>

<asp:table id="Table2" HorizontalAlign="Center"
CssClass="LogInBody" Width="300px" Runat="server">

<asp:TableRow>
<asp:TableCell CssClass="LogInDesc" Text="User
ID:"></asp:TableCell>
<asp:TableCell CssClass="LogInCtrl">
<asp:TextBox ID="txtUID" runat="server" Width="150px"
MaxLength="20" />
</asp:TableCell>
</asp:TableRow>

<asp:TableRow>
<asp:TableCell CssClass="LogInDesc"
Text="Password:"></asp:TableCell>
<asp:TableCell CssClass="LogInCtrl">
<asp:TextBox ID="txtPassword" Runat="server"
Width="150px" MaxLength="20" TextMode="Password" />
</asp:TableCell>
</asp:TableRow>

<asp:TableRow>
<asp:TableCell>
<asp:Button ID="btnSubmit" Runat="server" Text="Log In" />
</asp:TableCell>
</asp:TableRow>
</asp:table>
</form>

I have tried to drag a button on to the table control in
the designer (which didn't work). The method I have used
above displays the page the way I want it to, but I can't
seem to find a way to link the controls (specifically the
button) to a server-side event.

Any help (or any links) would be greatly appreciated.

Paul K


Nov 17 '05 #2
jj,

Thanks! The asp.net paradigm makes much more sense to me
now.

Paul K
Nov 17 '05 #3
There are a few ways to link an event to a button.

1. You can specify in the ASP:Button tag an OnClick that
has a method. This will require that you know the
parameters of the method Object o, System.EventArgs e

2. double click on the button in design view. This is
for those who are either 1 lazy and looking for a
shortcut, or 2 don't know how the programming language
uses Methods. This method will create the shell of a
function for you with the parameters and draw the mapping
between the button and the event method. This method
does not always work depending on how technical your page
is and if you have your button nested in a grid, etc.

3. (this if for the VB developers) Create a button in
HTML, Create a Method in the code. After the method
declaration, append Handles buttonname.click

4. (this is for the C# developers) Create a button in
the HTML, Create your method with the appropriate
parameters. Go to the System Generated code
InitializeCompontent section and create your Delegate
method reference. For example...
this.btnCancel.Click += new System.EventHandler
(this.btnCancel_Click);
If you realy want to understand what is going on, you
should use either option 3 or option 4. It will make you
a better programmer in the long run.

Good Luck,

Keith
-----Original Message-----
I'm having a bit of trouble understanding how to get an
asp.net page to look and feel like the asp page I have
already created. It's a basic login page, which I have
attempted to create in the vs html editor as so (just theform code):

<form id="Form1" method="post" runat="server">

<asp:table id="Table1" runat="server"
HorizontalAlign="Center" CssClass="LogInHead"
Width="300px">

<asp:TableRow CssClass="LogIn">
<asp:TableCell Text="Log In to EPES"></asp:TableCell>
</asp:TableRow>

</asp:table>

<asp:table id="Table2" HorizontalAlign="Center"
CssClass="LogInBody" Width="300px" Runat="server">

<asp:TableRow>
<asp:TableCell CssClass="LogInDesc" Text="User
ID:"></asp:TableCell>
<asp:TableCell CssClass="LogInCtrl">
<asp:TextBox ID="txtUID" runat="server" Width="150px"
MaxLength="20" />
</asp:TableCell>
</asp:TableRow>

<asp:TableRow>
<asp:TableCell CssClass="LogInDesc"
Text="Password:"></asp:TableCell>
<asp:TableCell CssClass="LogInCtrl">
<asp:TextBox ID="txtPassword" Runat="server"
Width="150px" MaxLength="20" TextMode="Password" />
</asp:TableCell>
</asp:TableRow>

<asp:TableRow>
<asp:TableCell>
<asp:Button ID="btnSubmit" Runat="server" Text="Log In" /></asp:TableCell>
</asp:TableRow>
</asp:table>
</form>

I have tried to drag a button on to the table control in
the designer (which didn't work). The method I have usedabove displays the page the way I want it to, but I can'tseem to find a way to link the controls (specifically thebutton) to a server-side event.

Any help (or any links) would be greatly appreciated.

Paul K
.

Nov 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: pauldepstein | last post by:
I am reading Grimshaw and Ortega's "C++ and Numerical Methods." They construct a vector class which contains the variable vec, a float* variable where the length of the array (number of...
6
by: DH | last post by:
I have a VERY basic question about figuring database size. I've inherited a database which is generally similar to this basic one: Item, Red, Blue, Green, Yellow (text), (int),(int),(int),(int)...
9
by: Malcolm | last post by:
After some days' hard work I am now the proud possessor of an ANSI C BASIC interpreter. The question is, how is it most useful? At the moment I have a function int basic(const char *script,...
4
by: Ramesh | last post by:
hi, Let me ask some basic questions. Can anybody explain me about the following questions: 1. When we have to create sn key? Whenever we compiled Component we have to create or it is a one time...
13
by: Pete | last post by:
I'm cross posting from mscom.webservices.general as I have received no answer there: There has been a number of recent posts requesting how to satisfactorily enable BASIC authorization at the...
5
by: Aussie Rules | last post by:
Hi, Having a mental block on this one. Have done it before but can't rack my brain on how... I have an object, with a bunch on property, and I add that object to a combo box. I want the...
4
by: MikeB | last post by:
I've been all over the net with this question, I hope I've finally found a group where I can ask about Visual Basic 2005. I'm at uni and we're working with Visual Basic 2005. I have some books, ...
1
by: frankhanretty | last post by:
Do I have to install Visual basic on the remote terminals as I did on the server? I have an visual basic 5 application running fine on my client's server and he is now networked. He wants to run the...
4
by: Chris Asaipillai | last post by:
Hi there My compay has a number of Visual Basic 6 applications which are front endeed onto either SQL Server or Microsoft Access databases. Now we are in process of planning to re-write these...
3
by: Scott Stark | last post by:
Hello, I'm trying to get a better handle on OOP programming principles in VB.NET. Forgive me if this question is sort of basic, but here's what I want to do. I have a collection of Employee...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.