Showing posts with label client. Show all posts
Showing posts with label client. Show all posts

Thursday, March 29, 2012

Performance Q...

My development environment is ASP.Net with VB and .Net Framework 1.1. All my
browsers are IE5+.
I am injecting client validations codes like if the numbers of characters
are n set the focus to next text box, covert all the lower case to upper
case letter etc. I got like 20 textboxes which has client side injected
code. Will it be a performance issue?
Smithprobably not...unless your users are running 386s...
Karl
MY ASP.Net tutorials
http://www.openmymind.net/
"Smith John" <JohnSmith56@.hotmail.com> wrote in message
news:e0jdG5X2EHA.4028@.TK2MSFTNGP15.phx.gbl...
> My development environment is ASP.Net with VB and .Net Framework 1.1. All
my
> browsers are IE5+.
> I am injecting client validations codes like if the numbers of characters
> are n set the focus to next text box, covert all the lower case to upper
> case letter etc. I got like 20 textboxes which has client side injected
> code. Will it be a performance issue?
> Smith
>
>
>
Every instruction you write is a performance issue.
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
Neither a follower
nor a lender be.
"Smith John" <JohnSmith56@.hotmail.com> wrote in message
news:e0jdG5X2EHA.4028@.TK2MSFTNGP15.phx.gbl...
> My development environment is ASP.Net with VB and .Net Framework 1.1. All
my
> browsers are IE5+.
> I am injecting client validations codes like if the numbers of characters
> are n set the focus to next text box, covert all the lower case to upper
> case letter etc. I got like 20 textboxes which has client side injected
> code. Will it be a performance issue?
> Smith
>
>
>
Smith John wrote:

> My development environment is ASP.Net with VB and .Nadequatework 1.1. All
> my browsers are IE5+.
> I am injecting client validations codes like if the numbers of characters
> are n set the focus to next text box, covert all the lower case to upper
> case letter etc. I got like 20 textboxes which has client side injected
> code. Will it be a performance issue?
> Smith
I don't think so. We have a very extensive clien-side validation and get
adequate performance (less than 1 second response to client-side actions).

Performance Testing -WAS

Hi

I am trying to test an ASP .NET application using Microsoft test tool WAS.

There is an option called client as part of the WAS tool. The documentation says that I need to give the ip address of the client machines from which the testing will be done..

Cant I just use one client machine and test my application and simulate cuoncurrent users for a single machine itself?

Thanks
KalpaFor realistic performance testing, it's also recommended that you run the stress testing tool from a separate machine other than the Web server. The actual request generator can be fairly resource intensive while generating the Web requests and this overhead can affect performance of the Web site under max loads. However, even though the documentation states two machines are a requirement you can certainly run WAS on the same machine as the Web server, but don't expect 100% accurate results especially when you're testing at the top end load for the hardware you're running on.

Reference:
http://www.west-wind.com/presentations/webstress/webstress.htm

Monday, March 26, 2012

Performance tuning ASP.NET applications

I have an ASP.NET application where one of the pages has a Save button to allow the user to save their work. So I have a client running the application in Internet Explorer, a separate IIS server running IIS version 6 and a separate SQL Server 2000 server where the data is saved in a database.
Some users are experiencing major performance issues during the save process. I'm looking for any pointers to articles on the web which can help me analyze/determine where the bottlenecks are in the entire process, i.e. is it a client problem, IIS problem or SQL Server problem.
Any help on how to do this would be greatly appreciated!
Thanks!!

Here's a few online resources related to ASP.NET performance:
ASP.NET Performance Overview
Improving ASP.NET Performance
ASP.NET Performance
Getting Started - Enhancing Web Site Performance with Caching
Optimizing Performance in ASP.NET
Developing High-Performance ASP.NET Applications
Hope these links help.

-- Erik Reitan

ASP.NET User Education
This posting is provided "AS IS" with no warranties, and confers no rights.




Om Sri Sai Ram

Performance :
http://msdn.microsoft.com/practices/compcat/default.aspx?pull=/library/en-us/dnpag/html/scalenet.asp

Caching:
http://msdn.microsoft.com/practices/compcat/default.aspx?pull=/library/en-us/dnbda/html/cachingarch.asp
Thanks,
Ram

Saturday, March 24, 2012

Permission Problem writing to Disk in Asp.NET application

Here's what I need to do:
Due to a bug in Crystal Reports ExportToStream() method I can't stream a
Crystal Reports directly to the client as PDF and I must must use the
Export() and put the the PDF on disk first and stream to the client. That's
just how it is.

