Showing posts with label time. Show all posts
Showing posts with label time. Show all posts

Thursday, March 29, 2012

Please Explain Difference Between ASP.Net and ASP and Also with PHP

Hello dears if some one have time and know about following question then explain in detail of post some links,

Please Explain Difference Between ASP.Net and ASP and Also with PHP

Note: don't post wrong links or notes.

Best Regards.

Wikipedia: ASP

Wikipedia: PHP

Wikipedia: ASP.NET

You may also wish to visit the following webpage, which allows software engineers--such as yourself, apparently--to answer their own questions:Google.

Please explain strange viewstate behavior...

I am dynamically adding an HtmlInputHidden element with different values.
The problem is the first time I add it with a given value and submit it then
change the value within the Page_Load event it still has the original value.
I am guessing this has something to do with viewstate. I have turned off
viewstate at the page level, but the issue still occurs. Any suggestions?
The code is basic:
HtmlInputHidden phihAction = new HtmlInputHidden();
phihAction.ID = "hdnAction";
phihAction.Value = ((short)pactAction).ToString();
mfrmUser.Controls.Add( phihAction );
pactAction is an enumeration that changes based on action (i.e. 1=Add, 2=Edi
t)
Any help in understanding why it does what it does and how to work around it
would be greatly appreciated.
RobertRobert,
You need to check IsPostBack property befory assigning the value:
HtmlInputHidden phihAction = new HtmlInputHidden();
phihAction.ID = "hdnAction";
if (IsPostBack)
phihAction.Value = ((short)pactAction).ToString();
mfrmUser.Controls.Add( phihAction );
Eliyahu
"rgrandidier" <rgrandidier@.discussions.microsoft.com> wrote in message
news:E0B96D78-C2B6-4A46-BE08-E7E7B7FD1893@.microsoft.com...
> I am dynamically adding an HtmlInputHidden element with different values.
> The problem is the first time I add it with a given value and submit it
then
> change the value within the Page_Load event it still has the original
value.
> I am guessing this has something to do with viewstate. I have turned off
> viewstate at the page level, but the issue still occurs. Any suggestions?
> The code is basic:
> HtmlInputHidden phihAction = new HtmlInputHidden();
> phihAction.ID = "hdnAction";
> phihAction.Value = ((short)pactAction).ToString();
> mfrmUser.Controls.Add( phihAction );
> pactAction is an enumeration that changes based on action (i.e. 1=Add,
2=Edit)
> Any help in understanding why it does what it does and how to work around
it
> would be greatly appreciated.
> --
> Robert

Please explain strange viewstate behavior...

I am dynamically adding an HtmlInputHidden element with different values.
The problem is the first time I add it with a given value and submit it then
change the value within the Page_Load event it still has the original value.
I am guessing this has something to do with viewstate. I have turned off
viewstate at the page level, but the issue still occurs. Any suggestions?

The code is basic:
HtmlInputHiddenphihAction = new HtmlInputHidden();

phihAction.ID = "hdnAction";
phihAction.Value = ((short)pactAction).ToString();
mfrmUser.Controls.Add( phihAction );

pactAction is an enumeration that changes based on action (i.e. 1=Add, 2=Edit)

Any help in understanding why it does what it does and how to work around it
would be greatly appreciated.

--
RobertRobert,

You need to check IsPostBack property befory assigning the value:

HtmlInputHidden phihAction = new HtmlInputHidden();

phihAction.ID = "hdnAction";
if (IsPostBack)
phihAction.Value = ((short)pactAction).ToString();
mfrmUser.Controls.Add( phihAction );

Eliyahu

"rgrandidier" <rgrandidier@.discussions.microsoft.com> wrote in message
news:E0B96D78-C2B6-4A46-BE08-E7E7B7FD1893@.microsoft.com...
> I am dynamically adding an HtmlInputHidden element with different values.
> The problem is the first time I add it with a given value and submit it
then
> change the value within the Page_Load event it still has the original
value.
> I am guessing this has something to do with viewstate. I have turned off
> viewstate at the page level, but the issue still occurs. Any suggestions?
> The code is basic:
> HtmlInputHidden phihAction = new HtmlInputHidden();
> phihAction.ID = "hdnAction";
> phihAction.Value = ((short)pactAction).ToString();
> mfrmUser.Controls.Add( phihAction );
> pactAction is an enumeration that changes based on action (i.e. 1=Add,
2=Edit)
> Any help in understanding why it does what it does and how to work around
it
> would be greatly appreciated.
> --
> Robert

Monday, March 26, 2012

Please help

I have developed a website in c# and I am facing a
strange problem.It is like this

When I am browsing my site and one time everything runs
fine and fast. But sometime what happens when I click on
the link on any page it does not do any thing but the top
flag starts moving as if it is doing something. When I
stop the browser by clicking on the cross button and then
click on the same link it starts working and I am able to
go to that linked page and same goes for any button.
There is no specific link or button which behaves in this
manner it could be anylink or button when clicked will
not do anything but top right flag moves all the time.
Stop the browser if lucky it will work.

Help is really appreciated.

Regards
TripHi,

Is there any evidence 4 application / asp.net recycling in event viewer?

