|
Hi,
Plz can anybody help me to get codes on credit card processing in billing
Smiles,
Sparkling Star
|
|
|
|
|
|
/* ================================================================
FUNCTION: isCreditCard(st)
INPUT: st - a string representing a credit card number
RETURNS: true, if the credit card number passes the Luhn Mod-10
test.
false, otherwise
================================================================ */
function isCreditCard(st) {
// Encoding only works on cards with less than 19 digits
if (st.length > 19)
return (false);
sum = 0; mul = 1; l = st.length;
for (i = 0; i < l; i++) {
digit = st.substring(l-i-1,l-i);
tproduct = parseInt(digit ,10)*mul;
if (tproduct >= 10)
sum += (tproduct % 10) + 1;
else
sum += tproduct;
if (mul == 1)
mul++;
else
mul--;
}
// Uncomment the following line to help create credit card numbers
// 1. Create a dummy number with a 0 as the last digit
// 2. Examine the sum written out
// 3. Replace the last digit with the difference between the sum and
// the next multiple of 10.
// document.writeln(" Sum = ",sum," ");
// alert("Sum = " + sum);
if ((sum % 10) == 0)
return (true);
else
return (false);
} // END FUNCTION isCreditCard()
------------------------------------------
Boss asked me to Develop in "Java" or "Better"
So Developed in .NET
|
|
|
|
|
Hi,
Thanks alot. i wanted to know about the credit card processing with the gateway
|
|
|
|
|
Here's what happened:
I created an ASP.NET eCommerce site half year ago for a school assignment, it was deployed locally on my hard drive, and everything worked.
However, I am planning to create a real eCommerce site now, so I had applied for a webhosting server that supports ASP.NET, and uploaded the assignment I did earlier and see how it would go.
To my surprise , all I get is the message:
<br />
Runtime Error <br />
Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine. <br />
<br />
Details: To enable the details of this specific error message to be viewable on remote machines, please create a <customErrors> tag within a "web.config" configuration file located in the root directory of the current web application. This <customErrors> tag should then have its "mode" attribute set to "Off".<br />
<br />
<br />
<!-- Web.Config Configuration File --><br />
<br />
configuration<br />
system.web<br />
customErrors mode="Off"/<br />
/system.web<br />
/configuration<br />
<br />
<br />
Notes: The current error page you are seeing can be replaced by a custom error page by modifying the "defaultRedirect" attribute of the application's <customErrors> configuration tag to point to a custom error page URL.<br />
<br />
<br />
<!-- Web.Config Configuration File --><br />
<br />
configuration<br />
system.web<br />
customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/<br />
/system.web<br />
/configuration<br />
<br />
Is there anything else I need to do when deploying an ASP.NET site to a real webhosting server?
And another question, I was planning to store database information in an access database. Here's the question I'm wondering:
I suppose I should password protect the directory where the access databases (*.mdb) are placed. I assume I have to insert the login id/password when retreiving/writing the information in the database. But where do I insert them? And if I insert them in the codes won't others will be able to see the login id/password by viewing the source codes?
Or am I completely mistaken?
Any advice would be greatly appreciated!!!
|
|
|
|
|
Brotha, you're first step ought to be following the instructions on that error message up there to find out what is causing this bug. If you follow the instructions in this error message, it will display a much more specific error message indicating exactly what caused this failure. There should be very little different about a hosting provider vs. your local machine, but you'll never know until you see the real error message.
And as far as your MSAccess question, you set the connection properties in the web.config file. No one can download the web.config file, ASP.NET/IIS knows automatically to never serve up that file. If you need to find out how to setup the DNS within your web.config, you might wanna check out the this faq.
|
|
|
|
|
Hello All,
I am stuck with one problem. I am having one asp.net application in .net framework 2.0 and there is one link to open share point portal. I don't want to get login screen in share point when my user click the link from my asp.net application as he is already get login to my application.
Please help me ASAP.
Thanks,
Ritesh Shah
------------
ritesh4web@gmail.com
|
|
|
|
|
I have to use tree view control on .NET web form.
when i open new project in .net and select web form , web form is opened, but in tool box of web form, i do not find tree view control as we found that in windows form tool box.
my project requirement is to use tree view control in web form.
How to go about this?
Thanks in Advance
sandy
|
|
|
|
|
|
Hi,
I have a textbox.I want to check if data entered in it contains any characters other than digits from 0 to 9.How can I do that. Are there any built-in functions to do this.I don't want to restrict the entry of characters. I want to know whether the data is numeric or alphanumeric.
Regards,
Uma
|
|
|
|
|
You could use int.TryParse(..) which will tell you if a string can be parsed into a number.
|
|
|
|
|
i want to place a check box in a datagrid
once i click on the submit button the contents which i checked in the datagrid has to be displyed in the next
page
1)within the item template of datagrid i placed check box
|
|
|
|
|
Hi i have done a Open file Dialog in asp.net but however i have problem finding it for ASP. Is that any method that i can create that function in ASP 3.0 Pls help
Thanks a Million friends
KaKaShi HaTaKe
|
|
|
|
|
Hi, I have a COM object written in C++ that contains a method that must modify a variable passed to it via ASP. In my C++ come method, I delcare the variable as type VARIANT*. This ideas works ok in C# and VB but fails in ASP. Is there a special way that you have to set up a variable in ASP to pass it to a COM object method for modification. In VB you must pass it by ref, but I am not sure what happens in ASP. The ASP error suggests that there is a type mismatch on the variable I am passing to my COM Object method. This is a bit confusing.. Can anyone help me sort this out?
I really appreciate it.
Thanks
Dave
|
|
|
|
|
Hi,
How do I get a browser within an aspx page? What I am trying to do is have my aspx page with all the html and within the html have a browser displaying a different website.
Is this possible? I am using Visual Studio 2005.
Many thanks
Paul
|
|
|
|
|
oceanexplorer,
Sounds like you are trying to host a web page inside of an existing webpage. It does not take ASP.NET to do this... Just an IFRAME tag:
MSDN: IFrame Object (Html Reference)
|
|
|
|
|
Hi All,
I am trying to get HTML of a page using COMStream. I am running following code.
Imports System
Imports System.Diagnostics
Imports System.Runtime
Imports System.Runtime.InteropServices
Imports System.Threading
Imports System.MarshalByRefObject
Imports System.IO
Imports System.ComponentModel
Imports mshtml
Imports SHDocVw
Public Class GetNukeSource
' IPersist interface
<ComVisible(True), ComImport(), Guid("0000010c-0000-0000-C000-000000000046"), _
InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)> _
Public Interface IPersist
Sub GetClassID(ByRef pClassID As Guid)
End Interface
' IPersistStreamInit interface
<ComVisible(True), ComImport(), Guid("7FD52380-4E07-101B-AE2D-08002B2EC713"), _
InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)> _
Public Interface IPersistStreamInit : Inherits IPersist
Shadows Sub GetClassID(ByRef pClassID As Guid)
<PreserveSig()> Function IsDirty() As Integer
Sub Load(ByVal pstm As UCOMIStream)
Sub Save(ByVal pstm As UCOMIStream, _
<MarshalAs(UnmanagedType.Bool)> ByVal fClearDirty As Boolean)
Sub GetSizeMax(ByRef pcbSize As Long)
Sub InitNew()
End Interface
<DllImport("OLE32.DLL")> _
Private Shared Sub CreateStreamOnHGlobal(ByVal hGlobal As IntPtr, _
ByVal fDelete As Boolean, ByRef stm As UCOMIStream)
End Sub
<DllImport("OLE32.DLL")> _
Public Shared Sub GetHGlobalFromStream(ByVal stm As UCOMIStream, ByRef hGlobal As IntPtr)
' LEAVE THIS BLANK - PLACEHOLDER
End Sub
Dim iptr As IntPtr
Public Function getNukesource(ByVal pageUrl As String) As String
Dim strm As UCOMIStream
Dim ips As IPersistStreamInit
Dim ie As New SHDocVw.InternetExplorer
Dim objDocument As mshtml.IHTMLDocument2
Try
ie.Navigate(pageUrl)
ie.Visible = True
Do Until ie.ReadyState = SHDocVw.tagREADYSTATE.READYSTATE_COMPLETE
Thread.Sleep(50)
Loop
Catch ex As Exception
Throw ex
Finally
End Try
Dim strRetPage As String
Try
ips = DirectCast(ie.Document, IPersistStreamInit)
Catch ex As Exception
Throw ex
End Try
If ips Is Nothing Then
strRetPage = Nothing
Else
strm = GetStream(2048)
End If
Try
ips.Save(strm, False)
If Not strm Is Nothing Then
strRetPage = Me.StreamToString(strm)
End If
ie.Quit()
Return strRetPage
Catch ex As Exception
Throw ex
End Try
End Function
Private Function GetDocumentSource(ByVal doc As mshtml.IHTMLDocument2, ByVal resetIsDirty As Boolean) As String
Dim stream As UCOMIStream
Dim ips As IPersistStreamInit
Dim s As String
Try
ips = DirectCast(doc, IPersistStreamInit)
If ips Is Nothing Then
s = Nothing
Else
stream = GetStream(2048)
' Save the document into the comstream, without clearing the
ips.Save(stream, False)
s = StreamToString(stream)
End If
Return s
Catch ex As Exception
Throw ex
End Try
End Function
Private Function StreamToString(ByVal strm As UCOMIStream) As String
Dim iptr As IntPtr
Dim s As String
Try
GetHGlobalFromStream(strm, iptr)
' If the source is the cloned and modified document then Auto must be used ***
s = Marshal.PtrToStringAnsi(iptr)
Return s
Catch ex As Exception
Throw ex
End Try
End Function
Private Function GetStream(ByVal size As Integer) As UCOMIStream
Dim iptr As IntPtr
Dim strm As UCOMIStream
Try
' Create a pointer to a block of the required size
iptr = Marshal.AllocHGlobal(size)
' Create the stream from the pointer
CreateStreamOnHGlobal(iptr, True, strm)
Return strm
Catch ex As Exception
Throw ex
End Try
End Function
End Class
This code sometimes runs fine and sometimes gives me following error.
An unhandled exception of type 'System.ExecutionEngineException' occured in translationservice.dll.
Server Application Unavailable
The web application you are attempting to access on this web server is currently unavailable. Please hit the "Refresh" button in your web browser to retry your request.
Administrator Note: An error message detailing the cause of this specific request failure can be found in the application event log of the web server. Please review this log entry to discover what caused this error to occur.
After this error comes up CPU usage reaches to 100%.
I do not understand what is the problem with my code. I will appreciate if someone of you guys could help me about it.
Thanks,
Ahmad
|
|
|
|
|
Hi ,
please can you give me a link or something to download a free good video explain session state & application state
you know, how they work ?? & when we can use them & so on
thank you
try to be good if you can't be the best
|
|
|
|
|
Hi ,
i want to do a button in the page that close all the web site well i haven't seen that sh*t before but they demanded it in the exam what may i do ??
can you tell me the code i must write in the click event please ??
thank you
try to be good if you can't be the best
-- modified at 13:13 Sunday 25th June, 2006
|
|
|
|
|
Hi ,
well i have to build a small web site & i need in to do a text_changed event but it doesn't work , i know because client/server & somethings like that
i'm demanding the way , how can i make it work just like in vb.net ? i know it is not the same concept but i want it work
it worked with me but not the way i want it to work it works just when i leave the text box i will tell you
i want for each letter i type in the textbox1 to see this letter in label1 & like that
can you tell me how todo it ?
try to be good if you can't be the best
|
|
|
|
|
If you want it to work on each character typed, you must do it through DHTML and not ASP.NET. ASP.NET would require you resubmit the form (aka Postback) each time the user types something, which would be insanely slow for the poor user and would kill the resources of your server.
Try using the onKeyPress event found in the "input type=text" object. Within that event, update the label by setting it's innerHTML property.
|
|
|
|
|
hey sorry but i want to tell you , i heard abt somrthing called ajax it enables that stuff it allows you for each type of a caracter the label can receive it & also i heard that you can add some javascript i heard a lot of things but i don't know how to use them i searched a lot but you don't find somebody who can tell you the right thing to do
what is this propriety you told me innerHTML ?
try to be good if you can't be the best
|
|
|
|
|
Hi, seems logic but the HTML text doesn't fire a post back & even that i tried this idea but it doesn't work
look , for example i have a list of guests in my listbox & i want when i type something in a textbox over that list the guests that only the guests that have the name start whith these letters stay in the listbox
can you have any idea how can i do that please ??
try to be good if you can't be the best
|
|
|
|
|
plz help..I need a link flash swf..that enables downloading a file from server.
|
|
|
|
|
Please don't cross post.
---
b { font-weight: normal; }
|
|
|
|