Showing posts with label input. Show all posts
Showing posts with label input. Show all posts

Saturday, March 24, 2012

Suggestions for best Development Environment??

Any input would be greatly appreciated…HELP ME!!!...to get back to coding comfortably!!!!

I'm trying to decide which development environment would be best for me…I haven't been coding for about a year and need to get back and rolling!

I've used FrontPage and Visual Interdev. (I prefer the Interdev coding environment…but FrontPage was always easier to use at home with Personal Web Server….wasn't crazy about Personal Web Server but it did the trick…and never could stand the 'web bots' in Front Page!)

Originally bought FrontPage98 and upgraded to FrontPage2000. I own VisualStudio6. Took some ASP.net classes and have a trial version of Visual Studio.net Pro (but it's version 2002)…, which I never did install because of my old PC.

When I code sites, I manually code HTML (don't use WYSIWYG functionality) and like to use tables, asp code for includes (very important to me), and code to pull data from Access databases. And I like the intellisense feature.

I just purchased a new laptop which is running TabletPC. I decided to purchase the latest FP2003 thinking it must have great updates. I pretty much assumed that this new OS (TabletPC) would have IIS and anything else I needed. I installed FP2003 and upon trying to code up some ASP pages, I see that the Help pages are pointing me in the direction of, I think, SharePoint, etc. I don't really want to go in this direction…would prefer to go more the developer route than the design route…and I'm thinking should go more toward ASP.net or latest Visual Studio route or maybe Macromedia Dreamweaver would be my best bet?

Ya know, I just want to code up some sites locally (my laptop only…no servers involved, except for IIS or PWS)(basically just moving from my antiquated desktop to the laptop), with the intention of copying the sites up to my ISP for hosting (these would be small company sites….no big frills…).

I've spent a fair amount of time searching through MS (including forums) for answers…and just decided I should ask since I can't seem to find any definitive information.

1. Will TabletPC OS support coding of ASP…(well, I know it will, but what do I need to do (without going the SharePoint route))? When I look in Administration Tools on my laptop, I do not see IIS.

2. Please give me good suggestions for which development environment you suggest for coding my sites if my main preferences are manual HTML, ++include files, coding for access to Access db's (and a local server).

Wondering if I should start fresh with latest version of ASP.net or maybe Macromedia Dreamweaver, but have not used either. Since I haven't been coding in a corporate environment for awhile, I'm not sure of the best configuration and I need a good starting point so that I'm technically up to date without a lot of complication. I'm looking for the right environment that is not overly complicated but does have the capabilities going forward to accommodate me as I grow and am able to take advantage of advanced features. I can work my way through some problems, but don't want to consistently have to be going to MS site to find answers to simple functionality….or be consistently faced with problems! And don't want to load up my PC with lots of products just trying them out…and spending soooo much time sorting through them. And don't want to load old software…want to start fresh and go forward!

On this site alone I see ASP.net 1.1, ASP.net 2.0, Visual Web Developer 2005 Express…i..yi..yi!!!!! …Web Developer Express?...

Looks like Web Matrix might give me what I need…but looks like it might be going bye-bye…(see what I mean!), can I use Javascript and VBscript, what shortcomings do you see, how would it compare to Dreamweaver?

I love coding sites and learning this technology!!!!! Need to get some sites coded up. Right now feel like I'm stuck at GO! Please help me get my party started!!!!

simpleone--
Regarding this...

simpleone wrote:

...1. Will TabletPC OS support coding of ASP…(well, I know it will, but what do I need to do (without going the SharePoint route))? When I look in Administration Tools on my laptop, I do not see IIS...


...I am sorry; but, I do not know. I do know, however, that this is probably the most important question that you are asking.
Actually, if you are serious about development, I suggest that you exchange the TabletPC and get a notebook running Windows XP Pro or Windows 2003 Server. That would be the way to go. If you cannot do that, then you may have trouble running IIS or ASP.NET 2.0 on the TabletPC; so, you will then be stuck.
Also, note that you want to make sure that you make the distinction between ASP and ASP.NET when you are researching this. In short, you want to forget about ASP entirely and simply address ASP.NET because ASP is certainly dead.
In short, the primary web development approaches today are ASP.NET, Java, and (maybe) PHP.
Regarding this...

simpleone wrote:

...2. Please give me good suggestions for which development environment you suggest for coding my sites if my main preferences are manual HTML, ++include files, coding for access to Access db's (and a local server)...


...it sounds like Visual Web Developer Express 2005 (VWDE) would be great for you. Note that a Microsoft site,http://lab.msdn.microsoft.com/express/readme/ , basically states that VWDE will run on Windows 2000, Windows XP, and Windows 2003 Server. Again, it gets back to the choice of the TabletPC. It looks like you MAY be in luck because according to a Microsoft site,http://www.microsoft.com/windowsxp/tabletpc/default.mspx , states that the TabletPC runs "Windows XP Table PC Edition". Will that run Visual Studio 2003? Will that run VWDE? One way to find out is to simply try. Try installing VWDE. It is free. If it installs, then you are all set. If not, then you might need to pick something else, like a pure-HTML tool.
Regarding this...

simpleone wrote:

...On this site alone I see ASP.net 1.1, ASP.net 2.0, Visual Web Developer 2005 Express…i..yi..yi!!!!! …Web Developer Express?...Looks like Web Matrix might give me what I need…but looks like it might be going bye-bye…(see what I mean!)...


...you are absolutely right. Pre-marketing ASP.NET 2.0 (for well over a year now) is a big mistake (IMHO). Microsoft should not publically release products in beta. It just makes matters too confusing. However, since it is done, and since you are starting out more or less fresh, then VWDE is probably a good choice (if you can get it to run on the TabletPC).
Finally, forget about "includes" and (if you dare) JavaScript. Why? Well, "includes" are replaces by classes and user controls and other features. JavaScript can be turned off by the enduser so it is not reliable as a critical path technology. (Caveat-- JavaScript is hard to get away from entirely; but, web developers would do well to avoid it as much as feasible.)
Note that this is all just my opinion; so, read it as such, please.
HTH.

Suggestions to prevent VICIOUS data input?

Using ASP.NET 2.0/SQL Express...

In places where I allow data input by users (sign up forms, comments,
etc...) do I need to manually safeguard my site against vicious attacks (SQL
injection, etc...)? Should I just run all input thru a filter that removes
all special characters, like asterick, semicolon, etc...? Or, is this
handled internally so I don't have to worry about it? Any suggestions?

Thanks.VB Programmer wrote:
> Using ASP.NET 2.0/SQL Express...
> In places where I allow data input by users (sign up forms, comments,
> etc...) do I need to manually safeguard my site against vicious attacks (SQL
> injection, etc...)? Should I just run all input thru a filter that removes
> all special characters, like asterick, semicolon, etc...? Or, is this
> handled internally so I don't have to worry about it? Any suggestions?
> Thanks.

It depends... You can validate your form entries with regular
expressions (client side AND server side) and the like. Other than that,
the main thing is using parameterized queries - *NOT* string
concatenation to make your SQL queries (that's really asking for
trouble). That would be a good start :) ASP.NET also does protect you to
some extent.
john smith wrote:
> VB Programmer wrote:
> > Using ASP.NET 2.0/SQL Express...
> > In places where I allow data input by users (sign up forms, comments,
> > etc...) do I need to manually safeguard my site against vicious attacks (SQL
> > injection, etc...)? Should I just run all input thru a filter that removes
> > all special characters, like asterick, semicolon, etc...? Or, is this
> > handled internally so I don't have to worry about it? Any suggestions?
> > Thanks.
> It depends... You can validate your form entries with regular
> expressions (client side AND server side) and the like. Other than that,
> the main thing is using parameterized queries - *NOT* string
> concatenation to make your SQL queries (that's really asking for
> trouble). That would be a good start :) ASP.NET also does protect you to
> some extent.

