Showing posts with label response. Show all posts
Showing posts with label response. Show all posts

Thursday, March 29, 2012

Server Side Tags and Performance <% ... %>

Do server Side tags decrease performance ... i.e.

Does it make any difference from

<% response.write "A" %
<% response.write "B" %
<% response.write "C" %
<% response.write "D" %

t

<%
response.write "A"
response.write "B"
response.write "C"
response.write "D"
%

Cheer

Mik

--
Posted using Wimdows.net Newsgroups - http://www.wimdows.net/newsgroups/No, there is no perf difference. ASP.NET is a different implementation that
ASP, so many of the tips and tricks used there are not applicable in ASP.NET.

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

> Do server Side tags decrease performance ... i.e.
> Does it make any difference from:
> <% response.write "A" %>
> <% response.write "B" %>
> <% response.write "C" %>
> <% response.write "D" %>
> to
> <%
> response.write "A"
> response.write "B"
> response.write "C"
> response.write "D"
> %>
> Cheers
> Mike
> --
> Posted using Wimdows.net Newsgroups -
> http://www.wimdows.net/newsgroups/
Thanks ... so my next question is did it make any difference in classic ap then ?

--
Posted using Wimdows.net Newsgroups - http://www.wimdows.net/newsgroups/
Thanks ... so my next question is did it make any difference in classic asp then ?

--
Posted using Wimdows.net Newsgroups - http://www.wimdows.net/newsgroups/
> Thanks ... so my next question is did it make any difference in
> classic ap then ?

Heh, yes it did. The transition form static content to script blocks was
overhead. But, as I said before, ASP.NET has a different design, so they're
not affected by that issue.

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

Server Side Tags and Performance <% ... %>

Do server Side tags decrease performance ... i.e.
Does it make any difference from:
<% response.write "A" %>
<% response.write "B" %>
<% response.write "C" %>
<% response.write "D" %>
to
<%
response.write "A"
response.write "B"
response.write "C"
response.write "D"
%>
Cheers
Mike
Posted using Wimdows.net Newsgroups - http://www.wimdows.net/newsgroups/No, there is no perf difference. ASP.NET is a different implementation that
ASP, so many of the tips and tricks used there are not applicable in ASP.NET
.
-Brock
DevelopMentor
http://staff.develop.com/ballen

> Do server Side tags decrease performance ... i.e.
> Does it make any difference from:
> <% response.write "A" %>
> <% response.write "B" %>
> <% response.write "C" %>
> <% response.write "D" %>
> to
> <%
> response.write "A"
> response.write "B"
> response.write "C"
> response.write "D"
> %>
> Cheers
> Mike
> --
> Posted using Wimdows.net Newsgroups -
> http://www.wimdows.net/newsgroups/
Thanks ... so my next question is did it make any difference in classic ap t
hen ?
Posted using Wimdows.net Newsgroups - http://www.wimdows.net/newsgroups/
Thanks ... so my next question is did it make any difference in classic asp
then ?
Posted using Wimdows.net Newsgroups - http://www.wimdows.net/newsgroups/
> Thanks ... so my next question is did it make any difference in
> classic ap then ?
Heh, yes it did. The transition form static content to script blocks was
overhead. But, as I said before, ASP.NET has a different design, so they're
not affected by that issue.
-Brock
DevelopMentor
http://staff.develop.com/ballen

Monday, March 26, 2012

Server Transfer vs Response.redirect.

Ok, maybee this is a silly question but...

What is the main difference between using a Server.Transfer command and a Response.Redirect?

And when should I use what?

Regards

Ola.

Take a look at the following article:

Server.Transfer vs. Response.Redirect

HTH


Thanks, this is usefull to know.

Regards

Ola

Saturday, March 24, 2012

Server Variable

Specifically, I am looking for a response.write variable for the version of dot.net running on a server.

But on a more general level I would like know a simply command to see all the available server variables on a server with dot.net.

Thanks !!Are you talking about the ServerVariables?
(request.ServerVariables)

There's a whole list of possible items there - - -

All you need to do is to turn on Tracing on your page, and you can see all of them at work.
Excellent --

Request.ServerVariables that is what I was looking for.

However, What does turn on tracing mean? Is that something I do like define the language?

Thanks --
To turn on tracing, go to your page's <@.page directive and add Trace="true", then run the page. You'll see what it does.

Server, Session, Request and Response in Classes?

Hi there,

Perhaps a really strange question...

Is there a way that I can access the Server, Session Request and Response objects from the current page request from inside a class (not a web control) without explicitly passing them in from a web control?

My problem is that I have been developing my web application thinking that all static class members would be reset after each page request - but I've just realized that those members keep their values from request to request (and I assume across all users too?) This means I have some major restructuring to do, and the only way I can think of fixing this is to store my user-specific objects in the user session...and thus, I need access to the Session in some of my classes that accessed those static members. :S

Having a tough time wrapping my mind around the whole thing at the moment...I'm used to ASP 5.0. Maybe there's a better way to go about this altogether.

to access those items from a non-page class, you can use:

HttpContext.Current

this will give you access to

HttpContext.Current.Session
HttpContext.Current.Request
etc...


The class member properties/values wont be passed unless you are rebinding them, saving them in session/application or some other way passing them. It's more then likely a matter of how you are populating them that's causing you frustration.

Show the specific code you are using and what you think is the cause of the problem... we'll see what we can do to help out.


I think I know what you mean. Offloading stuff blindly into the user session is not a good idea. I have a lot of restructuring to do...

Speaking of which, there doesn't happen to be a convenient way to get the current instance of the System.Web.UI.Page object from within any class, is there? I couldn't find anything relevant to this in the HttpContext, and I don't know where else to look.

Thanks!!


you shoudnt need it in your class (the business layer should be UI independent).... if, for some reason you do though you'll have to pass in the instance of it.

Draggor:

there doesn't happen to be a convenient way to get the current instance of the System.Web.UI.Page object from within any class, is there?

You can get at the current page instance from HttpContext like this:

Dim currentPageAs Page =DirectCast(HttpContext.Current.Handler, Page)