Showing posts with label html. Show all posts
Showing posts with label html. Show all posts

Thursday, March 29, 2012

Newbie : aspx and javascript

Hello,
Is it possible to call an aspx page from an html page (via javascript)
and get some return value from the aspx? I want to get a string from
the aspx and add it to a div, something like :
myDiv.innerHTML += returnValueFromAspx;
Thanks in advance for the response.There are several ways, probably the easiest for a beginner is to use the
browser's built-in XMLHTTPRequest object, and get the string back in the
ResponseText proeperty. Then you just do
document.getElementById('myDiv').innerHTML= myXmlHttp.ResponseText;
Pete
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com
"Bartlett" wrote:

> Hello,
> Is it possible to call an aspx page from an html page (via javascript)
> and get some return value from the aspx? I want to get a string from
> the aspx and add it to a div, something like :
> myDiv.innerHTML += returnValueFromAspx;
> Thanks in advance for the response.
>
Read this easy tutorial on Ajax
http://www.w3schools.com/ajax/default.asp
and check out the ajax section at
http://ajax.asp.net/default.aspx?tabid=47--
Regards
John Timney (MVP)
VISIT MY WEBSITE:
http://www.johntimney.com
http://www.johntimney.com/blog
"Bartlett" <stef_chr@.yahoo.fr> wrote in message
news:1164902904.001338.81740@.l12g2000cwl.googlegroups.com...
> Hello,
> Is it possible to call an aspx page from an html page (via javascript)
> and get some return value from the aspx? I want to get a string from
> the aspx and add it to a div, something like :
> myDiv.innerHTML += returnValueFromAspx;
> Thanks in advance for the response.
>

Newbie : aspx and javascript

Hello,

Is it possible to call an aspx page from an html page (via javascript)
and get some return value from the aspx? I want to get a string from
the aspx and add it to a div, something like :
myDiv.innerHTML += returnValueFromAspx;

Thanks in advance for the response.Read this easy tutorial on Ajax
http://www.w3schools.com/ajax/default.asp
and check out the ajax section at
http://ajax.asp.net/default.aspx?tabid=47--
Regards

John Timney (MVP)
VISIT MY WEBSITE:
http://www.johntimney.com
http://www.johntimney.com/blog
"Bartlett" <stef_chr@.yahoo.frwrote in message
news:1164902904.001338.81740@.l12g2000cwl.googlegro ups.com...

Quote:

Originally Posted by

Hello,
>
Is it possible to call an aspx page from an html page (via javascript)
and get some return value from the aspx? I want to get a string from
the aspx and add it to a div, something like :
myDiv.innerHTML += returnValueFromAspx;
>
Thanks in advance for the response.
>

Monday, March 26, 2012

newbie ASP won't work

Hi,
I have just installed IIS on my XP SP2 machine.
This code (dreamweaver) doesn't work
<%@dotnet.itags.org. LANGUAGE="VBSCRIPT"" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=big5">
</head>
Good Afternoon<BR>
Welcome to this sample. It is approximately
<%=Time()%> at the server, Here
<body>
</body>
</html>
pls help
Jack"Jacky Luk" <jl@.knight.com> glsD:O7qvwDbkFHA.3968@.tk2msftngp13.phx.gbl...arkred">
> Hi,
> I have just installed IIS on my XP SP2 machine.
> This code (dreamweaver) doesn't work
> <%@. LANGUAGE="VBSCRIPT"" %>
____
I've spoted one error, but still doesn't work in preview

> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
> <html>
> <head>
> <title>Untitled Document</title>
> <meta http-equiv="Content-Type" content="text/html; charset=big5">
> </head>
> Good Afternoon<BR>
> Welcome to this sample. It is approximately
> <%=Time()%> at the server, Here
> <body>
> </body>
> </html>
> pls help
> Jack
>
Here's the revision
<%@. LANGUAGE="VBSCRIPT" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=big5">
</head>
<body>
Good Afternoon<BR>
Welcome to this sample. It is approximately
<%=Time()%> at the server, Here
</body>
</html>
"Jacky Luk" <jl@.knight.com> glsD:O7qvwDbkFHA.3968@.tk2msftngp13.phx.gbl...arkred">
> Hi,
> I have just installed IIS on my XP SP2 machine.
> This code (dreamweaver) doesn't work
> <%@. LANGUAGE="VBSCRIPT"" %>
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
> <html>
> <head>
> <title>Untitled Document</title>
> <meta http-equiv="Content-Type" content="text/html; charset=big5">
> </head>
> Good Afternoon<BR>
> Welcome to this sample. It is approximately
> <%=Time()%> at the server, Here
> <body>
> </body>
> </html>
> pls help
> Jack
>
First, define "doesn't work." Describe symptoms, behaviors, error messages,
etc.
Second, this is the ASP.Net newsgroup. You want the ASP newsgroup,
microsoft.public.inetserver.asp.general.
HTH,
Kevin Spencer
Microsoft MVP
.Net Developer
The sun never sets on
the Kingdom of Heaven
"Jacky Luk" <jl@.knight.com> wrote in message
news:O7qvwDbkFHA.3968@.tk2msftngp13.phx.gbl...
> Hi,
> I have just installed IIS on my XP SP2 machine.
> This code (dreamweaver) doesn't work
> <%@. LANGUAGE="VBSCRIPT"" %>
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
> <html>
> <head>
> <title>Untitled Document</title>
> <meta http-equiv="Content-Type" content="text/html; charset=big5">
> </head>
> Good Afternoon<BR>
> Welcome to this sample. It is approximately
> <%=Time()%> at the server, Here
> <body>
> </body>
> </html>
> pls help
> Jack
>
"Kevin Spencer" <kevin@.DIESPAMMERSDIEtakempis.com> glsD:eiDp6EekFHA.1048@.tk2msftn
gp13.phx.gbl...
> First, define "doesn't work." Describe symptoms, behaviors, error
> messages, etc.
> Second, this is the ASP.Net newsgroup. You want the ASP newsgroup,
> microsoft.public.inetserver.asp.general.
> --
> HTH,
> Kevin Spencer
> Microsoft MVP
> .Net Developer
> The sun never sets on
> the Kingdom of Heaven
> "Jacky Luk" <jl@.knight.com> wrote in message
> news:O7qvwDbkFHA.3968@.tk2msftngp13.phx.gbl...
the current time ,Time(), is not displayed
>
Jacky as ken Adviced this is ASP.NET newsgroup.
To display your time use:-
<%=Now()%>
Hope that helps
Patrick
*** Sent via Developersdex http://www.examnotes.net ***