What he said ^

Also, when using regular expressions, look for GOOD input, and reject
anything that doesn't match. Doing it the other way around, you're
bound to miss something...

Damien
Hi, as part of your research, you should investigate a product I wrote that
handles SQL Injection and Cross Site Scripting attacks. It is VAM: Visual
Input Security. (http://www.peterblum.com/vise/home.aspx)

-- Peter Blum
www.PeterBlum.com
Email: PLBlum@.PeterBlum.com
Creator of "Professional Validation And More" at
http://www.peterblum.com/vam/home.aspx

"VB Programmer" <dont@.emailme.com> wrote in message
news:eGdttg6JGHA.916@.TK2MSFTNGP10.phx.gbl...
> Using ASP.NET 2.0/SQL Express...
> In places where I allow data input by users (sign up forms, comments,
> etc...) do I need to manually safeguard my site against vicious attacks
> (SQL injection, etc...)? Should I just run all input thru a filter that
> removes all special characters, like asterick, semicolon, etc...? Or, is
> this handled internally so I don't have to worry about it? Any
> suggestions?
> Thanks.

Suggestions to prevent VICIOUS data input?

Using ASP.NET 2.0/SQL Express...
In places where I allow data input by users (sign up forms, comments,
etc...) do I need to manually safeguard my site against vicious attacks (SQL
injection, etc...)? Should I just run all input thru a filter that removes
all special characters, like asterick, semicolon, etc...? Or, is this
handled internally so I don't have to worry about it? Any suggestions?
Thanks.VB Programmer wrote:
> Using ASP.NET 2.0/SQL Express...
> In places where I allow data input by users (sign up forms, comments,
> etc...) do I need to manually safeguard my site against vicious attacks (S
QL
> injection, etc...)? Should I just run all input thru a filter that remove
s
> all special characters, like asterick, semicolon, etc...? Or, is this
> handled internally so I don't have to worry about it? Any suggestions?
> Thanks.
>
It depends... You can validate your form entries with regular
expressions (client side AND server side) and the like. Other than that,
the main thing is using parameterized queries - *NOT* string
concatenation to make your SQL queries (that's really asking for
trouble). That would be a good start :) ASP.NET also does protect you to
some extent.
john smith wrote:
> VB Programmer wrote:
> It depends... You can validate your form entries with regular
> expressions (client side AND server side) and the like. Other than that,
> the main thing is using parameterized queries - *NOT* string
> concatenation to make your SQL queries (that's really asking for
> trouble). That would be a good start :) ASP.NET also does protect you to
> some extent.
What he said ^
Also, when using regular expressions, look for GOOD input, and reject
anything that doesn't match. Doing it the other way around, you're
bound to miss something...
Damien
Hi, as part of your research, you should investigate a product I wrote that
handles SQL Injection and Cross Site Scripting attacks. It is VAM: Visual
Input Security. (http://www.peterblum.com/vise/home.aspx)
-- Peter Blum
www.PeterBlum.com
Email: PLBlum@.PeterBlum.com
Creator of "Professional Validation And More" at
http://www.peterblum.com/vam/home.aspx
"VB Programmer" <dont@.emailme.com> wrote in message
news:eGdttg6JGHA.916@.TK2MSFTNGP10.phx.gbl...
> Using ASP.NET 2.0/SQL Express...
> In places where I allow data input by users (sign up forms, comments,
> etc...) do I need to manually safeguard my site against vicious attacks
> (SQL injection, etc...)? Should I just run all input thru a filter that
> removes all special characters, like asterick, semicolon, etc...? Or, is
> this handled internally so I don't have to worry about it? Any
> suggestions?
> Thanks.
>

Thursday, March 22, 2012

Surface Area Calculator

I'm currently doing an assignment which calculates the surface area of a cylinder given the input of radius and height from the user and the answer is displayed in a read only control this is what I have so far

Class code

Public Class SurfaceAreaCalculator
Public Function calcSurfaceArea(ByVal r As Double, ByVal h As Double)
Const Pi As Double = 3.14159265
' r = radius, h = height
Return 2 * Pi * r ^ 2 + 2 * Pi * r * h

End Function

End Class

Form Code

Public Class WebForm1
Inherits System.Web.UI.Page

Dim SurfaceArea As New SurfaceAreaCalculator
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
If IsPostBack Then
SurfaceArea = Session("SurfaceAreaClass")
Else
SurfaceArea = New SurfaceAreaCalculator
Session("SurfaceAreaClass") = SurfaceArea

End If
End Sub

Private Sub butcalculate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles butcalculate.Click

Me.txtanswer.Text = SurfaceArea.calcSurfaceArea

I keep getting an error in the button click event procedure,and am having trouble displaying the answer using the formula above

Any tips would be appreciated ThanksPublic Class SurfaceAreaCalculator
Public Function calcSurfaceArea(ByVal r As Double, ByVal h As Double)
Const Pi As Double = 3.14159265
' r = radius, h = height
Return 2 * (Pi * r ^ 2) + (2 * Pi * r) * h

End Function

End Class

Public Class WebForm1
Inherits System.Web.UI.Page

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
If not IsPostBack Then
Session("SurfaceAreaClass") = New SurfaceAreaCalculator
End If
End Sub

Private Sub butcalculate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles butcalculate.Click
Dim SurfaceArea as SerfaceAreaCalculator = Session("SurfaceAreaClass")
Me.txtanswer.Text = SurfaceArea.calcSurfaceArea(Put something in here)
Thanks for that you've been a great help, would it be possible to help with the following as well

The program also requires that the user enters a double precision number between 0 and 5000 for the radius textbox and a double precision number between 0 and 10000 for the height textbox, the answer displayed in the third text box also has to be to 2 decimal places

I have used a required field validator control to ensure the textboxes can't be blank, but unsure on how to make sure the values are both double precision and in between those ranges I probably also would need to ensure the user can't enter non-numeric data

Any tips/advice on the above would be appreciated as I'm new to the language and still learning

Thank-you
Use a regex validator with your required field validator. Here's an example

<asp:RegularExpressionValidator id="RegularExpressionValidator1" runat="server"
ErrorMessage="Please enter a double precision number between 0.00 and 5000.00"
ValidationExpression="(^5000\.00$)|((^[0-4]\d{3}|^\d{0,3})\.\d\d$)" ControlToValidate="TextBox1">
</asp:RegularExpressionValidator>

The validationexpression value breaks down like this
(^5000\.00$) - Match 5000.00
| or
^[0-4]\d{3} - Match any number starting with 0 through 4 ending in any three digits. This will match 0000-4999
^\d{0,3} - Match any number starting with 0 through three digits long. 0 - 999
\.\d\d$ - Match numbers ending with a decimal and any two numbers.
Thanks for your help

Tuesday, March 13, 2012

switch tables according to user input

i want to insert data in a particular table which i ask the user

how can i switch between database tables according to user input

Can you give more information about what you trying to do. What kind of input textbox, radio button, checkbox... Are they submitting something or are you wanting to do this on the fly?
You'd have to use dynamic SQL.