Natty Gur[MVP]
Phone Numbers:
Office: +972-(0)9-7740261
Fax: +972-(0)9-7740261
Mobile: +972-(0)58-888377

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Saturday, March 24, 2012

Please help ! Problem about HttpWebRequest - GetResponse()

Hi all,
I have problem when I use HttpWebRequest and take long time to call to my
service server. If at that time there are many request comes in
semultaneous, I will get this exception
System.Net.WebException: The underlying connection was closed: The request
was canceled. --> System.IO.IOException: Unable to read data from the
transport connection. --> System.ObjectDisposedException: Cannot access a
disposed object named "System.Net.TlsStream".
Object name: "System.Net.TlsStream".
at System.Net.Sockets.NetworkStream.EndRead(IAsyncResult asyncResult)
at System.Net.TlsStream.AsyncReceiveComplete(IAsyncResult result)
-- End of inner exception stack trace --
at System.Net.TlsStream.EndRead(IAsyncResult asyncResult)
at System.Net.Connection.ReadCallback(IAsyncResult asyncResult)
-- End of inner exception stack trace --
at System.Net.HttpWebRequest.CheckFinalStatus()
at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
at System.Net.HttpWebRequest.GetResponse()
at MFEC.DealerServices.Service.PaymentGateway.CallPaymentGateway(String
serviceName, GeneralParameterCollection inputParam)
Does anybody know how to solve this problem ?Have you seen this?
http://support.microsoft.com/defaul...kb;en-us;884537
- slightly different scenario, but you might be hitting the same bug.
Scott
http://www.OdeToCode.com/blogs/scott/
On Fri, 22 Apr 2005 10:10:02 GMT, "japslam japslam via
webservertalk.com" <forum@.nospam.webservertalk.com> wrote:

>Hi all,
>I have problem when I use HttpWebRequest and take long time to call to my
>service server. If at that time there are many request comes in
>semultaneous, I will get this exception
>System.Net.WebException: The underlying connection was closed: The request
>was canceled. --> System.IO.IOException: Unable to read data from the
>transport connection. --> System.ObjectDisposedException: Cannot access a
>disposed object named "System.Net.TlsStream".
>Object name: "System.Net.TlsStream".
> at System.Net.Sockets.NetworkStream.EndRead(IAsyncResult asyncResult)
> at System.Net.TlsStream.AsyncReceiveComplete(IAsyncResult result)
> -- End of inner exception stack trace --
> at System.Net.TlsStream.EndRead(IAsyncResult asyncResult)
> at System.Net.Connection.ReadCallback(IAsyncResult asyncResult)
> -- End of inner exception stack trace --
> at System.Net.HttpWebRequest.CheckFinalStatus()
> at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
> at System.Net.HttpWebRequest.GetResponse()
> at MFEC.DealerServices.Service.PaymentGateway.CallPaymentGateway(String
>serviceName, GeneralParameterCollection inputParam)
>
>Does anybody know how to solve this problem ?

Please help ! Problem about HttpWebRequest - GetResponse()

Hi all,

I have problem when I use HttpWebRequest and take long time to call to my
service server. If at that time there are many request comes in
semultaneous, I will get this exception

System.Net.WebException: The underlying connection was closed: The request
was canceled. --> System.IO.IOException: Unable to read data from the
transport connection. --> System.ObjectDisposedException: Cannot access a
disposed object named "System.Net.TlsStream".
Object name: "System.Net.TlsStream".
at System.Net.Sockets.NetworkStream.EndRead(IAsyncRes ult asyncResult)
at System.Net.TlsStream.AsyncReceiveComplete(IAsyncRe sult result)
-- End of inner exception stack trace --
at System.Net.TlsStream.EndRead(IAsyncResult asyncResult)
at System.Net.Connection.ReadCallback(IAsyncResult asyncResult)
-- End of inner exception stack trace --
at System.Net.HttpWebRequest.CheckFinalStatus()
at System.Net.HttpWebRequest.EndGetResponse(IAsyncRes ult asyncResult)
at System.Net.HttpWebRequest.GetResponse()
at MFEC.DealerServices.Service.PaymentGateway.CallPay mentGateway(String
serviceName, GeneralParameterCollection inputParam)

Does anybody know how to solve this problem ?Hi,

The problem is that your proxy is not allowing the webrequest.
Do one thing create a webproxy object with your proxy name and port and
bind it to webrequest like this.

// True is to by pass proxy for local
WebProxy proxy = new WebProxy(name:port, true);

// suppose req is HttpWebRequest object
req.Proxy = proxy;

and then user req.getResponse method to get the response.

Regards,
Angrez
Hi singh_angrez,

Thank you for your suggestion. But I can test it in next 2 day after this
weekend. After I try I will report the result again if it can solve my
problem or not

Thank you very much

Jap.
Hi singh_angrez,

Before I try your suggestion. I wanna show you about my code.
And my server architecture is like this

Web server --httprequest call to --> My service server

Actually, If my service server reponse the result to me in a short time,
everything is ok..no exception. But anytime my service server take long
time to process and send me the result.. at that time if there are many
requests from web server call to my service server, I got that exception
until my service server have a good response.

This is my code now. May be my code is not correct about HttpWebRequest
property.