newbie ASP wont work

Hi,
I have just installed IIS on my XP SP2 machine.
This code (dreamweaver) doesn't work

<%@dotnet.itags.org. LANGUAGE="VBSCRIPT"" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=big5">
</head>
Good Afternoon<BR>
Welcome to this sample. It is approximately
<%=Time()%> at the server, Here
<body
</body>
</html
pls help
Jack"Jacky Luk" <jl@.knight.com> glsD:O7qvwDbkFHA.3968@.tk2msftngp13.phx.g bl...
> Hi,
> I have just installed IIS on my XP SP2 machine.
> This code (dreamweaver) doesn't work
> <%@. LANGUAGE="VBSCRIPT"" %>
____
I've spoted one error, but still doesn't work in preview

> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
> <html>
> <head>
> <title>Untitled Document</title>
> <meta http-equiv="Content-Type" content="text/html; charset=big5">
> </head>
> Good Afternoon<BR>
> Welcome to this sample. It is approximately
> <%=Time()%> at the server, Here
> <body>
> </body>
> </html>
> pls help
> Jack
"Jacky Luk" <jl@.knight.com> glsD:O7qvwDbkFHA.3968@.tk2msftngp13.phx.g bl...
> Hi,
> I have just installed IIS on my XP SP2 machine.
> This code (dreamweaver) doesn't work
> <%@. LANGUAGE="VBSCRIPT"" %>
____
I've spoted one error, but still doesn't work in preview

> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
> <html>
> <head>
> <title>Untitled Document</title>
> <meta http-equiv="Content-Type" content="text/html; charset=big5">
> </head>
> Good Afternoon<BR>
> Welcome to this sample. It is approximately
> <%=Time()%> at the server, Here
> <body>
> </body>
> </html>
> pls help
> Jack
Here's the revision

<%@. LANGUAGE="VBSCRIPT" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=big5">
</head>
<body>
Good Afternoon<BR>
Welcome to this sample. It is approximately
<%=Time()%> at the server, Here

</body>
</html
"Jacky Luk" <jl@.knight.com> glsD:O7qvwDbkFHA.3968@.tk2msftngp13.phx.g bl...
> Hi,
> I have just installed IIS on my XP SP2 machine.
> This code (dreamweaver) doesn't work
> <%@. LANGUAGE="VBSCRIPT"" %>
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
> <html>
> <head>
> <title>Untitled Document</title>
> <meta http-equiv="Content-Type" content="text/html; charset=big5">
> </head>
> Good Afternoon<BR>
> Welcome to this sample. It is approximately
> <%=Time()%> at the server, Here
> <body>
> </body>
> </html>
> pls help
> Jack
Here's the revision

<%@. LANGUAGE="VBSCRIPT" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=big5">
</head>
<body>
Good Afternoon<BR>
Welcome to this sample. It is approximately
<%=Time()%> at the server, Here

</body>
</html
"Jacky Luk" <jl@.knight.com> glsD:O7qvwDbkFHA.3968@.tk2msftngp13.phx.g bl...
> Hi,
> I have just installed IIS on my XP SP2 machine.
> This code (dreamweaver) doesn't work
> <%@. LANGUAGE="VBSCRIPT"" %>
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
> <html>
> <head>
> <title>Untitled Document</title>
> <meta http-equiv="Content-Type" content="text/html; charset=big5">
> </head>
> Good Afternoon<BR>
> Welcome to this sample. It is approximately
> <%=Time()%> at the server, Here
> <body>
> </body>
> </html>
> pls help
> Jack
First, define "doesn't work." Describe symptoms, behaviors, error messages,
etc.

Second, this is the ASP.Net newsgroup. You want the ASP newsgroup,
microsoft.public.inetserver.asp.general.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
The sun never sets on
the Kingdom of Heaven