Question:
So I need to let the aspx user have write permissions to disk.. NOT GOOD.
How do I solve this? Can I somehow write the PDF to disk in another thread
with other writes? OR are ther other ways around this?

best regards
/Lars NetzelLars

Note : The code below is stripped from a asp.net project using a web
service. This project would relay a binary file from an internal web server
where Crystal reports is installed to an external web server. You will still
need write permissions for the directory you want to save to

You could try this, I hope It helps

Stream fs =
rep.ExportToStream(CrystalDecisions.Shared.ExportF ormatType.PortableDocFormat);
byte[] binaryfile = StreamToBinary(fs);
string docLocation = Server.MapPath(null) + @."\Docs\";
SaveFileToServer(binaryfile,docLocation,"my.pdf",DateTime.Now);
Response.Redirect("Docs/"+"my.pdf");

public void SaveFileToServer(byte[] binaryFile, string docPath, string
docName, DateTime fileModifiedDate)
{
Directory.CreateDirectory(docPath);
MemoryStream m = new MemoryStream(binaryFile);
FileStream f = new FileStream(docPath+docName,FileMode.Create);
m.WriteTo(f);
f.Close();
m.Close();
File.SetLastWriteTime(docPath+docName,fileModified Date);
}

public byte[] StreamToBinary(Stream fs)
{
Int32 i = Convert.ToInt32(fs.Length);
byte[] b = new byte[fs.Length];
fs.Read(b,0,i);
fs.Close();
}

"Lars Netzel" <lars.netzel@.NO-SPAM.qlogic.se> wrote in message
news:%23wlKhu8HFHA.3244@.TK2MSFTNGP09.phx.gbl...
> Here's what I need to do:
> Due to a bug in Crystal Reports ExportToStream() method I can't stream a
> Crystal Reports directly to the client as PDF and I must must use the
> Export() and put the the PDF on disk first and stream to the client.
> That's just how it is.
> Question:
> So I need to let the aspx user have write permissions to disk.. NOT GOOD.
> How do I solve this? Can I somehow write the PDF to disk in another thread
> with other writes? OR are ther other ways around this?
> best regards
> /Lars Netzel
Thanks but I can't ExportToStream due to a bug with record and
groupselections in the Crystal Reports Engine. so I can't use that code.

I need to write to disk with other permisisons than the ASPNET user

/Lars

"Kamal Vaghjiani" <kamal@.mortgageuk.com> wrote in message
news:Ok7aI59HFHA.2784@.TK2MSFTNGP09.phx.gbl...
> Lars
> Note : The code below is stripped from a asp.net project using a web
> service. This project would relay a binary file from an internal web
> server where Crystal reports is installed to an external web server. You
> will still need write permissions for the directory you want to save to
> You could try this, I hope It helps
> Stream fs =
> rep.ExportToStream(CrystalDecisions.Shared.ExportF ormatType.PortableDocFormat);
> byte[] binaryfile = StreamToBinary(fs);
> string docLocation = Server.MapPath(null) + @."\Docs\";
> SaveFileToServer(binaryfile,docLocation,"my.pdf",DateTime.Now);
> Response.Redirect("Docs/"+"my.pdf");
> public void SaveFileToServer(byte[] binaryFile, string docPath, string
> docName, DateTime fileModifiedDate)
> {
> Directory.CreateDirectory(docPath);
> MemoryStream m = new MemoryStream(binaryFile);
> FileStream f = new FileStream(docPath+docName,FileMode.Create);
> m.WriteTo(f);
> f.Close();
> m.Close();
> File.SetLastWriteTime(docPath+docName,fileModified Date);
> }
> public byte[] StreamToBinary(Stream fs)
> {
> Int32 i = Convert.ToInt32(fs.Length);
> byte[] b = new byte[fs.Length];
> fs.Read(b,0,i);
> fs.Close();
> }
>
> "Lars Netzel" <lars.netzel@.NO-SPAM.qlogic.se> wrote in message
> news:%23wlKhu8HFHA.3244@.TK2MSFTNGP09.phx.gbl...
>> Here's what I need to do:
>> Due to a bug in Crystal Reports ExportToStream() method I can't stream a
>> Crystal Reports directly to the client as PDF and I must must use the
>> Export() and put the the PDF on disk first and stream to the client.
>> That's just how it is.
>>
>> Question:
>> So I need to let the aspx user have write permissions to disk.. NOT GOOD.
>> How do I solve this? Can I somehow write the PDF to disk in another
>> thread with other writes? OR are ther other ways around this?
>>
>> best regards
>> /Lars Netzel
>>

