Search:
Namespaces
Discussions
.NET v1.1
Feedback
Some Suggests (doubt with Session, cookies and post)
Messages
Related Types
This message was discovered on
ASPFriends.com 'aspngmigrate' list
.
gustavo.varo@itau.com.br
-- Moved from [aspngstart] to [aspngmigrate] by Let the good times roll <
Click here to reveal e-mail address
> --
Hello,
i would like to ask you some suggests. I'm working in a
site upsizing, and i'm migrating all asp pages to aspx
pages, but i have some doubts and if you could suggest
some tips for me i will be so happy.
1º doubt: how i need to do about the includes, before i
was using a lot of includes, what do you suggest to me,
change all includes to web user controls ??? and put the
web user controls in all pages that need the include.
2º doubt: what about the constants ? inside one include i
declared all of my constants, so i had all constants in
all pages of my projects that has the include inside the
page. What i need to do now ?
3º doubt: about the post !!! the post method doesn't exist
more, i always should use redirect ? The aspx works always
in the post back and after redirect to another page ? When
i need to use Server.Transfer ?
4º doubt: if i use cookieless=true, is there any way to
hidde the magic string(viewstate) in URL ?
i hope you can help me, because i asked this questions to
a lot of people and nobody knows answer me.
thanks alot.
Best regards,
Gustavo.
Reply to this message...
Alex Lowe
Gustavo,
Doubt1: I wouldn't say that every include file should become a User
Control but it depends on how you used includes in classic ASP. If the
include file contained mostly content (i.e. header, footer, navigation)
then it is a good candidate for a User Control. If the include file
contained mostly code (i.e. a bunch of utility functions or something
like that) then it is a good candidate for a class of some kind.
Doubt 2: Well, you have a couple options here.....you could create a
structure
(
http://msdn.microsoft.com/library/en-us/cpguide/html/cpconvaluetypes.as
p) with those values (if they mostly primitive types - integers, etc.)
and then access the structure in place of your constants (they work a
bit differently than constants so I suggest you do some reading about
structures before using them). Another option would be, depending on how
many constants you are talking about, to put the contants in the
web.config file. The web.config file is cached into memory so there is
no file I/O penalty and it gives you one central location with which to
access the constant values. I'm sure there are other ways you could
handle the contants but those are the ones off the top of my head.
Doubt 3: The questions in this doubt are a little confusing so I'm not
sure how to answer. It would probably be better if you posed a scenario
for us then we could help you with regards to if you should use
Response.Redirect vs. Server.Transfer. There are two main differences
between the two techniques:
1) Response.Redirect requires another roundtrip to the web server to
make the second request. This means that it is more network I/O and web
server intensive.=20
2) Server.Transfer is capable of transferring the posted back values to
the next page. You can use Server.Transfer("mypage.aspx", True) and the
second parameter tells the Transfer method to transfer the GET and POST
values to the next page so you can access them programmatically.
Doubt 4: I don't believe so. This value is not ViewState, it's the
Session ID. It needs to be there because that is where the Session ID
goes when choose not to have ASP.NET utilize a cookie. The idea is that
if you absolutely can't use a cookie based session then you allow
ASP.NET to use the QueryString - it has to store the Session ID
somewhere. =3D)
Hth,
Alex - AspFriends.com Moderation Team
Microsoft MVP - ASP.NET
***********************************************************
Translate C# code to VB.NET code at
http://aspalliance.com/aldotnet/examples/translate.aspx
***********************************************************
[Original message clipped]
Reply to this message...
Ad
MBR BootFX
Best-of-breed application framework for .NET projects, developed by Matthew Baxter-Reynolds and MBR IT
Copyright © Matthew Baxter-Reynolds 2001-2008. '.NET 247 Software Development Services' is a trading style of MBR IT Solutions Ltd.
Contact Us
-
Terms of Use
-
Privacy Policy
-
www.dotnet247.com