"Jacky Luk" <jl@.knight.com> wrote in message
news:O7qvwDbkFHA.3968@.tk2msftngp13.phx.gbl...
> Hi,
> I have just installed IIS on my XP SP2 machine.
> This code (dreamweaver) doesn't work
> <%@. LANGUAGE="VBSCRIPT"" %>
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
> <html>
> <head>
> <title>Untitled Document</title>
> <meta http-equiv="Content-Type" content="text/html; charset=big5">
> </head>
> Good Afternoon<BR>
> Welcome to this sample. It is approximately
> <%=Time()%> at the server, Here
> <body>
> </body>
> </html>
> pls help
> Jack
First, define "doesn't work." Describe symptoms, behaviors, error messages,
etc.

Second, this is the ASP.Net newsgroup. You want the ASP newsgroup,
microsoft.public.inetserver.asp.general.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
The sun never sets on
the Kingdom of Heaven

"Jacky Luk" <jl@.knight.com> wrote in message
news:O7qvwDbkFHA.3968@.tk2msftngp13.phx.gbl...
> Hi,
> I have just installed IIS on my XP SP2 machine.
> This code (dreamweaver) doesn't work
> <%@. LANGUAGE="VBSCRIPT"" %>
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
> <html>
> <head>
> <title>Untitled Document</title>
> <meta http-equiv="Content-Type" content="text/html; charset=big5">
> </head>
> Good Afternoon<BR>
> Welcome to this sample. It is approximately
> <%=Time()%> at the server, Here
> <body>
> </body>
> </html>
> pls help
> Jack
"Kevin Spencer" <kevin@.DIESPAMMERSDIEtakempis.com> glsD:eiDp6EekFHA.1048@.tk2msftngp13.phx.g bl...
> First, define "doesn't work." Describe symptoms, behaviors, error
> messages, etc.
> Second, this is the ASP.Net newsgroup. You want the ASP newsgroup,
> microsoft.public.inetserver.asp.general.
> --
> HTH,
> Kevin Spencer
> Microsoft MVP
> .Net Developer
> The sun never sets on
> the Kingdom of Heaven
> "Jacky Luk" <jl@.knight.com> wrote in message
> news:O7qvwDbkFHA.3968@.tk2msftngp13.phx.gbl...
>> Hi,
>> I have just installed IIS on my XP SP2 machine.
>> This code (dreamweaver) doesn't work
>>
>> <%@. LANGUAGE="VBSCRIPT"" %>
>> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
>> <html>
>> <head>
>> <title>Untitled Document</title>
>> <meta http-equiv="Content-Type" content="text/html; charset=big5">
>> </head>
>> Good Afternoon<BR>
>> Welcome to this sample. It is approximately
>> <%=Time()%> at the server, Here
the current time ,Time(), is not displayed

>> <body>
>>
>> </body>
>> </html>
>>
>> pls help
>> Jack
>>
"Kevin Spencer" <kevin@.DIESPAMMERSDIEtakempis.com> glsD:eiDp6EekFHA.1048@.tk2msftngp13.phx.g bl...
> First, define "doesn't work." Describe symptoms, behaviors, error
> messages, etc.
> Second, this is the ASP.Net newsgroup. You want the ASP newsgroup,
> microsoft.public.inetserver.asp.general.
> --
> HTH,
> Kevin Spencer
> Microsoft MVP
> .Net Developer
> The sun never sets on
> the Kingdom of Heaven
> "Jacky Luk" <jl@.knight.com> wrote in message
> news:O7qvwDbkFHA.3968@.tk2msftngp13.phx.gbl...
>> Hi,
>> I have just installed IIS on my XP SP2 machine.
>> This code (dreamweaver) doesn't work
>>
>> <%@. LANGUAGE="VBSCRIPT"" %>
>> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
>> <html>
>> <head>
>> <title>Untitled Document</title>
>> <meta http-equiv="Content-Type" content="text/html; charset=big5">
>> </head>
>> Good Afternoon<BR>
>> Welcome to this sample. It is approximately
>> <%=Time()%> at the server, Here
the current time ,Time(), is not displayed

>> <body>
>>
>> </body>
>> </html>
>>
>> pls help
>> Jack
>>
Jacky as ken Adviced this is ASP.NET newsgroup.
To display your time use:-
<%=Now()%>
Hope that helps
Patrick

*** Sent via Developersdex http://www.developersdex.com ***
Jacky as ken Adviced this is ASP.NET newsgroup.
To display your time use:-
<%=Now()%>
Hope that helps
Patrick

*** Sent via Developersdex http://www.developersdex.com ***

Newbie Data List question

OK, I'm baffled (again).

I'm a .NET noob, converting a static HTML site to one that is more dynamic. Part of the site draws a menu like this:

Photo Gallery

Europe
Critters
Family
Garden
Pumpkins
Special Events

Here's the HTML that is generating the menu:


<!--
<TABLE cellSpacing=13 cellPadding=0 width="100%" border=0>
<TBODY>
<TR>
<TD>
<DIV class=nav>
<P>Photo Gallery</P>
<P>
<font color=Yellow>Europe (NEW!)</font><BR>
Critters<BR>
Family<BR>
Garden<BR>
Pumpkins<br>
Special Events<BR>
</P>
</DIV>
</TD>
</TR>
</TBODY>
</TABLE>
-->

Pretty simple. What I'm trying to do now is create a User Control that will now generate the menu by selecting distinct Category from tblCategories in an Access database.