Permission Problem writing to Disk in Asp.NET application

Here's what I need to do:
Due to a bug in Crystal Reports ExportToStream() method I can't stream a
Crystal Reports directly to the client as PDF and I must must use the
Export() and put the the PDF on disk first and stream to the client. That's
just how it is.
Question:
So I need to let the aspx user have write permissions to disk.. NOT GOOD.
How do I solve this? Can I somehow write the PDF to disk in another thread
with other writes? OR are ther other ways around this?
best regards
/Lars NetzelLars
Note : The code below is stripped from a asp.net project using a web
service. This project would relay a binary file from an internal web server
where Crystal reports is installed to an external web server. You will still
need write permissions for the directory you want to save to
You could try this, I hope It helps
Stream fs =
rep.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocForma
t);
byte[] binaryfile = StreamToBinary(fs);
string docLocation = Server.MapPath(null) + @."\Docs\";
SaveFileToServer(binaryfile,docLocation,
"my.pdf",DateTime.Now);
Response.Redirect("Docs/"+"my.pdf");
public void SaveFileToServer(byte[] binaryFile, string docPath, string
docName, DateTime fileModifiedDate)
{
Directory.CreateDirectory(docPath);
MemoryStream m = new MemoryStream(binaryFile);
FileStream f = new FileStream(docPath+docName,FileMode.Create);
m.WriteTo(f);
f.Close();
m.Close();
File. SetLastWriteTime(docPath+docName,fileMod
ifiedDate);
}
public byte[] StreamToBinary(Stream fs)
{
Int32 i = Convert.ToInt32(fs.Length);
byte[] b = new byte[fs.Length];
fs.Read(b,0,i);
fs.Close();
}
"Lars Netzel" <lars.netzel@.NO-SPAM.qlogic.se> wrote in message
news:%23wlKhu8HFHA.3244@.TK2MSFTNGP09.phx.gbl...
> Here's what I need to do:
> Due to a bug in Crystal Reports ExportToStream() method I can't stream a
> Crystal Reports directly to the client as PDF and I must must use the
> Export() and put the the PDF on disk first and stream to the client.
> That's just how it is.
> Question:
> So I need to let the aspx user have write permissions to disk.. NOT GOOD.
> How do I solve this? Can I somehow write the PDF to disk in another thread
> with other writes? OR are ther other ways around this?
> best regards
> /Lars Netzel
>
Thanks but I can't ExportToStream due to a bug with record and
groupselections in the Crystal Reports Engine. so I can't use that code.
I need to write to disk with other permisisons than the ASPNET user
/Lars
"Kamal Vaghjiani" <kamal@.mortgageuk.com> wrote in message
news:Ok7aI59HFHA.2784@.TK2MSFTNGP09.phx.gbl...
> Lars
> Note : The code below is stripped from a asp.net project using a web
> service. This project would relay a binary file from an internal web
> server where Crystal reports is installed to an external web server. You
> will still need write permissions for the directory you want to save to
> You could try this, I hope It helps
> Stream fs =
> rep.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFor
mat);
> byte[] binaryfile = StreamToBinary(fs);
> string docLocation = Server.MapPath(null) + @."\Docs\";
> SaveFileToServer(binaryfile,docLocation,
"my.pdf",DateTime.Now);
> Response.Redirect("Docs/"+"my.pdf");
> public void SaveFileToServer(byte[] binaryFile, string docPath, string
> docName, DateTime fileModifiedDate)
> {
> Directory.CreateDirectory(docPath);
> MemoryStream m = new MemoryStream(binaryFile);
> FileStream f = new FileStream(docPath+docName,FileMode.Create);
> m.WriteTo(f);
> f.Close();
> m.Close();
> File. SetLastWriteTime(docPath+docName,fileMod
ifiedDate);
> }
> public byte[] StreamToBinary(Stream fs)
> {
> Int32 i = Convert.ToInt32(fs.Length);
> byte[] b = new byte[fs.Length];
> fs.Read(b,0,i);
> fs.Close();
> }
>
> "Lars Netzel" <lars.netzel@.NO-SPAM.qlogic.se> wrote in message
> news:%23wlKhu8HFHA.3244@.TK2MSFTNGP09.phx.gbl...
>

Permission script

