Archive for February, 2011
Let Your web visitors Redesign Your internet site!
Once you get a new item at a Yahoo! Store, you are asked if you want to provide feedback to the transaction. About 2 weeks following your initial purchase, an e-mail from Yahoo! Stores appears, asking you to provide feedback for that vendor. Whether your experience was positive or negative, an opportunity may be seized more often than not by customers.
Not surprisingly, I’d personally bet that bad experiences tend to be posted compared to the high quality ones, but I’d bet the number remains to be substantial enough to get a new owner’s website look and payment processes.
Does your website have a feedback form? Will you give them an opportunity to show you the method that you did? Wouldn’t those opinions make it easier to shape your customer satisfaction and support foundations? I believe so.
Your customer could possibly have a better plan that will compliment your internet site, or simply a function that they can may have liked (including saving their information should they order often, so that they aren’t required to add purchase forms frequently).
You possibly can setup an automatic feedback email over the initial purchase, otherwise you can send the client a letter asking the theifs to come back to your web blog to give information. No matter what, these details can be valuable in making future visitors into customers!
Functions and Subroutines in ASP
Functions and Subroutines in ASP
Should you read our Tutorial on Include Files (SSI) [http://www.webforumz.com/portal.asp?ContentID=12&CategoryID=2] in which case you learned how to encapsulate ASP code within include files and also the benefits it brings us.
As developers, we should endeavour to create our lives easier wherever possible… no one wants to re-invent the wheel all things considered.
Functions and Subroutines exist to not only save us time, but to bring chance to our ASP.
They are yet another method of encapsulating code, but have a much more functionality than simply ‘saving some code for later’.
First, here are Functions… Imagine a balloon salesman in the pub. We’ve all seen them they want one item of information after you buy a balloon, the color.
Let say we requested a red balloon… This balloon mechanism salesman equipped with this ‘information’ then does an attractive basic action… he hands you the balloon. The balloon you received is usually a direct consequence of the data you gave the balloon seller.
Functions are only a similar… they come back to that you’ value in accordance with the information you provided. Lets look at a good example Function: -
<%
Function getBalloon(strColour)
Dim Tempstr
strColour = lcase(strColour) 'This converts the value lowercase.
Select Case strColour
Case "red" Tempstr = "Here is your red balloon"
Case "yellow" Tempstr = "Here is your yellow balloon"
Case "green" Tempstr = "Here is your green balloon"
Case "blue" Tempstr = "Here is your blue balloon"
Case Else Tempstr = "Sorry, we have sold out of that Colour"
End Select
getBalloon = Tempstr
End Function
%>
A Function is passed garden greenhouses. The content we pass a Function, is termed an ‘argument’. The details we back at a Function has the name the ‘return value’. Whilst a Function can have many arguments, it could possibly have only one return value.
Let’s study a further example: -
<%
Function calcTax(amount, taxrate)
Dim Tempvar
Tempvar = amount * (taxrate / 100)
CalcTax = Round(Tempvar, 2) 'round the result to 2 decimal places
End Function
%>
Again, another basic example. We should notice this time that this Function accepts two arguments.
Now, we have some perception of how to write a Function. How can we use one?
Well then, i’ll provide you with now the way we incorporate the use of the calcTax example.
<%
shoppingbill=goodsTotal + calcTax(goodsTotal,17.5)
Response.Write "Your shopping came to ?" & goodsTotal
Response.Write "
VAT amount = ?" & calcTax(goodsTotal)
Response.Write "Total Amount Due = ?" & shoppingbill
%>
Above you see the example function in action… easy huh!
We’ve attemptedto make understanding Functions as easy as possible… Understanding a Subroutine (Sub) is now usually easy for you. Imagine a block of code that performed some instructions dependant on information you gave it…
Sounds very much like a function, doesn?t it? Now this time, and we don’t get anything back. A sub will not pass back information it just uses the details we have for quite a few purpose.
I’m going to only use one example of the Sub, plus the same example operate the sub: -
<%
Sub Bday(strName, intAge)
Response.Write "Happy Birthday " & Name
Response.Write ", You are " & intAge & " years old today"
End Sub
'now, call the sub
bDay "Joe",26
%>
These Sub, demonstrates my point. We put something in, it performs an action (in cases like this chatting with the screen), but not a single thing returned to us from the code. Another thing that in some way Is essential if you use a sub, is that often really do not put brackets throughout the arguments… Because we don’t have a return value do not need brackets as well as in this case, if we try we’ll recieve an error.
Well, that virtually concludes this informative article. We need to nowadays be writing efficient code with the use of Functions and Subs. Don?t forget that if you make use of your functions and subs in multiple pages then you really should store them within include files for reasons of easy maintenance and better performance.