Showing posts with label http. Show all posts
Showing posts with label http. Show all posts

Thursday, March 29, 2012

Performance of DataBinder.Eval

Howdy All,

I was reading an older posting about the performance hit of
DataBinder.Eval.

http://groups-beta.google.com/group...02b1685ae0f63c0

Am I correct in understanding that

<%# ((DataRowView)Container.DataIt*em)["EmployeeName"] %
would have better performance than
<%# DataBinder.Eval(Container.DataIt*em, ["EmployeeName"]) %
Does anybody have comments on this or is there a better way to set the
values of the Template Column?

thanks

dblDBL:
You are correct.

I can't give you numbers, but you ARE correct.

I will say 1 more thing however. Casting DataItem to the specific item
might be faster, but it violates your tiers and makes it harder to maintain.
Your presentation shouldn't know what TYPE of data source is being bound, it
should be implementation independent. The minute you start casting
everything, you make it a realy pain in the ass to change if you start using
collections or datasets.

Sometimes the penalty is too high to pay, but in my opinion in this case,
I'd strongly suggest you use DataBinder.Eval unless you have compelling
reasons why you shoudln't in your particular case.

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/ - New and Improved (yes, the popup is annoying)
http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
come!)

"DBLWizard" <ibflyfishin@.yahoo.com> wrote in message
news:1121106912.352713.81740@.g44g2000cwa.googlegro ups.com...
Howdy All,

I was reading an older posting about the performance hit of
DataBinder.Eval.

http://groups-beta.google.com/group...02b1685ae0f63c0

Am I correct in understanding that

<%# ((DataRowView)Container.DataIt*em)["EmployeeName"] %
would have better performance than
<%# DataBinder.Eval(Container.DataIt*em, ["EmployeeName"]) %
Does anybody have comments on this or is there a better way to set the
values of the Template Column?

thanks

dbl

Monday, March 26, 2012

'permanent' web site url while browsing?

Hi all!

Does anyone know of a way to keep a permanent url throughout a user's
browsing?

For example, if my web site's address is http://www.mysite.com,
I have noticed that some sites keep that url 'permanent' somehow,
i.e. doesn't change while e.g. clicking on a link!

How is this accomplished? Maybe some sort of script?

Thanks in advance!use a frame.

--
Best regards,
Dave Colliver.
http://www.AshfieldFOCUS.com
~~
http://www.FOCUSPortals.com - Local franchises available

"patrickdrd" <patrickdrd@.discussions.microsoft.comwrote in message
news:FDA51396-2304-4098-9A24-2AB478A8EF88@.microsoft.com...

Quote:

Originally Posted by

Hi all!
>
Does anyone know of a way to keep a permanent url throughout a user's
browsing?
>
For example, if my web site's address is http://www.mysite.com,
I have noticed that some sites keep that url 'permanent' somehow,
i.e. doesn't change while e.g. clicking on a link!
>
How is this accomplished? Maybe some sort of script?
>
Thanks in advance!


No, I don't like frames,
something else?
Hi,

patrickdrd wrote:

Quote:

Originally Posted by

No, I don't like frames,
something else?


Apart from frames of iframes, there are no alternatives using standard
HTML / JavaScript. Even when using URL rewriting, you still need to
provide a unique URL to the server.

Other solutions could be using WPF, Flash or any other type of plug-in.
In these cases, the navigation is not handled by the browser anymore,
but by the plug-in itself.

HTH,
Laurent
--
Laurent Bugnion [MVP ASP.NET]
Software engineering, Blog: http://www.galasoft-LB.ch
PhotoAlbum: http://www.galasoft-LB.ch/pictures
Support children in Calcutta: http://www.calcutta-espoir.ch
Even when using URL rewriting, you still need to

Quote:

Originally Posted by

provide a unique URL to the server.


I don't care about the server,
I care about what the client can see,
will the client realize the same url by that?
Hi,

patrickdrd wrote:

Quote:

Originally Posted by

Quote:

Originally Posted by

>Even when using URL rewriting, you still need to
>provide a unique URL to the server.


>
I don't care about the server,
I care about what the client can see,
will the client realize the same url by that?


Maybe you don't, but the web browser does care.

It's not possible, except by the solutions already provided to you.

Greetings,
Laurent
--
Laurent Bugnion [MVP ASP.NET]
Software engineering, Blog: http://www.galasoft-LB.ch
PhotoAlbum: http://www.galasoft-LB.ch/pictures
Support children in Calcutta: http://www.calcutta-espoir.ch
no

use forms.

So if the user clicks the biteme button, the page shows the biteme stuff.
if the user clicks the bitemybubbles button the page shows the bitemybubbles
stuff

same url the whole time
this is usually done one of 2 way:

1) site frameset
2) model-view-controller pattern (site is just one page)

-- bruce (sqlwork.com)

patrickdrd wrote:

Quote:

Originally Posted by

Hi all!
>
Does anyone know of a way to keep a permanent url throughout a user's
browsing?
>
For example, if my web site's address is http://www.mysite.com,
I have noticed that some sites keep that url 'permanent' somehow,
i.e. doesn't change while e.g. clicking on a link!
>
How is this accomplished? Maybe some sort of script?
>
Thanks in advance!


What about Server.Transfer?

Keep transferring the user to another page. The server knows, the client
doesn't.

This is (kinda) similar to proper MVC, which .NET doesn't really do that
well, in that the context keeps getting forwared somewhere else to handle
the request and provide the view.