I'm going to deploy an web app on a client's server. It requires write
permission for the ASP.NET account for one of the folders.
c:/inetpub/wwwroot/mysite/logs
Is there a script that can automatically do that? in VBS? or BAT? or NET?
Assume my client has admin permission on the server.
Thanks,
AaronYou could write a bat file to use CACLS.EXE from the command line.
http://support.microsoft.com/?kbid=135268
Scott
http://www.OdeToCode.com/blogs/scott/
On Sat, 2 Apr 2005 16:11:00 -0700, "Aaron" <kuya789@.yahoo.com> wrote:

>I'm going to deploy an web app on a client's server. It requires write
>permission for the ASP.NET account for one of the folders.
>c:/inetpub/wwwroot/mysite/logs
>Is there a script that can automatically do that? in VBS? or BAT? or NET?
>Assume my client has admin permission on the server.
>Thanks,
>Aaron
>

Permission script

I'm going to deploy an web app on a client's server. It requires write
permission for the ASP.NET account for one of the folders.
c:/inetpub/wwwroot/mysite/logs
Is there a script that can automatically do that? in VBS? or BAT? or NET?

Assume my client has admin permission on the server.

Thanks,
AaronYou could write a bat file to use CACLS.EXE from the command line.
http://support.microsoft.com/?kbid=135268

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

On Sat, 2 Apr 2005 16:11:00 -0700, "Aaron" <kuya789@.yahoo.com> wrote:

>I'm going to deploy an web app on a client's server. It requires write
>permission for the ASP.NET account for one of the folders.
>c:/inetpub/wwwroot/mysite/logs
>Is there a script that can automatically do that? in VBS? or BAT? or NET?
>Assume my client has admin permission on the server.
>Thanks,
>Aaron

Wednesday, March 21, 2012

Permissions needed to run aspnet_regiis.exe -c

Hi,
I'm trying to install the client side scripts on a server, but I always get
the following error:
An error has occurred (0x80070005).
You must have administrative rights on this machine in order to run this
tool.
I am logged on as a domain admin on the server. Anyone know the specific
permissions needed to run the tool?
Thanks
Ericadmin on the box, not admin of the domain,
"Eric Caron" <ecaron@.nospam.quebecaffaires.com> wrote in message
news:e6H#X8wGEHA.712@.tk2msftngp13.phx.gbl...
> Hi,
> I'm trying to install the client side scripts on a server, but I always
get
> the following error:
> An error has occurred (0x80070005).
> You must have administrative rights on this machine in order to run this
> tool.
> I am logged on as a domain admin on the server. Anyone know the specific
> permissions needed to run the tool?
> Thanks
> Eric
>
Well, obviously I am. When you join a server to a domain, the Domain Admin
group is automatically added to the local Administrators group. I verified
it to be sure that nothing had changed. I think it's really a permissions
problem somewhere.
"Mike" <scoobyDoo@.sbcglobal.net> wrote in message
news:upsvkjyGEHA.3372@.TK2MSFTNGP09.phx.gbl...
> admin on the box, not admin of the domain,
>
> "Eric Caron" <ecaron@.nospam.quebecaffaires.com> wrote in message
> news:e6H#X8wGEHA.712@.tk2msftngp13.phx.gbl...
> get
specific
>
Obviously your not you could run it now.
Check again, just because your an admin on the domain does not make you a
admin on the local machine
I'm currently an admin on my local pc but not the domain.
"Eric Caron" <ecaron@.nospam.quebecaffaires.com> wrote in message
news:u8WqsvyGEHA.628@.TK2MSFTNGP10.phx.gbl...
> Well, obviously I am. When you join a server to a domain, the Domain
Admin
> group is automatically added to the local Administrators group. I
verified
> it to be sure that nothing had changed. I think it's really a permissions
> problem somewhere.
> "Mike" <scoobyDoo@.sbcglobal.net> wrote in message
> news:upsvkjyGEHA.3372@.TK2MSFTNGP09.phx.gbl...
always
this
> specific
>

Permissions needed to run aspnet_regiis.exe -c

Hi,

I'm trying to install the client side scripts on a server, but I always get
the following error:

An error has occurred (0x80070005).
You must have administrative rights on this machine in order to run this
tool.

I am logged on as a domain admin on the server. Anyone know the specific
permissions needed to run the tool?

Thanks

Ericadmin on the box, not admin of the domain,