//==== set ssl connection ==
ServicePointManager.CertificatePolicy = new MyPolicy();

HttpWebRequest objRequest = (HttpWebRequest)WebRequest.Create
(PAYMENTGATEWAY_URL+strParam.ToString());
objRequest.Method = "GET";

//==== add new code ==
objRequest.KeepAlive = false;
objRequest.ProtocolVersion=HttpVersion.Version10;
objRequest.Proxy = System.Net.WebProxy.GetDefaultProxy(); // I use
default proxy which work well in normal time.
objRequest.AllowAutoRedirect=true;
objRequest.MaximumAutomaticRedirections=10;
objRequest.Timeout = (int) new TimeSpan(0,0,HTTPTIMEOUT)
..TotalMilliseconds; // ,HTTPTIMEOUT = 300
objRequest.UserAgent="Mozilla/3.0 (compatible; My Browser/1.0)";
//==== add new code ==

string str = null;
HttpWebResponse objResponse;
StreamReader sr = null;
try
{
objResponse = (HttpWebResponse)objRequest.GetResponse();

}
catch( Exception e)
{
EventMgmt.EventExceptionMsg("Payment Gateway-GetResponse() =>
"+e.ToString(), @."\DataAccess\PGWException");

throw new ServiceException("PGW001","HOST_UNREACHABLE",e);
}

try
{
sr = new StreamReader(objResponse.GetResponseStream());
str = sr.ReadToEnd().Replace('\n'.ToString(),"").Replace('\t'.ToString()
,"").Replace('&'.ToString(),"");
}
catch( Exception e)
{
EventMgmt.EventExceptionMsg("Payment Gateway-ReadResponseStream() =>
"+e.ToString(), @."\DataAccess\PGWException");

throw new ServiceException("PGW003","READ_STREAM_ERROR",e);
}
finally
{
if( sr != null)
sr.Close();
objResponse.Close();
}

Thank you,

Jap.
Have you seen this?
http://support.microsoft.com/defaul...kb;en-us;884537

- slightly different scenario, but you might be hitting the same bug.

--
Scott
http://www.OdeToCode.com/blogs/scott/

On Fri, 22 Apr 2005 10:10:02 GMT, "japslam japslam via
DotNetMonster.com" <forum@.nospam.DotNetMonster.com> wrote:

>Hi all,
>I have problem when I use HttpWebRequest and take long time to call to my
>service server. If at that time there are many request comes in
>semultaneous, I will get this exception
>System.Net.WebException: The underlying connection was closed: The request
>was canceled. --> System.IO.IOException: Unable to read data from the
>transport connection. --> System.ObjectDisposedException: Cannot access a
>disposed object named "System.Net.TlsStream".
>Object name: "System.Net.TlsStream".
> at System.Net.Sockets.NetworkStream.EndRead(IAsyncRes ult asyncResult)
> at System.Net.TlsStream.AsyncReceiveComplete(IAsyncRe sult result)
> -- End of inner exception stack trace --
> at System.Net.TlsStream.EndRead(IAsyncResult asyncResult)
> at System.Net.Connection.ReadCallback(IAsyncResult asyncResult)
> -- End of inner exception stack trace --
> at System.Net.HttpWebRequest.CheckFinalStatus()
> at System.Net.HttpWebRequest.EndGetResponse(IAsyncRes ult asyncResult)
> at System.Net.HttpWebRequest.GetResponse()
> at MFEC.DealerServices.Service.PaymentGateway.CallPay mentGateway(String
>serviceName, GeneralParameterCollection inputParam)
>
>Does anybody know how to solve this problem ?
the default setting for webclient is to only allow two connections to a
remote server. if you calls are slow, and they stack up, you will have
timeout problems. also you could hit your max thread pool sizes.

try upping the number of connections.
(httpRequest.ServicePoint.ConnectionLimit)

-- bruce (sqlwork.com)

"japslam japslam via DotNetMonster.com" <forum@.DotNetMonster.com> wrote in
message news:1b2e8e50a4a5493bbb9004d9c3d2c1f0@.DotNetMonste r.com...
> Hi singh_angrez,
>
> Before I try your suggestion. I wanna show you about my code.
> And my server architecture is like this
> Web server --httprequest call to --> My service server
> Actually, If my service server reponse the result to me in a short time,
> everything is ok..no exception. But anytime my service server take long
> time to process and send me the result.. at that time if there are many
> requests from web server call to my service server, I got that exception
> until my service server have a good response.
> This is my code now. May be my code is not correct about HttpWebRequest
> property.
>
> //==== set ssl connection ==
> ServicePointManager.CertificatePolicy = new MyPolicy();
> HttpWebRequest objRequest = (HttpWebRequest)WebRequest.Create
> (PAYMENTGATEWAY_URL+strParam.ToString());
> objRequest.Method = "GET";
> //==== add new code ==
> objRequest.KeepAlive = false;
> objRequest.ProtocolVersion=HttpVersion.Version10;
> objRequest.Proxy = System.Net.WebProxy.GetDefaultProxy(); // I use
> default proxy which work well in normal time.
> objRequest.AllowAutoRedirect=true;
> objRequest.MaximumAutomaticRedirections=10;
> objRequest.Timeout = (int) new TimeSpan(0,0,HTTPTIMEOUT)
> .TotalMilliseconds; // ,HTTPTIMEOUT = 300
> objRequest.UserAgent="Mozilla/3.0 (compatible; My Browser/1.0)";
> //==== add new code ==
> string str = null;
> HttpWebResponse objResponse;
> StreamReader sr = null;
> try
> {
> objResponse = (HttpWebResponse)objRequest.GetResponse();
> }
> catch( Exception e)
> {
> EventMgmt.EventExceptionMsg("Payment Gateway-GetResponse() =>
> "+e.ToString(), @."\DataAccess\PGWException");
> throw new ServiceException("PGW001","HOST_UNREACHABLE",e);
> }
> try
> {
> sr = new StreamReader(objResponse.GetResponseStream());
> str = sr.ReadToEnd().Replace('\n'.ToString(),"").Replace('\t'.ToString()
> ,"").Replace('&'.ToString(),"");
> }
> catch( Exception e)
> {
> EventMgmt.EventExceptionMsg("Payment Gateway-ReadResponseStream() =>
> "+e.ToString(), @."\DataAccess\PGWException");
> throw new ServiceException("PGW003","READ_STREAM_ERROR",e);
> }
> finally
> {
> if( sr != null)
> sr.Close();
> objResponse.Close();
> }
>
> Thank you,
> Jap.

Please Help ????

Hi Everyone:

I am posting this second time, Plaese Help.
I am having a problem to open asp.Net project.The error which i
am getting is

Web Access Failed
the default Web access mode for this project is set to file share, but
the
project folder at http://XX.X.X.XXX/WebApplication1' cannot be opened
with
path 'http://XX.X.X.XXX/WebApplication1'. Access is denied.

One of the options that was available from the error dialog was 'Try
to open
the project with FrontPage Server Extensions'. This did not work
either
(similar type of error).

I tried couple of solution which i found from google but nothing work
and finally i FORMAT my computer and install W2000 and install
VS.Net.Guess what ?

Same Error.

I did my best(Format the M/C) and i don't know what else i can do?

My ISS setting is Correct like

1. IP address ----> (All Unassigned)
2.TCP Port ----> 80
3.Execute Permissions ---> Scripts only
4. Read / Write Permission to c:\inetpub\wwwroot Dir.
5.Integrated Windows authentication ----> Checked

6. HTTP Header ---> I add .tmp mine type Temp
7. Check Access rights on Share Folders.Every thing is Ok.

Thanks In advance.

Pargatwhat permissions groups are you in? Make sure you are in VS Developers or
possibly Administrators

--
Curt Christianson
Owner/Lead Developer, DF-Software
Site: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com

"pargat singh" <pargat_g@.yahoo.com> wrote in message
news:59f09594.0407070431.61dac59@.posting.google.co m...
> Hi Everyone:
> I am posting this second time, Plaese Help.
> I am having a problem to open asp.Net project.The error which i
> am getting is
> Web Access Failed
> the default Web access mode for this project is set to file share, but
> the
> project folder at http://XX.X.X.XXX/WebApplication1' cannot be opened
> with
> path 'http://XX.X.X.XXX/WebApplication1'. Access is denied.
> One of the options that was available from the error dialog was 'Try
> to open
> the project with FrontPage Server Extensions'. This did not work
> either
> (similar type of error).
> I tried couple of solution which i found from google but nothing work
> and finally i FORMAT my computer and install W2000 and install
> VS.Net.Guess what ?
> Same Error.
> I did my best(Format the M/C) and i don't know what else i can do?
> My ISS setting is Correct like
> 1. IP address ----> (All Unassigned)
> 2.TCP Port ----> 80
> 3.Execute Permissions ---> Scripts only
> 4. Read / Write Permission to c:\inetpub\wwwroot Dir.
> 5.Integrated Windows authentication ----> Checked
> 6. HTTP Header ---> I add .tmp mine type Temp
> 7. Check Access rights on Share Folders.Every thing is Ok.
> Thanks In advance.
> Pargat

Please Help ????

Hi Everyone:
I am posting this second time, Plaese Help.
I am having a problem to open asp.Net project.The error which i
am getting is
Web Access Failed
the default Web access mode for this project is set to file share, but
the
project folder at http://XX.X.X.XXX/WebApplication1' cannot be opened
with
path 'http://XX.X.X.XXX/WebApplication1'. Access is denied.
One of the options that was available from the error dialog was 'Try
to open
the project with FrontPage Server Extensions'. This did not work
either
(similar type of error).
I tried couple of solution which i found from google but nothing work
and finally i FORMAT my computer and install W2000 and install
VS.Net.Guess what ?
Same Error.
I did my best(Format the M/C) and i don't know what else i can do?
My ISS setting is Correct like
1. IP address --> (All Unassigned)
2.TCP Port --> 80
3.Execute Permissions --> Scripts only
4. Read / Write Permission to c:\inetpub\wwwroot Dir.
5.Integrated Windows authentication --> Checked
6. HTTP Header --> I add .tmp mine type Temp
7. Check Access rights on Share Folders.Every thing is Ok.
Thanks In advance.
Pargatwhat permissions groups are you in? Make sure you are in VS Developers or
possibly Administrators
Curt Christianson
Owner/Lead Developer, DF-Software
Site: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"pargat singh" <pargat_g@.yahoo.com> wrote in message
news:59f09594.0407070431.61dac59@.posting.google.com...
> Hi Everyone:
> I am posting this second time, Plaese Help.
> I am having a problem to open asp.Net project.The error which i
> am getting is
> Web Access Failed
> the default Web access mode for this project is set to file share, but
> the
> project folder at http://XX.X.X.XXX/WebApplication1' cannot be opened
> with
> path 'http://XX.X.X.XXX/WebApplication1'. Access is denied.
> One of the options that was available from the error dialog was 'Try
> to open
> the project with FrontPage Server Extensions'. This did not work
> either
> (similar type of error).
> I tried couple of solution which i found from google but nothing work
> and finally i FORMAT my computer and install W2000 and install
> VS.Net.Guess what ?
> Same Error.
> I did my best(Format the M/C) and i don't know what else i can do?
> My ISS setting is Correct like
> 1. IP address --> (All Unassigned)
> 2.TCP Port --> 80
> 3.Execute Permissions --> Scripts only
> 4. Read / Write Permission to c:\inetpub\wwwroot Dir.
> 5.Integrated Windows authentication --> Checked
> 6. HTTP Header --> I add .tmp mine type Temp
> 7. Check Access rights on Share Folders.Every thing is Ok.
> Thanks In advance.
> Pargat

Please help = Im desparate

I come from a PHP background and I'm having a heck of a time solving this problem. I need to create a contact form/ shopping cart. The form will consist of:

1. Product info(orderForm.asp):
the customer will select products and the a form for personal info will be filled out - this will include name. address, credit cart info, etc

2. Confirm order (orderConfirm.asp):
the values of the customers products will be added up and sent to this page along with the info previousley filled in and the order is sent by encrypted email.

I have done this with PHP by declaring variables and using 'if then else' statements.

Anybody have any idea how I can achieve this. It has to be done yesterday

I am not sure what exactly you need here.

If you would like to know about sending mails from ASP.net, check this link (its explined with an example)

http://www.developer.com/net/asp/article.php/3096831


kevinritt:

I come from a PHP background and I'm having a heck of a time solving this problem. I need to create a contact form/ shopping cart. The form will consist of:

1. Product info(orderForm.asp):
the customer will select products and the a form for personal info will be filled out - this will include name. address, credit cart info, etc

2. Confirm order (orderConfirm.asp):
the values of the customers products will be added up and sent to this page along with the info previousley filled in and the order is sent by encrypted email.

I have done this with PHP by declaring variables and using 'if then else' statements.

Anybody have any idea how I can achieve this. It has to be done yesterday

kevinritt --

Check out these links...

ASP.NET Getting Started -- http://www.asp.net/getstarted/default.aspx?tabid=61

ASP.NET Quick Start Tutorials --http://quickstarts.asp.net/QuickStartv20/aspnet/Default.aspx

Learn ASP.NET --http://www.asp.net/learn/default.aspx?tabid=63

ASP.NET Starter Kits --http://www.asp.net/downloads/starterkits/default.aspx?tabid=62

One quick way to get your project done is to setup one of the eCommerce Starter Kit applications and then make it suit your needs. However, those are complex applications and may be beyond your level right now. If that is the case, then just study them a bit. Maybe.

In short, what you need is a web-application, 2 pages, and a database. You need (1) allow the user to enter data on Form1. (2) when the user submits the data on Form1, you will grab the data programmatically and put it in the database and then redirect to Form2; (3) on Form2, you will get the data from the database, put it on Form2, and show the email to be sent; (4) when the user submits Form2 you will send the data in the email.

That's some work, no doubt about it. You will need to know how to do (A) database access, (B) email sending, (C) navigation, and (D) page layout. Your best bet, I think, is to go through the QuickStarts and find the sections for A, B, C, and D, learn them, and then try to code it.

(A) Data Access --http://quickstarts.asp.net/QuickStartv20/aspnet/doc/data/default.aspx

(C) Navigation and (D) Page Layout --http://quickstarts.asp.net/QuickStartv20/aspnet/doc/pages/default.aspx

(B) Email --http://www.developer.com/net/asp/article.php/3096831 orhttp://aspalliance.com/149_How_to_Send_Email_from_ASP_NET_

Is this is your 1st application, then it will take some time to get over the initial learning curve. However, after this application is done, I think you will see the power of ASP.NET over Classic ASP and PHP. IMHO.

HTH.

Thank you.

-- Mark Kamoski

Please help a wannabe programmer...

I could really use some advice on where to start.

First off, i've been doing web development for quite some time, basically everything is WYSIWYG. Mainly using Dreamweaver and HTML coding. I have very little knowlege in programming. I took VB in highschool, but have lost all of it since i've been out of school for 8+ years.

One of my goals is to be able to create a SQL database with a web interface that can querry, add, modify and display the data in IE. I am finding it difficult to figure out where to start. I'm confused about the difference between ASP and ASP.NET, can someone please clarify? For a very beginner with no usable programming background, where should I START? VB? C++, ASP? Since my major goal is to fuse databases with web interfaces, should ASP be where I begin?

I know everyone has their personal opinions on where to start, so feel free to school me.

Thanks,
Mike> i've been doing web development for quite some time

no, you've been doing web layout. not development. you could call it web design if you like, but it AIN'T development if you're just slapping together HTML in a WYSIWYG editor. sorry. I started out that way and never claimed to be a developer until I really started doing server-side AND client-side code. up till then I was a "web designer". then I became a junior web programmer (a company euphemism for HTML coder), THEN a web developer. That was, oh, five years ago. Now I call myself a web developer for real.

ASP is a good way to start. it's simpler than ASP.NET to learn, since ASP.NET is, really, an enterprise-ready framework. ASP is far simpler. try www.asp101.com and www.4guysfromrolla.com. also my site and www.webmonkey.com

some zealots on this site will tell you ASP is dead, but they're just zealots. In another world they'd be handing out religious leaflets on a street corner. ASP is still a very viable framework and is a lot easier to get started with than ASP.NET. FACT.

once you have a basic idea of ASP, then ASP.NET will be conceptually easier to grasp. I won't deny that ASP.NET is a more desirable skill commercially, but hey, pragmatism wins here, and ASP.NET is a far richer, more strict and trickier framework.
Hello Mike,

I'm probably the last person that should be responding to this since I'm a wannabe programmer as well but...

For starters I would use the Tutorials listed at the top of this page (one of the tabs). This helped me TREMENDOUSLY. At home I use the Web Matrix with MS Access DB and at work I use VS.NET 2003 with SQL Server 2000. The tutorial section as well as this messageboard have helped me out with all those applications. Usually I don't even need to post any questions in the messageboards, I just do a search because I'm 100% sure the question I have has already been asked by somebody else and there's usually an answer already there.

I also bought a book (ASP.NET for Begginers using VB.NET (I think that's what it's called, I'm at work right now and can't check)) and it was pretty good at teaching me the 'way' ASP works and how the asp controls work, great book to get started.

And after all that, if you still have questions then this messageboard is the place I've found to get answers. If another ASP.NET user can't help you then I think I've seen posts from ASP "gurus" or MS people (I think?) and they usually have the answer as well.

I hope I have been somewhat helpful.

EYZAE

Please help about Javascript for Asp.net Button

I have to validate so many controls at a time.I dont know what to Write in ControltoValidateProperty property in this case.So I went for writing Javascript function.

I wrote a function in javascript called "validateform" which checks all controls and validates the form.

Now when User clicks Submit Button I want to use this function.
The Problem is When i included that code in Button.attributes.add(...),Its giving me errormessages but also executing the server side code for button.

please help me

thxHow are you calling the Javascript function, from an OnClick event in the submit button or from an onSubmit call from the form. In either case you need to return false from the javascript function if a field does not validated. This will prevent the form from posting back and executing the server side code. If you could provide a code example, it would be easier for me to determine what is going wrong.
this is sample code

javascript :


function va()
{
if(document.all.p_title1.value=="")
{
alert("Team Name required");
return false;
}
else
return true;
}

Page Load :

ContinueButton.Attributes.Add("onclick","va();");

Button Server Event :


private void ContinueButton_Click(object sender, System.Web.UI.ImageClickEventArgs e)
{
Response.Redirect("SelectMaterial.aspx");

}

thx
I noticed the other day that if you don't specify that you want a value returned in the onclick event as well as returning the value from the function that the form postsback to the server regardless of the Javascript function return value, with that said, all you need to do is change you attributes.add statement like so.


ContinueButton.Attributes.Add("onclick","return va();");

That should solve the postback problem.
thank you very much.
It worked

Please help how to call stored procedure from asp.net code

Please help, first time trying to use the stored procedure.

Can you please modify my code below which is in asp.net to insert the record's in table(tbl_labels), i don't have not problem in inserting records, but i want to use my stored procedure to insert the record. Please help I never used a stored procedure.

**********


CREATE PROCEDURE sp_insert_label
(
@dotnet.itags.org.engl nvarchar,
@dotnet.itags.org.espl nvarchar,
@dotnet.itags.org.frlbl nvarchar,
@dotnet.itags.org.gerlbl nvarchar
)
AS
INSERT INTO tbl_labels
(
eng_lbl,
esp_lbl,
fr_lbl,
ger_lbl
)
VALUES
(
@dotnet.itags.org.engl,
@dotnet.itags.org.espl,
@dotnet.itags.org.frlbl,
@dotnet.itags.org.gerlbl
)
GO

********** the following is my asp.net code***

Sub Addlabel_Click(Sender As Object, E As EventArgs)
Page.Validate()
If Not Page.IsValid
Return
End If

Dim DS As DataSet
Dim MyCommand As SqlCommand
Dim InsertCmd As String = "insert into tbl_labels(eng_lbl, esp_lbl, " & _
"fr_lbl, ger_lbl) values " & _
"(@dotnet.itags.org.engl, @dotnet.itags.org.espn, @dotnet.itags.org.fren, @dotnet.itags.org.german)"

MyCommand = New SqlCommand(InsertCmd, MyConnection)

MyCommand.Parameters.Add( "@dotnet.itags.org.engl", eng_lbl.Value )
MyCommand.Parameters.Add( "@dotnet.itags.org.espn", esp_lbl.Value )
MyCommand.Parameters.Add( "@dotnet.itags.org.fren", fr_lbl.Value )
MyCommand.Parameters.Add( "@dotnet.itags.org.german", ger_lbl.Value )

MyCommand.Connection.Open()

Try
MyCommand.ExecuteNonQuery()
Message.InnerHtml = "Label Added Successfully to Dictionary.<br>" '& InsertCmd.ToString()
ger_lbl.Value = ""
fr_lbl.Value = ""
esp_lbl.Value = ""
eng_lbl.Value = ""

Catch Exp As SQLException
If Exp.Number = 2627
Message.InnerHtml = "ERROR: A record already exists with the " & _
"same primary key"
Else
Message.InnerHtml = "ERROR: Could not add record, please ensure " & _
"the fields are correctly filled out"
End If
Message.Style("color") = "red"
End Try

MyCommand.Connection.Close()
BindGrid()
End Sub

Hi,

Dim DS As DataSet

Dim MyCommand As SqlCommand

Dim pmEngl, pmEspn, pmFren, pmGerman As SqlParameter = New SqlParameter()

MyCommand = New SqlCommand("sp_insert_label", MyConnection)
MyCommand.CommandType = CommandType.StoredProcedure;

pmEngl = MyCommand.Parameters.Add( "@.engl", eng_lbl.Value )

pmEspn = MyCommand.Parameters.Add( "@.espn", esp_lbl.Value )

pmFren = MyCommand.Parameters.Add( "@.fren", fr_lbl.Value )

pmGerman = MyCommand.Parameters.Add( "@.german", ger_lbl.Value )

MyCommand.Connection.Open()

Try

MyCommand.ExecuteNonQuery()

Message.InnerHtml = "Label Added Successfully to Dictionary.<br>" '& InsertCmd.ToString()

ger_lbl.Value = ""

fr_lbl.Value = ""

esp_lbl.Value = ""

eng_lbl.Value = ""

hope it helps.
You can add parameters to stored procedures in different ways:

One of the useful way is:

myCommand.Parameters.Add(new SqlParameters("@.ParameterName",SqlDbType.nvarchar,50));
Thank you very much for your help Harish.

Wednesday, March 21, 2012

Please help me format my email!

Well I guess they say third times a charm so this is the third time Ive posted here and maybe someone will reply..
OK First off two things you should know:
1) This is my first ever .NET Website. Ever.
2) I'm using Visual Studio .NET 2003 with SQL Server 2000 deveoped under Windows 2000. The site is hosted under Windows Server 2003 so therefore I cannot test the email functionality in my dev environment because it does not support the email method that 2003 Server does...

Any way, I have a page where users send me an Email which contains data taken from their profiles. When I get it, it looks like this:

Web Part Request: Thursday, December 11, 2003 - 7:53:06 AM 1986 Mercedes-Benz 300E Engine: 6 Tran: A Turbo: N A/C: Y Fourwheel: 2 -------------------- I sent disc brakes back friday the 5th through u.s.p.s. for exchange for correct size .I also need timing chain tensioner,I have a timing chain and link and a gasket.

How can I format the email so its not so confusing? I need it to look like this:

Web Part Request: Thursday, December 11, 2003 - 7:53:06 AM
1986 Mercedes-Benz 300E
Engine: 6
Tran: A
Turbo: N
A/C: Y
Fourwheel: 2
--------------------
I sent disc brakes back friday the 5th through u.s.p.s. for exchange for correct size .I also need timing chain tensioner,I have a timing chain and link and a gasket.

Thanks a lot for your time!
Regards,
Joe

Here is the snippet of code for the page and in case you're wondering, I didnt write this part (hence the reason Im asking for help, a coworker who is no longer here set up the basics):


If Not IsPostBack Then

Dim sessionmember As diyauto.diymember.diymemberdetail = New diyauto.diymember.diymemberdetail
sessionmember = Session("userinfo")

If sessionmember Is Nothing Then
Session("loginreturnpage") = "/partfinder/partrequest.aspx"
Response.Redirect(ConfigurationSettings.AppSettings("SiteHomePage") + "/member/loginagain.aspx")
End If

' show the user name
lblName.Text = Trim(sessionmember.firstname) & " " & (Trim(sessionmember.middlename) & " ") & Trim(sessionmember.lastname)

Dim carid As Integer
carid = Val(Request.QueryString.Get("c"))

If carid = 0 Then
Response.Redirect("partlocator.aspx")
End If

Dim carfunct As diymember.diymembercarfunctions = New diymember.diymembercarfunctions
Dim mycar As diymember.diymembercardetail = New diymember.diymembercardetail

mycar = carfunct.carinfoget(sessionmember.memberid, carid)

'if there is nothing here - send them back!
'Response.Redirect("partlocator.aspx")
If mycar Is Nothing Then
Response.Redirect("partlocator.aspx")
End If

lblCarInfo.Text = mycar.year.ToString + " - " + RTrim(mycar.makename) + " " + RTrim(mycar.modelname) + " Engine: " + mycar.engine + " Tran: " + mycar.autotransmission + " Turbo: " + mycar.turbo + " A/C: " + mycar.aircondit + " Fourwheel: " + mycar.fourwheel + " VIN: " + RTrim(mycar.vin)
hidlabCarInfo.Text = mycar.year.ToString + " " + RTrim(mycar.makename) + " " + RTrim(mycar.modelname) + vbCr + "Engine: " + mycar.engine + vbCr + "Tran: " + mycar.autotransmission + vbCr + "Turbo: " + mycar.turbo + vbCr + "A/C: " + mycar.aircondit + vbCr + "Fourwheel: " + mycar.fourwheel + vbCr + "VIN: " + RTrim(mycar.vin)

End If

End Sub

Private Sub btnSubmit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSubmit.Click

If Len(LTrim(RTrim(tbxRequest.Text))) = 0 Then
lblError.Text = "Please indicate the parts you're Looking for!"
Return
End If

Dim sessionmember As diyauto.diymember.diymemberdetail = New diyauto.diymember.diymemberdetail
sessionmember = Session("userinfo")

If sessionmember Is Nothing Then
Session("loginreturnpage") = "/member/myaccount.aspx"
Response.Redirect(ConfigurationSettings.AppSettings("SiteHomePage") + "/member/loginagain.aspx")
End If

' lets prepare an e-mail and send it along to the parts folks!

Dim Maildiy As New System.Web.Mail.MailMessage
Maildiy.From = RTrim(sessionmember.email)
Maildiy.To = "joe@dotnet.itags.org.diyautoparts.com"
Maildiy.Subject = "WEBSITE PARTS REQUEST"
Maildiy.BodyFormat = Mail.MailFormat.Text
Maildiy.Body = "Web Part Request: " + DateTime.Now.ToLongDateString + " - " + DateTime.Now.ToLongTimeString + vbCr + vbCr + hidlabCarInfo.Text + vbCr + vbCr + "--------------------" + vbCr + vbCr + RTrim(tbxRequest.Text)
System.Web.Mail.SmtpMail.Send(Maildiy)
Maildiy = Nothing

' send an e-mail to the sender!
Dim MailCust As New System.Web.Mail.MailMessage
Dim replytext As String

MailCust.From = "parts@dotnet.itags.org.diyautoparts.com"
MailCust.To = RTrim(sessionmember.email)
MailCust.Subject = "DIYAUTOPARTS.COM - Part Request from Website"
'replytext = "Thank you for requesting car part information from DiyAutoparts.com. Your request has been entered into our system and we will contact you as soon as we have information for you." + vbCr + vbCr + "Our office hours are Monday - Friday 8:00am - 4:30pm EST." + vbCr + vbCr
'replytext += "Web Request time: " + DateTime.Now.ToLongDateString + " - " + DateTime.Now.ToLongTimeString + vbCr + vbCr
'replytext += hidlabCarInfo.Text + vbCr + vbCr + "------------------" + vbCr + vbCr + RTrim(tbxRequest.Text) + vbCr

MailCust.BodyFormat = Mail.MailFormat.Text

MailCust.Body = "Thank you for requesting car part information from DiyAutoparts.com. Your request has been entered into our system and we will contact you as soon as we have information for you." + vbCr + vbCr + "Our office hours are Monday - Friday 8:00am - 4:30pm EST." + vbCr + vbCr
MailCust.Body += "Web Request time: " + DateTime.Now.ToLongDateString + " - " + DateTime.Now.ToLongTimeString + vbCr + vbCr
MailCust.Body += hidlabCarInfo.Text + vbCr + vbCr + "------------------" + vbCr + vbCr + RTrim(tbxRequest.Text) + vbCr

'MailCust.Body = replytext
System.Web.Mail.SmtpMail.Send(MailCust)
MailCust = Nothing

Response.Redirect("partlocatorsub.aspx")

End Sub

Private Sub btnQuit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnQuit.Click
Response.Redirect("partlocator.aspx")
End Sub

Private Sub btnMyAcct_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnMyAcct.Click
Response.Redirect(ConfigurationSettings.AppSettings("SiteHomePage") + "/member/myaccount.aspx")
End Sub
End Class

How about just adding some vbCrLf characters in there where you want the line breaks?

Friday, March 16, 2012

Please help me to understand COM

Greetings,

I just started to learn ASP.NET. I'm not familiar with Windows programming since I was using LINUX/PHP for a long time.

I have several questions, answers to which can help me better understand ASP.NET.

My first practical task in ASP.NET is to create music manager which I already wrote in PHP. It is a database that hold albums/artists/songs/covers information. There also a class that reads/write id3v1 and id3v2 mp3 tags (http://getid3.org/).

Here is the main problem. I didn't find any class for ASP.NET that could do the same but there is a project named id3lib http://id3lib.sourceforge.net/ which can be used as a COM object. I have never worked with COM before and truly speaking hardly understand how it works.

Question: id3lib project has COM object included to work with id3 tags, how can I use it in ASP.NET? Where can I find tutorials on working with COM?

Any help is greatly appreciated.

Thanks!You can still reference COM components is ASP.NET. Simply reference the COM object along with the EnterpriseServices component, and .NET will use interop to talk to the COM object. It will be a little slower than if it were a regular .NET assembly, but you can still use it.

hope this helps,
sivilian