But, I'm just getting really confused by where to do all of this. I think it's best to use a datalist, but where do I put the code?

- Do I put a script tag in my MenuRight.ascx file?
- Do it do it in the Codebehind for that same file?
- If I use the connection, adapter, and datalist objects from the toolbar, do I need to write script to connect to the database and bind the data, or is that all taken care of?

Right now, I can't seem to get it to display anything at all. Very frustrated!

Any help would be much appreciated.

SteveWhere to put the code, script tag or code behind? I personally prefer CodeBehind. Until you get yourself better grounded, just put it in the codebehind for your control. As you begin writing more complex applications you might want to separate out the data access into a data access layer and just pass the results back to the control.

Yes, you do need to write the code to open the connection, do the query, bind the data, etc.

Take a look at the quickstart tutorials on this site if you need more.

Saturday, March 24, 2012

newbie file security question

This is probably simple, but I don't know the answer:
I have a very large directory of files (including html, .doc, .pdf's,
folders, etc, etc).
I want to have these available for people to browse, but I want them only to
be able to browse them if they are logged in, how do I do this? Sorry, I'm
very new to ASP.NET.This can be done in IIS alone, enable directory browsing on the site
and require a password on the site (uncheck allow anonymous access).

newbie form post question

Please tell me how I can get the values and items for a form posted using
the post method.

The posting page is HTML and I won't know what's in it ahead of time...

How can I get a item/value pair for it.

I'm sure it is simple but haven't figured it out.

Thanks

ShaneWould somethin glike this work?:

Dim idict As System.Collections.IDictionaryEnumerator = CType(Request.Form,
System.Collections.IDictionaryEnumerator)
While idict.MoveNext
Dim key As String = CStr(idict.Key)
Dim value As String = CStr(idict.Value)
End While

Karl

"SStory >" <Shane_Story@.online.msn.com <remove the 'online.' to send me
mail> wrote in message news:%23i9iyr5VDHA.2544@.tk2msftngp13.phx.gbl...
> Please tell me how I can get the values and items for a form posted using
> the post method.
> The posting page is HTML and I won't know what's in it ahead of time...
> How can I get a item/value pair for it.
> I'm sure it is simple but haven't figured it out.
> Thanks
> Shane
give me this...
Specified cast is not valid.

I can't imagine why this should be so ridiculous nor can I found information
on it.

I need info from an HTML page, not the same ASPX page and it will be POST
instead of GET.

I looked at request.form.key, .getvalues.
Not sure what they do and can't find explanation

if you have any more ideas please let me know..

Thanks a bunch,

Shane

"Karl Seguin" <kseguin##crea.ca> wrote in message
news:OJJS1v5VDHA.2364@.TK2MSFTNGP09.phx.gbl...
> Would somethin glike this work?:
> Dim idict As System.Collections.IDictionaryEnumerator =
CType(Request.Form,
> System.Collections.IDictionaryEnumerator)
> While idict.MoveNext
> Dim key As String = CStr(idict.Key)
> Dim value As String = CStr(idict.Value)
> End While
> Karl
> "SStory >" <Shane_Story@.online.msn.com <remove the 'online.' to send me
> mail> wrote in message news:%23i9iyr5VDHA.2544@.tk2msftngp13.phx.gbl...
> > Please tell me how I can get the values and items for a form posted
using
> > the post method.
> > The posting page is HTML and I won't know what's in it ahead of time...
> > How can I get a item/value pair for it.
> > I'm sure it is simple but haven't figured it out.
> > Thanks
> > Shane
Request.Form is a NameValueCollection, containing the names and values of
all the form fields in the form that posted to the current Page. All you
have to do is iterate through it.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
http://www.takempis.com
Complex things are made up of
lots of simple things.

"SStory >" <Shane_Story@.online.msn.com <remove the 'online.' to send me
mail> wrote in message news:%23i9iyr5VDHA.2544@.tk2msftngp13.phx.gbl...
> Please tell me how I can get the values and items for a form posted using
> the post method.
> The posting page is HTML and I won't know what's in it ahead of time...
> How can I get a item/value pair for it.
> I'm sure it is simple but haven't figured it out.
> Thanks
> Shane
Thanks a million... Whew... The docs said it lists all forms on a page so I
was thrown off..

for anybody else who needs to know the easy way of doing this is:

dim i as short

For i = 0 To Request.Form.Count - 1
Response.Write(Request.Form.Keys(i) & "=" & Request.Form.Item(i) & &
"</br>")
Next i

"Kevin Spencer" <kevin@.takempis.com> wrote in message
news:uB31615VDHA.2368@.TK2MSFTNGP09.phx.gbl...
> Request.Form is a NameValueCollection, containing the names and values of
> all the form fields in the form that posted to the current Page. All you
> have to do is iterate through it.
> --
> HTH,
> Kevin Spencer
> Microsoft MVP
> .Net Developer
> http://www.takempis.com
> Complex things are made up of
> lots of simple things.
> "SStory >" <Shane_Story@.online.msn.com <remove the 'online.' to send me
> mail> wrote in message news:%23i9iyr5VDHA.2544@.tk2msftngp13.phx.gbl...
> > Please tell me how I can get the values and items for a form posted
using
> > the post method.
> > The posting page is HTML and I won't know what's in it ahead of time...
> > How can I get a item/value pair for it.
> > I'm sure it is simple but haven't figured it out.
> > Thanks
> > Shane

