473,505 Members | 14,394 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Redirect aspx page

Tom
Hi,

I have an index.aspx page which includes top.aspx,
left.aspx, main.aspx and bottom.aspx.

In the left.aspx, there is a login web control -
login.ascx. It keeps session of username and role after
successful login and shows welcome user message and his
shopping cart link.

The page which shows welcome user message and his shopping
cart link called loginsuccess.ascx. Now, I am not sure how
to deal with the redirect page.

Here is the session code in login.ascx:
Expand|Select|Wrap|Line Numbers
  1. case LOGIN_SUCCESS:
  2. Session["UserName"] = UserName;
  3. Session["Role"] = Role;
  4. Response.Redirect("loginsuccess.ascx",true);
  5. break;
  6.  
I want to redirect page to be the same index.aspx which
has the same top.aspx, left.aspx, role.aspx and
bottom.aspx. In the left.aspx and main.aspx pages, I want
login.ascx turns to loginsuccess.ascx and main.aspx to
role.aspx according to the username and role.

How can I do it?

Thanks
Nov 18 '05 #1
3 9831
Tom wrote:
I want to redirect page to be the same index.aspx which
has the same top.aspx, left.aspx, role.aspx and
bottom.aspx. In the left.aspx and main.aspx pages, I want
login.ascx turns to loginsuccess.ascx and main.aspx to
role.aspx according to the username and role.
How can I do it?


Hello Tom,

I assume you're using frames and index.aspx contains the
frameset definitions ? When you redirect, you redirect the
whole browser window, not just the left part, so you have
to redirect to index.aspx. You could pass a parameter like :
Response.Redirect("index.aspx?Page=role.aspx",true );

Then index.aspx has to look at the "Page" URL parameter
to decide which page to load in the main frame.

From Page_Load in left.aspx, you can look at the session
variables to see if the user logged in, if he did,
you hide login.ascx and show loginsuccess.ascx, if he didn't,
you hide loginsuccess.ascx and show login.ascx.

You can also decide to dynamically load ( with LoadControl() )
login.ascx or loginsuccess.ascx instead of hiding and showing.

Another advice would be to stop using frames and use table
cells instead to split up your window in top,bottom,left,main.
To make the main part scrollable, you can use style="overflow:auto".
When you get rid of frames, you'll see that it's easier to write
web applications, because from the same index.aspx, you can now
easily access controls on all parts of the screen without having
to do ugly redirect tricks.

Best regards,

Eric
Nov 18 '05 #2
Tom
Dear Eric,
You can also decide to dynamically load ( with LoadControl
() ) login.ascx or loginsuccess.ascx instead of hiding and
showing.

Could you tell me some online tutorial or code example for
teaching LoadControl()?

Another advice would be to stop using frames and use table
cells instead to split up your window in
top,bottom,left,main.
To make the main part scrollable, you can use
style="overflow:auto".

Actually, I did not use frames. I use server side include
and web control. I want the whole page to be scrollable,
but not just the main part.

What do you suggest to maintain a web site which has
constant pages for top, left and bottom if not use server
side include and frames? (and whole page needs to be
scrollable)

Thanks for your kind help

Tom

Nov 18 '05 #3
Hello Tom,

Tom wrote:
Could you tell me some online tutorial or code example for
teaching LoadControl()?
..NET is documented very well, the Microsoft MSDN site
contains lots of information, including articles and
a class library reference in the library section.
The below URL points to a howto for LoadControl.

http://tinyurl.com/wrco

Note that though the example adds the dynamically loaded
control to the Page's Controls collection, you can add it
to any child controls' Controls collection as well.
What do you suggest to maintain a web site which has
constant pages for top, left and bottom if not use server
side include and frames? (and whole page needs to be
scrollable)


The way I did this was by having a single Page with all
the common layout and using UserControls as modules that
were dynamically loaded in the PlaceHolder on the main
section of the Page, depending on the "Page" URL parameter
received by the Page. In my case, the left part of the
Page would contain a PlaceHolder too, and the module
would load the appropriate UserControl there.

So to open the news "Page", the URL would be
http://somehost/index.aspx?Page=news
which would make index.aspx load news.ascx

And to open the myprofile "Page", the URL would be
http://somehost/index.aspx?Page=myprofile
which would make index.aspx load myprofile.aspx

If you want you can even create several layers
of templates, f.i. index.aspx containing everything
common for all pages, newsitem.ascx containing everything
common for all types of news items, sportnewsitem.ascx
containing everything common for sport news items, etc.
A URL could then look like :
http://somehost/index.aspx?Page=news...tem&Article=26

I believe I learnt this from :
http://www.smartisans.com/articles/vb_templates.aspx

Best regards,

Eric
Nov 18 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2512
by: Andy Todd | last post by:
Hi We have just moved an ASP.NET application into the live environment which is as follows: Sun Proxy Server / Firewall Windows 2000 Server / IIS5 The URL for the site maps to the Sun...
4
10581
by: bnob | last post by:
In a Button clik event I have this code at the end of the event Response.Redirect("Page.aspx") But in this event I must show a message before redirect to the Page.aspx. I use to show Message...
8
2154
by: Mantorok | last post by:
Hi all When I start a new thread that tries to call: HttpContext.Current.Response.Redirect() It fails as Current returns null, is there anyway to access the current httpcontext from within...
3
5472
by: Alan Silver | last post by:
Hello, Sorry if this is a stupid question, but I can't really see much difference between these tow methods according to the scant info in the SDK. Could anyone enlighten me? TIA -- Alan...
5
2013
by: Alan Silver | last post by:
Hello, I have a page that is supposed to do some checking, and if OK, set a session variable before redirecting to another page. The following code is a simplified version, I have hard-coded the...
5
4545
by: venner | last post by:
I'm having an issue with an ASP.NET website after upgrading to ASP.NET 2.0. The website makes use of a central authentication service (CAS) provided at the university I work for. Each page checks...
8
4897
by: Darrel | last post by:
I'm helping convert a 300+ page .html site into an ASP.net site. The client wants to set up 301 redirects for all of the old html pages. I've used ISAPI for this type of thing in the past, as it...
7
8009
by: seanmatthewwalsh | last post by:
Hi I have a page (default.aspx) that pulls it's HTML from a database. I then have a "content management" page (editpage.aspx) that allows the user to edit the HTML in the database. When the...
3
3510
by: jasonheath.net | last post by:
I apologize in advance for the length of this post. I wanted to get as much detail as possible in here. We have 1 web app that contains the functionality to do some single sign-on logic. The...
0
7098
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7303
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
5613
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5028
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4699
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3187
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3176
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1528
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
754
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.