"Laurent Bugnion [MVP]" <galasoft-lb@.bluewin.chwrote in message
news:OQlXfg3WHHA.1180@.TK2MSFTNGP05.phx.gbl...

Quote:

Originally Posted by

Hi,
>
patrickdrd wrote:

Quote:

Originally Posted by

Quote:

Originally Posted by

>>Even when using URL rewriting, you still need to provide a unique URL to
>>the server.


>>
>I don't care about the server,
>I care about what the client can see,
>will the client realize the same url by that?


>
Maybe you don't, but the web browser does care.
>
It's not possible, except by the solutions already provided to you.
>
Greetings,
Laurent
--
Laurent Bugnion [MVP ASP.NET]
Software engineering, Blog: http://www.galasoft-LB.ch
PhotoAlbum: http://www.galasoft-LB.ch/pictures
Support children in Calcutta: http://www.calcutta-espoir.ch

Wednesday, March 21, 2012

Permissions for website on localhost

I have a site "http://localhost/mysite" which has a page containing a window
s
user control which displays a list of all files in a folder on the client
machine.
When I run the webapp I obviously get an error message saying that the .net
framework wont allow permissions to do such a thing.
Can anyone tell me how I can set permissions on my machine so that I can run
this ?Have you defined the permissions in the IIS website properties?
Thats not the problem.
Its the client. I must set up the .net framework to accept any actions
coming from this URL. It must allow my dll to perform whatever it wants on
the client machine.
It just so happens that its on localhost at the moment.
Start here:
http://msdn.microsoft.com/library/d...esssecurity.asp
I have gone in to the .net configuration manager and set the URL as trusted
but still no joy.
To be honest, I'm not sure if this is even possible--at least, without
extensive work.
ASP.NET code executes on the server, and as such, that is all it has
access to.
In addition, JavaScript is restricted from accessing the file system,
so that rules that out.
The only way I could imagine being able to access the client's file
system is to create an ActiveX control that the clients would have to
download and install, and that code would have to be trusted on the
client machine.
You may be better off to re-evaluate the architecture of your
application--does it really need this functionality? If the answer is
yes, you should probably look into developing a windows forms/smart
client.
What exactly are you trying to do, anyway? Why would a user go to your
website to navigate the files on his local machine?

Permissions for website on localhost

I have a site "http://localhost/mysite" which has a page containing a windows
user control which displays a list of all files in a folder on the client
machine.
When I run the webapp I obviously get an error message saying that the .net
framework wont allow permissions to do such a thing.

Can anyone tell me how I can set permissions on my machine so that I can run
this ?Have you defined the permissions in the IIS website properties?
Thats not the problem.

Its the client. I must set up the .net framework to accept any actions
coming from this URL. It must allow my dll to perform whatever it wants on
the client machine.

It just so happens that its on localhost at the moment.
Start here:

http://msdn.microsoft.com/library/d...esssecurity.asp
I have gone in to the .net configuration manager and set the URL as trusted
but still no joy.
To be honest, I'm not sure if this is even possible--at least, without
extensive work.

ASP.NET code executes on the server, and as such, that is all it has
access to.

In addition, JavaScript is restricted from accessing the file system,
so that rules that out.

The only way I could imagine being able to access the client's file
system is to create an ActiveX control that the clients would have to
download and install, and that code would have to be trusted on the
client machine.

You may be better off to re-evaluate the architecture of your
application--does it really need this functionality? If the answer is
yes, you should probably look into developing a windows forms/smart
client.

What exactly are you trying to do, anyway? Why would a user go to your
website to navigate the files on his local machine?

Friday, March 16, 2012

persistant datalayer across http requests?

I was just wondering how keep my datamodel in the
middle tier in memory across multiple http request from the client
when using asp.net/c#? It has to persist per user. What is
the best way to do this?This is not the ASP.NET way. The ASP.NET way is to store in session
variables small units of data that will let you re-populate major data
components on every page build.

Eliyahu

"me" <wtumaxi@.forum.dk> wrote in message
news:6fd6d897.0407110446.d2cc019@.posting.google.co m...
> I was just wondering how keep my datamodel in the
> middle tier in memory across multiple http request from the client
> when using asp.net/c#? It has to persist per user. What is
> the best way to do this?
"me" <wtumaxi@.forum.dk> wrote in message
news:6fd6d897.0407110446.d2cc019@.posting.google.co m...
> I was just wondering how keep my datamodel in the
> middle tier in memory across multiple http request from the client
> when using asp.net/c#? It has to persist per user. What is
> the best way to do this?

Session state.
--
John Saunders
johnwsaundersiii at hotmail

persistant datalayer across http requests?

I was just wondering how keep my datamodel in the
middle tier in memory across multiple http request from the client
when using asp.net/c#? It has to persist per user. What is
the best way to do this?This is not the ASP.NET way. The ASP.NET way is to store in session
variables small units of data that will let you re-populate major data
components on every page build.
Eliyahu
"me" <wtumaxi@.forum.dk> wrote in message
news:6fd6d897.0407110446.d2cc019@.posting.google.com...
> I was just wondering how keep my datamodel in the
> middle tier in memory across multiple http request from the client
> when using asp.net/c#? It has to persist per user. What is
> the best way to do this?
"me" <wtumaxi@.forum.dk> wrote in message
news:6fd6d897.0407110446.d2cc019@.posting.google.com...
> I was just wondering how keep my datamodel in the
> middle tier in memory across multiple http request from the client
> when using asp.net/c#? It has to persist per user. What is
> the best way to do this?
Session state.
--
John Saunders
johnwsaundersiii at hotmail