Newbie getting very frustrated....

Hi. I have been doing html web designs for a few years now. And now i have been trying to work with asp.net. I bought the book Sams Teach Yourself ASp.Net in 24 Hours.

In hour 3 and 4 of the book they have you making a Mortgage Calculator. So i have spent a few days working on this. I cannot seem to get this. I keep getting error after error. And yet when i look at the code, it is typed the same way it is in the lessons. And yet, at the end of the lsessons, it doesn't go into depth or anything about if the project doesnt work, or what happens when you get these errors.

Anyone have this book, that can help me out? I really need to learn this. And i have been told this book is a wastse of myt ime. But it was the only book the Barnes and Nobles had on ASP.Net.

So i guess i am stuck with it. Here is the code...

Sub performCalc_Click(sender As Object, e As EventArgs)
'Specify constant values
Const INTEREST_CALCS_PER_YEAR as Integer = 12
Const PAYMENTS_PER_YEAR as Integer = 12

'Create variables to hold the values entered by the user
Dim P as Double = loanAmount.Text
Dim r as Double = rate.Text / 100
Dim t as Double = mortgageLength.Text

Dim ratePerPeriod as Double
ratePerPeriod = r/INTEREST_CALCS_PER_YEAR

Dim payPeriods as Integer
payPeriods = t * PAYMENTS_PER_YEAR

Dim annualRate as Double
annualRate = Math.Exp(INTEREST_CALCS_PER_YEAR *
Math.Log(1+ratePerPeriod)) - 1

Dim intPerPayment as Double
intPerPayment = (Math.Exp(Math.Log(annualRate+1)/payPeriods) -1 *
payPeriods

'Now compute the total cost of the loan
Dim intPerMonth as Double = intPerPayment / PAYMENTS_PER_YEAR

Dim costPerMonth as Double
costPerMonth = P * intPerMonth/(1-Math.Pow(intPerMonth+1,-payPeriods))

'Now display the results in the results Label Web Control
results.Text = "Your mortgage payment per month is $" & costPerMonth
End SubI tried your posted code after adding the 3 necessary textboxes, one label and one button - -

The only problem I could find is line 26:
intPerPayment = (Math.Exp(Math.Log(annualRate+1)/payPeriods) -1 * payPeriods
should be:
intPerPayment = (Math.Exp(Math.Log(annualRate+1)/payPeriods) -1) * payPeriods

(notice the parenthesis after the -1)

Then, it worked fine for me
Do you have a specific error?

I suggest getting the ASP.NET Unleashed by SAMS
and if you are using VB then the Programming Microsoft Visual Basic .NET by Francesco Balena.

Both of these are ausome books.

Be careful, there are a lot of useless books out there.
ok i added that )
but the error i keep getting is here.

Line 23:
Line 24: Dim annualRate as Double
Line 25: annualRate = Math.Exp(INTEREST_CALCS_PER_YEAR *
Line 26: Math.Log(1+ratePerPeriod)) -1
Line 27:

LINE 25....

i even added the ) mark after the -1, and it still gave me an error.
The error says: Compiler Error Message: BC30201: Expression expected

but in my case, i will gaurentee, that if i get this one fixed, i will get another. :) it has been happening since i started this project...lol
Here is the detailed complier output:

Microsoft (R) Visual Basic .NET Compiler version 7.10.6001.4
for Microsoft (R) .NET Framework version 1.1.4322.2032
Copyright (C) Microsoft Corporation 1987-2002. All rights reserved.

C:\Documents and Settings\Administrator\My Documents\FinancialCalculator.aspx(25) : error BC30201: Expression expected.

annualRate = Math.Exp(INTEREST_CALCS_PER_YEAR *
~
C:\Documents and Settings\Administrator\My Documents\FinancialCalculator.aspx(26) : error BC30205: End of statement expected.

Math.Log(1+ratePerPeriod)) -1)
~~~~~
C:\Documents and Settings\Administrator\My Documents\FinancialCalculator.aspx(29) : error BC30201: Expression expected.

intPerPayment = (Math.Exp(Math.Log(annualRate+1)/payPeriods) -1) *
~
C:\Documents and Settings\Administrator\My Documents\FinancialCalculator.aspx(30) : error BC30454: Expression is not a method.

payPeriods
~~~~~~~~~~
If your code shown here is exactly what you see in your editor then you need to add underscores ( _ ) at the end of each line before hitting "return" to break up the line of code. currently, the processor thinks that what you have is 2 different lines of code. I fear I'm not saying this well...better to show you...

Line 25: annualRate = Math.Exp(INTEREST_CALCS_PER_YEAR * _
Line 26: Math.Log(1+ratePerPeriod)) -1

You may also want to check the rest of your code

Dim intPerPayment as Double
intPerPayment = (Math.Exp(Math.Log(annualRate+1)/payPeriods) -1 * _
payPeriods

Try not to lose your patience...remember, errors are a newbie's friend. They will make you stronger and smarter. :) I know, I'm a newbie.
Thank you. that worked. it gave me one more error, but i placed the ) mark after the -1.

so it looked like:

Dim intPerPayment as Double