"Eric Caron" <ecaron@.nospam.quebecaffaires.com> wrote in message
news:e6H#X8wGEHA.712@.tk2msftngp13.phx.gbl...
> Hi,
> I'm trying to install the client side scripts on a server, but I always
get
> the following error:
> An error has occurred (0x80070005).
> You must have administrative rights on this machine in order to run this
> tool.
> I am logged on as a domain admin on the server. Anyone know the specific
> permissions needed to run the tool?
> Thanks
> Eric
Well, obviously I am. When you join a server to a domain, the Domain Admin
group is automatically added to the local Administrators group. I verified
it to be sure that nothing had changed. I think it's really a permissions
problem somewhere.

"Mike" <scoobyDoo@.sbcglobal.net> wrote in message
news:upsvkjyGEHA.3372@.TK2MSFTNGP09.phx.gbl...
> admin on the box, not admin of the domain,
>
> "Eric Caron" <ecaron@.nospam.quebecaffaires.com> wrote in message
> news:e6H#X8wGEHA.712@.tk2msftngp13.phx.gbl...
> > Hi,
> > I'm trying to install the client side scripts on a server, but I always
> get
> > the following error:
> > An error has occurred (0x80070005).
> > You must have administrative rights on this machine in order to run this
> > tool.
> > I am logged on as a domain admin on the server. Anyone know the
specific
> > permissions needed to run the tool?
> > Thanks
> > Eric
Obviously your not you could run it now.
Check again, just because your an admin on the domain does not make you a
admin on the local machine
I'm currently an admin on my local pc but not the domain.

"Eric Caron" <ecaron@.nospam.quebecaffaires.com> wrote in message
news:u8WqsvyGEHA.628@.TK2MSFTNGP10.phx.gbl...
> Well, obviously I am. When you join a server to a domain, the Domain
Admin
> group is automatically added to the local Administrators group. I
verified
> it to be sure that nothing had changed. I think it's really a permissions
> problem somewhere.
> "Mike" <scoobyDoo@.sbcglobal.net> wrote in message
> news:upsvkjyGEHA.3372@.TK2MSFTNGP09.phx.gbl...
> > admin on the box, not admin of the domain,
> > "Eric Caron" <ecaron@.nospam.quebecaffaires.com> wrote in message
> > news:e6H#X8wGEHA.712@.tk2msftngp13.phx.gbl...
> > > Hi,
> > > > I'm trying to install the client side scripts on a server, but I
always
> > get
> > > the following error:
> > > > An error has occurred (0x80070005).
> > > You must have administrative rights on this machine in order to run
this
> > > tool.
> > > > I am logged on as a domain admin on the server. Anyone know the
> specific
> > > permissions needed to run the tool?
> > > > Thanks
> > > > Eric
> >

Permissions needed to run aspnet_regiis.exe -c

Hi,

I'm trying to install the client side scripts on a server, but I always get
the following error:

An error has occurred (0x80070005).
You must have administrative rights on this machine in order to run this
tool.

I am logged on as a domain admin on the server. Anyone know the specific
permissions needed to run the tool?

Thanks

Ericadmin on the box, not admin of the domain,

"Eric Caron" <ecaron@.nospam.quebecaffaires.com> wrote in message
news:e6H#X8wGEHA.712@.tk2msftngp13.phx.gbl...
> Hi,
> I'm trying to install the client side scripts on a server, but I always
get
> the following error:
> An error has occurred (0x80070005).
> You must have administrative rights on this machine in order to run this
> tool.
> I am logged on as a domain admin on the server. Anyone know the specific
> permissions needed to run the tool?
> Thanks
> Eric
Well, obviously I am. When you join a server to a domain, the Domain Admin
group is automatically added to the local Administrators group. I verified
it to be sure that nothing had changed. I think it's really a permissions
problem somewhere.

"Mike" <scoobyDoo@.sbcglobal.net> wrote in message
news:upsvkjyGEHA.3372@.TK2MSFTNGP09.phx.gbl...
> admin on the box, not admin of the domain,
>
> "Eric Caron" <ecaron@.nospam.quebecaffaires.com> wrote in message
> news:e6H#X8wGEHA.712@.tk2msftngp13.phx.gbl...
> > Hi,
> > I'm trying to install the client side scripts on a server, but I always
> get
> > the following error:
> > An error has occurred (0x80070005).
> > You must have administrative rights on this machine in order to run this
> > tool.
> > I am logged on as a domain admin on the server. Anyone know the
specific
> > permissions needed to run the tool?
> > Thanks
> > Eric
Obviously your not you could run it now.
Check again, just because your an admin on the domain does not make you a
admin on the local machine
I'm currently an admin on my local pc but not the domain.