intPerPayment = (Math.Exp(Math.Log(annualRate+1)/payPeriods) -1) * _

payPeriods

This books so far sahid nothing about the underscore after the lines to seperate them. Again i thank you. This put a smile on my face for the day.
Sorry I missed that - - I did see the continuation of the line and corrected it on my end, but I just thought that's the way it copied to my system - - didn't think it was the actual way it was in the section I copied....I've run into that several times, on the web, and just didn't think twice about fixing the line automatically
Ahh the underscore...
I've run across quite a few books that just wrap the line of code in their examples. So if you were just copying the code directly from the book you would end up with errors. Just be on the look out for things like that.

Newbie help

Hi

Please instead of writing DataSource into HTML like

DataSource='<%# dsBoth.Tables["Calls"].DefaultView%>'

Is there a way to write it directly into code?

thanks in advanced

IvanYes sure,
if you are using a datagrid:

from inside the code use :

dgr1.DataSource = dsBoth.Tables["Calls"].DefaultView;
dgr1.DataBind();

regards

Newbie Help -- .net and static HTML

Whew... hopefully my questions will get more elaborate as I use this more... this is probably as basic as I could get.
I come from a web design background... haven't done web programmingbefore barring some CFML. Now I'm responsible for coming up to speed onASP.net + VB for work needs...
So here's my basic question.
I created a graphical HTML header for a website I'm building. Iwant to make this a global header across the application, so I want tocall it in each time a page loads. Also, I have navigationbuttons that I want to be able to program VB behind to perform certainactions (mostly just page loads). I really don't know how to addthis header to my web application so as to be able to call it in...once its created, Im confident I can muddle through creating objectsfrom the buttons and programming the VB behind them that I need.
I just frankly can't figure out how to integrate the HTML header (and graphics) with the web application.
Can anyone enlighten me? I couldnt' find an article here about that, so I'm posting.
Thanks so much!
Welcome to Asp.net!
ASP.NEt provides you with the capability to create user controls. UserControls is just like a page but it does not contain the form tag. UserControls are used to divide the pages into small sections so that pageis easy to modify in the future.
So, in your case you can make a user control for the header, footer.Once the user control is created you can simply place it (Drag andDrop) on the page and thats it. Your user control can be placed in allthe pages you have. If later you want to change something in the headersection of the page you simply change the user control and thats it.Once the user control is changed it will take effect on all the pagesthat contain it.
A good tutorial isExtensive Examination of User Controls.


That's pretty much what I needed to know, thanks very much =)
I'll check out that tutorial right now. Thanks again!

Thursday, March 22, 2012

Newbie IMAGE SRC question

Hello all!
I basicly know how to pull a image down with using Image source in HTML. By
telling image src what file name to open. But if I have the file path stored
in a SQL database. such as c:/mypictures/myimagefile.gif, how would I call
that back up, to show that file with out typing the path in my code. Can I
just refrence the sql server, and read that file path? What would be the
correct way of writing that in my code. Or am I totally off base, and do
this an entirely diffrent way.
TIA!!!
RudyYou'll have to write code to pull the image form your database then write
it to the Response.OutputStream. I have a sample app that should get you
started:
http://staff.develop.com/ballen/blo.../>
aff48bf2481
-Brock
DevelopMentor
http://staff.develop.com/ballen

> Hello all!
> I basicly know how to pull a image down with using Image source in
> HTML. By telling image src what file name to open. But if I have the
> file path stored in a SQL database. such as
> c:/mypictures/myimagefile.gif, how would I call that back up, to show
> that file with out typing the path in my code. Can I just refrence
> the sql server, and read that file path? What would be the correct
> way of writing that in my code. Or am I totally off base, and do this
> an entirely diffrent way.
> TIA!!!
> Rudy
>
This article explains in detail how to pull files from a database and
display them dynamically to the user:
http://steveorr.net/articles/EasyUploads.aspx
This one explains how to generate images dynamically and display them to the
user:
http://steveorr.net/articles/ImproveYourImages.aspx
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net
"Rudy" <Rudy@.discussions.microsoft.com> wrote in message
news:B76F371F-B5A7-42F4-BCAD-56FF560D8A99@.microsoft.com...
> Hello all!
> I basicly know how to pull a image down with using Image source in HTML.
> By
> telling image src what file name to open. But if I have the file path
> stored
> in a SQL database. such as c:/mypictures/myimagefile.gif, how would I call
> that back up, to show that file with out typing the path in my code. Can
> I
> just refrence the sql server, and read that file path? What would be the
> correct way of writing that in my code. Or am I totally off base, and do
> this an entirely diffrent way.
> TIA!!!
> Rudy
Hi Brock and Steve,
Thank you for the advise. I'll try it out tonite. I just want to make sure
I'm clear, I am not storing the image in the SQL db, just the filepath. Wil
l
this still work?
Thanks for your help!!!!
"Steve C. Orr [MVP, MCSD]" wrote:

> This article explains in detail how to pull files from a database and
> display them dynamically to the user:
> http://steveorr.net/articles/EasyUploads.aspx
> This one explains how to generate images dynamically and display them to t
he
> user:
> http://steveorr.net/articles/ImproveYourImages.aspx
> --
> I hope this helps,
> Steve C. Orr, MCSD, MVP
> http://SteveOrr.net
>
> "Rudy" <Rudy@.discussions.microsoft.com> wrote in message
> news:B76F371F-B5A7-42F4-BCAD-56FF560D8A99@.microsoft.com...
>
>
It should be roughly similar.
The main difference would be that (instead of grabbing the bytes from a
database field) you'll probably be using Response.WriteFile.
Here's more info on Response.WriteFile
http://msdn.microsoft.com/library/d...tefiletopic.asp
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net
"Rudy" <Rudy@.discussions.microsoft.com> wrote in message
news:B91B851D-4A86-4A35-A6C2-F43ACC83E0A9@.microsoft.com...
> Hi Brock and Steve,
> Thank you for the advise. I'll try it out tonite. I just want to make
> sure
> I'm clear, I am not storing the image in the SQL db, just the filepath.
> Will
> this still work?
> Thanks for your help!!!!
> "Steve C. Orr [MVP, MCSD]" wrote:
>

Newbie IMAGE SRC question

Hello all!

I basicly know how to pull a image down with using Image source in HTML. By
telling image src what file name to open. But if I have the file path stored
in a SQL database. such as c:/mypictures/myimagefile.gif, how would I call
that back up, to show that file with out typing the path in my code. Can I
just refrence the sql server, and read that file path? What would be the
correct way of writing that in my code. Or am I totally off base, and do
this an entirely diffrent way.

TIA!!!

RudyYou'll have to write code to pull the image form your database then write
it to the Response.OutputStream. I have a sample app that should get you
started:

http://staff.develop.com/ballen/blo...f8-9aff48bf2481

-Brock
DevelopMentor
http://staff.develop.com/ballen

> Hello all!
> I basicly know how to pull a image down with using Image source in
> HTML. By telling image src what file name to open. But if I have the
> file path stored in a SQL database. such as
> c:/mypictures/myimagefile.gif, how would I call that back up, to show
> that file with out typing the path in my code. Can I just refrence
> the sql server, and read that file path? What would be the correct
> way of writing that in my code. Or am I totally off base, and do this
> an entirely diffrent way.
> TIA!!!
> Rudy
This article explains in detail how to pull files from a database and
display them dynamically to the user:
http://steveorr.net/articles/EasyUploads.aspx

This one explains how to generate images dynamically and display them to the
user:
http://steveorr.net/articles/ImproveYourImages.aspx

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net

"Rudy" <Rudy@.discussions.microsoft.com> wrote in message
news:B76F371F-B5A7-42F4-BCAD-56FF560D8A99@.microsoft.com...
> Hello all!
> I basicly know how to pull a image down with using Image source in HTML.
> By
> telling image src what file name to open. But if I have the file path
> stored
> in a SQL database. such as c:/mypictures/myimagefile.gif, how would I call
> that back up, to show that file with out typing the path in my code. Can
> I
> just refrence the sql server, and read that file path? What would be the
> correct way of writing that in my code. Or am I totally off base, and do
> this an entirely diffrent way.
> TIA!!!
> Rudy
Hi Brock and Steve,

Thank you for the advise. I'll try it out tonite. I just want to make sure
I'm clear, I am not storing the image in the SQL db, just the filepath. Will
this still work?

Thanks for your help!!!!

"Steve C. Orr [MVP, MCSD]" wrote:

> This article explains in detail how to pull files from a database and
> display them dynamically to the user:
> http://steveorr.net/articles/EasyUploads.aspx
> This one explains how to generate images dynamically and display them to the
> user:
> http://steveorr.net/articles/ImproveYourImages.aspx
> --
> I hope this helps,
> Steve C. Orr, MCSD, MVP
> http://SteveOrr.net
>
> "Rudy" <Rudy@.discussions.microsoft.com> wrote in message
> news:B76F371F-B5A7-42F4-BCAD-56FF560D8A99@.microsoft.com...
> > Hello all!
> > I basicly know how to pull a image down with using Image source in HTML.
> > By
> > telling image src what file name to open. But if I have the file path
> > stored
> > in a SQL database. such as c:/mypictures/myimagefile.gif, how would I call
> > that back up, to show that file with out typing the path in my code. Can
> > I
> > just refrence the sql server, and read that file path? What would be the
> > correct way of writing that in my code. Or am I totally off base, and do
> > this an entirely diffrent way.
> > TIA!!!
> > Rudy
>
It should be roughly similar.
The main difference would be that (instead of grabbing the bytes from a
database field) you'll probably be using Response.WriteFile.

Here's more info on Response.WriteFile
http://msdn.microsoft.com/library/d...tefiletopic.asp

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net