"Eric Caron" <ecaron@.nospam.quebecaffaires.com> wrote in message
news:u8WqsvyGEHA.628@.TK2MSFTNGP10.phx.gbl...
> Well, obviously I am. When you join a server to a domain, the Domain
Admin
> group is automatically added to the local Administrators group. I
verified
> it to be sure that nothing had changed. I think it's really a permissions
> problem somewhere.
> "Mike" <scoobyDoo@.sbcglobal.net> wrote in message
> news:upsvkjyGEHA.3372@.TK2MSFTNGP09.phx.gbl...
> > admin on the box, not admin of the domain,
> > "Eric Caron" <ecaron@.nospam.quebecaffaires.com> wrote in message
> > news:e6H#X8wGEHA.712@.tk2msftngp13.phx.gbl...
> > > Hi,
> > > > I'm trying to install the client side scripts on a server, but I
always
> > get
> > > the following error:
> > > > An error has occurred (0x80070005).
> > > You must have administrative rights on this machine in order to run
this
> > > tool.
> > > > I am logged on as a domain admin on the server. Anyone know the
> specific
> > > permissions needed to run the tool?
> > > > Thanks
> > > > Eric
> >

Friday, March 16, 2012

persistance of Classes

I'm A client server developer by trade and i'm moving my skill set slowly
over to ASP.NET.
One question, I have a class, that i populate on a postback... I want to
keep this data persistant though other multiple postbacks.
What is the desired mechanism to use this.
I'm using the following code but not sure if this is the appropriate
solution to the problem
Private PatientDetails As Patient
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
If ViewState("Patient") Is Nothing Then
PatientDetails = New Patient
viewstate.Add("Patient", PatientDetails)
Else
PatientDetails = New Patient
PatientDetails = viewstate("Patient")
End If
Private Function SearchPAS() As Boolean ' called by a button clik
PASmsg = PatientDetails.GetPASDetails(cSite, byCriteria, lbText.Text)
'which fills all the property fields
viewstate("Patient") = PatientDetails
end functionAdtmitedly this doesn't work yet because its not serialized, i'm also
working on how to do that as well
"Namshub" <Richard._NoSpam_ForME_Pullen@.Southend.nhs.uk> wrote in message
news:eqKZwy8KFHA.1176@.TK2MSFTNGP12.phx.gbl...
> I'm A client server developer by trade and i'm moving my skill set slowly
> over to ASP.NET.
> One question, I have a class, that i populate on a postback... I want to
> keep this data persistant though other multiple postbacks.
> What is the desired mechanism to use this.
> I'm using the following code but not sure if this is the appropriate
> solution to the problem
> Private PatientDetails As Patient
> Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
> System.EventArgs) Handles MyBase.Load
> If ViewState("Patient") Is Nothing Then
> PatientDetails = New Patient
> viewstate.Add("Patient", PatientDetails)
> Else
> PatientDetails = New Patient
> PatientDetails = viewstate("Patient")
> End If
> Private Function SearchPAS() As Boolean ' called by a button clik
> PASmsg = PatientDetails.GetPASDetails(cSite, byCriteria, lbText.Text)
> 'which fills all the property fields
> viewstate("Patient") = PatientDetails
> end function
>
>
As long as your Patient class is serializable (which it apparently is), and
the extra HTML it adds to the document doesn't slow the response time down
too much, it's an excellent way to accomplish your goal. :)
HTH,
Kevin Spencer
Microsoft MVP
.Net Developer
What You S Is What You Get.
"Namshub" <Richard._NoSpam_ForME_Pullen@.Southend.nhs.uk> wrote in message
news:eqKZwy8KFHA.1176@.TK2MSFTNGP12.phx.gbl...
> I'm A client server developer by trade and i'm moving my skill set slowly
> over to ASP.NET.
> One question, I have a class, that i populate on a postback... I want to
> keep this data persistant though other multiple postbacks.
> What is the desired mechanism to use this.
> I'm using the following code but not sure if this is the appropriate
> solution to the problem
> Private PatientDetails As Patient
> Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
> System.EventArgs) Handles MyBase.Load
> If ViewState("Patient") Is Nothing Then
> PatientDetails = New Patient
> viewstate.Add("Patient", PatientDetails)
> Else
> PatientDetails = New Patient
> PatientDetails = viewstate("Patient")
> End If
> Private Function SearchPAS() As Boolean ' called by a button clik
> PASmsg = PatientDetails.GetPASDetails(cSite, byCriteria, lbText.Text)
> 'which fills all the property fields
> viewstate("Patient") = PatientDetails
> end function
>
>
Here is an excellent article/blog on making the viewstate serialization the
most efficient for custom classes. In a nutshell, viewstate does a really
good job serializing a specific set of objects, for anything else, your
better off to create a custom type converter.
http://weblogs.asp.net/vga/archive/...It.asp
x
"Namshub" wrote:

> I'm A client server developer by trade and i'm moving my skill set slowly
> over to ASP.NET.
> One question, I have a class, that i populate on a postback... I want to
> keep this data persistant though other multiple postbacks.
> What is the desired mechanism to use this.
> I'm using the following code but not sure if this is the appropriate
> solution to the problem
> Private PatientDetails As Patient
> Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
> System.EventArgs) Handles MyBase.Load
> If ViewState("Patient") Is Nothing Then
> PatientDetails = New Patient
> viewstate.Add("Patient", PatientDetails)
> Else
> PatientDetails = New Patient
> PatientDetails = viewstate("Patient")
> End If
> Private Function SearchPAS() As Boolean ' called by a button clik
> PASmsg = PatientDetails.GetPASDetails(cSite, byCriteria, lbText.Text)
> 'which fills all the property fields
> viewstate("Patient") = PatientDetails
> end function
>
>
Hi,
You have several methods of persisting data between postbacks:
1. Using the view state - The entire viewstate data is serialized to a
hidden input field in the output html and then deserialized at postback.
This is good if your object does not contain large amounts of data
(serialization to the output html = large html output = slow loading for the
user).
2. Using the session state. This way the data is saved on the server between
postbacks (there are 3 different session state configurations you should
read about in MSDN).
Eran Kampf
http://www.ekampf.com/blog
http://www.ekampf.com
"Namshub" <Richard._NoSpam_ForME_Pullen@.Southend.nhs.uk> wrote in message
news:eqKZwy8KFHA.1176@.TK2MSFTNGP12.phx.gbl...
> I'm A client server developer by trade and i'm moving my skill set slowly
> over to ASP.NET.
> One question, I have a class, that i populate on a postback... I want to
> keep this data persistant though other multiple postbacks.
> What is the desired mechanism to use this.
> I'm using the following code but not sure if this is the appropriate
> solution to the problem
> Private PatientDetails As Patient
> Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
> System.EventArgs) Handles MyBase.Load
> If ViewState("Patient") Is Nothing Then
> PatientDetails = New Patient
> viewstate.Add("Patient", PatientDetails)
> Else
> PatientDetails = New Patient
> PatientDetails = viewstate("Patient")
> End If
> Private Function SearchPAS() As Boolean ' called by a button clik
> PASmsg = PatientDetails.GetPASDetails(cSite, byCriteria, lbText.Text)
> 'which fills all the property fields
> viewstate("Patient") = PatientDetails
> end function
>
>

persistance of Classes

I'm A client server developer by trade and i'm moving my skill set slowly
over to ASP.NET.

One question, I have a class, that i populate on a postback... I want to
keep this data persistant though other multiple postbacks.

What is the desired mechanism to use this.

I'm using the following code but not sure if this is the appropriate
solution to the problem

Private PatientDetails As Patient

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load

If ViewState("Patient") Is Nothing Then

PatientDetails = New Patient

viewstate.Add("Patient", PatientDetails)

Else

PatientDetails = New Patient

PatientDetails = viewstate("Patient")

End If

Private Function SearchPAS() As Boolean ' called by a button clik

PASmsg = PatientDetails.GetPASDetails(cSite, byCriteria, lbText.Text)
'which fills all the property fields

viewstate("Patient") = PatientDetails

end functionAdtmitedly this doesn't work yet because its not serialized, i'm also
working on how to do that as well

"Namshub" <Richard._NoSpam_ForME_Pullen@.Southend.nhs.uk> wrote in message
news:eqKZwy8KFHA.1176@.TK2MSFTNGP12.phx.gbl...
> I'm A client server developer by trade and i'm moving my skill set slowly
> over to ASP.NET.
> One question, I have a class, that i populate on a postback... I want to
> keep this data persistant though other multiple postbacks.
> What is the desired mechanism to use this.
> I'm using the following code but not sure if this is the appropriate
> solution to the problem
> Private PatientDetails As Patient
> Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
> System.EventArgs) Handles MyBase.Load
> If ViewState("Patient") Is Nothing Then
> PatientDetails = New Patient
> viewstate.Add("Patient", PatientDetails)
> Else
> PatientDetails = New Patient
> PatientDetails = viewstate("Patient")
> End If
> Private Function SearchPAS() As Boolean ' called by a button clik
> PASmsg = PatientDetails.GetPASDetails(cSite, byCriteria, lbText.Text)
> 'which fills all the property fields
> viewstate("Patient") = PatientDetails
> end function
As long as your Patient class is serializable (which it apparently is), and
the extra HTML it adds to the document doesn't slow the response time down
too much, it's an excellent way to accomplish your goal. :)

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
What You Seek Is What You Get.