"Rudy" <Rudy@.discussions.microsoft.com> wrote in message
news:B91B851D-4A86-4A35-A6C2-F43ACC83E0A9@.microsoft.com...
> Hi Brock and Steve,
> Thank you for the advise. I'll try it out tonite. I just want to make
> sure
> I'm clear, I am not storing the image in the SQL db, just the filepath.
> Will
> this still work?
> Thanks for your help!!!!
> "Steve C. Orr [MVP, MCSD]" wrote:
>> This article explains in detail how to pull files from a database and
>> display them dynamically to the user:
>> http://steveorr.net/articles/EasyUploads.aspx
>>
>> This one explains how to generate images dynamically and display them to
>> the
>> user:
>> http://steveorr.net/articles/ImproveYourImages.aspx
>>
>> --
>> I hope this helps,
>> Steve C. Orr, MCSD, MVP
>> http://SteveOrr.net
>>
>>
>> "Rudy" <Rudy@.discussions.microsoft.com> wrote in message
>> news:B76F371F-B5A7-42F4-BCAD-56FF560D8A99@.microsoft.com...
>> > Hello all!
>>> > I basicly know how to pull a image down with using Image source in
>> > HTML.
>> > By
>> > telling image src what file name to open. But if I have the file path
>> > stored
>> > in a SQL database. such as c:/mypictures/myimagefile.gif, how would I
>> > call
>> > that back up, to show that file with out typing the path in my code.
>> > Can
>> > I
>> > just refrence the sql server, and read that file path? What would be
>> > the
>> > correct way of writing that in my code. Or am I totally off base, and
>> > do
>> > this an entirely diffrent way.
>>> > TIA!!!
>>> > Rudy
>>
>>
>

Newbie looking for ASP compatible local editor

Completely green - new to HTML and all the rest - I decided, a month ago, to teach myself how to build a web site. (I do have some systems background, but I do NOT consider myself a "techie").

I started with a yahoo free site but soon set up my own domain on yahoo (a low cost version)

In the last month, I have created about four versions of this site - migrating from Yahoo page builder to Netscape Composer to 1st Page. In the process, I changed from a table-based approach to a CSS Style Sheet approach. So I'm learning lots, though still a novice.

By the way, here is my site: http://www.quiltingwhatnot.com/index.html

I stumbled across ASP looking at downloadable code snippets from various sources. At the same time I was trying to figure out how to make my site more "modular" - i.e. to include rather than repeat my site menu links, for example. I see that with ASP this would be possible.

A brief test indicates that my Yahoo hosted domain will sucessfully handle asp include statements. However, my 1st page editor does not.

I am running Windows XP (home). Is downloading ASP.net appropriate for me? Or is there another HTML (et al) editor that would be better? I can't afford much right now so free or very low cost suggestions are appreciated.

Please and thanks so much.
JeanThe first thing that you need to be aware of is that ASP and ASP.Net are two different technologies, ASP is the older of the two and I have had no experience with it.

ASP.Net is not an editor, its a technology that is part of the .Net framework. Basically, you install the framework on a machine that has IIS (Web Server) and it gives you access to a whole bunch of objects that you can use to program dynamic pages. These pages can respond differently depending on user interaction, retrieve data from a DB, or pretty much anything else you can think of. And, yes, one of the things you can do with it is develop you own controls that encapsulate frequently used html and then just use the single control on each page.

Your problem will be that you are running XP Home which does not come with a version of IIS. However, the answer to your prayers, the tab at the top of this page "Web Matrix" will lead you to a WYSIWYG IDE (Integrated Development Environment) that has its own built in Web Server, and its free!. You will need to download and install the framework (follow the links from the right side of the home page), then download and install Web Matrix.

Good luck,
Martin
Thankyou. This enabled me to ask better questions when surfing. old ASP scripts are interpreted by the server returning HTML to the browser whereas with ASP.net, the first page reference causes the server to compile and cache the compiled page. (This old timer was marvelling at the fact that all these production web pages are interpreted as opposed to running compiled code!!)
Thanks for taking the time to reply to someone asking such a basic question!!
I've downloaded the Windows add ons and Web Matrix so I'll see how it goes!!
cheers
jean
Be aware that in order for you to use the web pages built with WebMatrix - you need a .Net host. The Yahoo host probably does not - or they charge more for .Net hosting
Also - NOT as an insult - but your site doen't look like it would benefit from .Net technology. The biggest advantage ( of many ) is the ability to instantly create a dynamic page upon request. If your website is mostly static ( which it appears to be ) .Net won't be much of a help. You should concentrate on static html techniques to simplify your site and it's maintenance. ASP.Net has made the creation and maintenace of dynamic content easier to deal with. CSS and includes would be the best for you - as far as editors - I like dreamweaver and notepad
Hope that helps
Thank you and I am not insulted - rather I am relieved as I had come to the conclusion that asp.net was overkill for what i am trying to accomplish and it is good to have my assessment confirmed by someone knowledgeable.

Do you -- or does anyone alse - have a recommendation for a good on line forum for my type of questions -- HTML, CSS and the like?

(Also, I was wrong about the old ASP - Yahoo does not support the old ASP so it would not help me at this stage. It was a fluke that my simple one line test file seemed to work. )

Thanks so much. I'll wait and see if there are any replies and then I'll trundle off. Good luck to all you asp-net types.
cheers
jean
I find that www.w3schools.com is a good reference. As for forums, I don't really know of any, Soz
I would start here

http://www.w3.org/MarkUp/#tutorials

W3.org is considered the standards keeper - best way to start
they have HTML and CSS stuff 9 and everything else web related
I A good book is probably all you need. HTML has a finite (less than 40?) set of TAGS and so there is only so much you can do - CSS helps with displaying info - and javascript gives you interaction/computing etc..
Dreamweaver comes with a HTML,CSS, and Javascript reference - they have a 30 day trial..

http://www.macromedia.com/cfusion/tdrc/index.cfm?product=dreamweaver

hope that helps

Good Luck