"Namshub" <Richard._NoSpam_ForME_Pullen@.Southend.nhs.uk> wrote in message
news:eqKZwy8KFHA.1176@.TK2MSFTNGP12.phx.gbl...
> I'm A client server developer by trade and i'm moving my skill set slowly
> over to ASP.NET.
> One question, I have a class, that i populate on a postback... I want to
> keep this data persistant though other multiple postbacks.
> What is the desired mechanism to use this.
> I'm using the following code but not sure if this is the appropriate
> solution to the problem
> Private PatientDetails As Patient
> Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
> System.EventArgs) Handles MyBase.Load
> If ViewState("Patient") Is Nothing Then
> PatientDetails = New Patient
> viewstate.Add("Patient", PatientDetails)
> Else
> PatientDetails = New Patient
> PatientDetails = viewstate("Patient")
> End If
> Private Function SearchPAS() As Boolean ' called by a button clik
> PASmsg = PatientDetails.GetPASDetails(cSite, byCriteria, lbText.Text)
> 'which fills all the property fields
> viewstate("Patient") = PatientDetails
> end function
Hi,
You have several methods of persisting data between postbacks:
1. Using the view state - The entire viewstate data is serialized to a
hidden input field in the output html and then deserialized at postback.
This is good if your object does not contain large amounts of data
(serialization to the output html = large html output = slow loading for the
user).
2. Using the session state. This way the data is saved on the server between
postbacks (there are 3 different session state configurations you should
read about in MSDN).

--
Eran Kampf
http://www.ekampf.com/blog
http://www.ekampf.com

"Namshub" <Richard._NoSpam_ForME_Pullen@.Southend.nhs.uk> wrote in message
news:eqKZwy8KFHA.1176@.TK2MSFTNGP12.phx.gbl...
> I'm A client server developer by trade and i'm moving my skill set slowly
> over to ASP.NET.
> One question, I have a class, that i populate on a postback... I want to
> keep this data persistant though other multiple postbacks.
> What is the desired mechanism to use this.
> I'm using the following code but not sure if this is the appropriate
> solution to the problem
> Private PatientDetails As Patient
> Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
> System.EventArgs) Handles MyBase.Load
> If ViewState("Patient") Is Nothing Then
> PatientDetails = New Patient
> viewstate.Add("Patient", PatientDetails)
> Else
> PatientDetails = New Patient
> PatientDetails = viewstate("Patient")
> End If
> Private Function SearchPAS() As Boolean ' called by a button clik
> PASmsg = PatientDetails.GetPASDetails(cSite, byCriteria, lbText.Text)
> 'which fills all the property fields
> viewstate("Patient") = PatientDetails
> end function
Here is an excellent article/blog on making the viewstate serialization the
most efficient for custom classes. In a nutshell, viewstate does a really
good job serializing a specific set of objects, for anything else, your
better off to create a custom type converter.

http://weblogs.asp.net/vga/archive/...terGetAtIt.aspx

"Namshub" wrote:

> I'm A client server developer by trade and i'm moving my skill set slowly
> over to ASP.NET.
> One question, I have a class, that i populate on a postback... I want to
> keep this data persistant though other multiple postbacks.
> What is the desired mechanism to use this.
> I'm using the following code but not sure if this is the appropriate
> solution to the problem
> Private PatientDetails As Patient
> Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
> System.EventArgs) Handles MyBase.Load
> If ViewState("Patient") Is Nothing Then
> PatientDetails = New Patient
> viewstate.Add("Patient", PatientDetails)
> Else
> PatientDetails = New Patient
> PatientDetails = viewstate("Patient")
> End If
> Private Function SearchPAS() As Boolean ' called by a button clik
> PASmsg = PatientDetails.GetPASDetails(cSite, byCriteria, lbText.Text)
> 'which fills all the property fields
> viewstate("Patient") = PatientDetails
> end function
>
>