473,399 Members | 3,106 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

link parameters

my web application consist of 3 frames :top, left and right, and I use form authentication to authenticate users in ASP.NET 1.
the right frame is where the data is displayed
I set the default page (as it's required by VS) to some of my pages (default.aspx)
there is somewhere in the application where an e-mail is sent to some users containing a url with parameters needed by the page (pageX.aspx) to query the database and return the result to the user
the way the e-mail is sent

Dim email As New System.Web.Mail.MailMessag
With emai
.To = "na**@email.com
... .... ......
.Body = "click on this link to open the page : <a href='http://mySite/pageX.aspx?id=" & param & "</a>
... ..... .......

when the user click the link, he get always directed to the default page, even if he was authenticated previously and the authentication cookie is saved on his machin

the authenticataion in Global.asax
If (Not (HttpContext.Current.User Is Nothing)) The
If (HttpContext.Current.User.Identity.IsAuthenticated ) The
If (HttpContext.Current.User.Identity.AuthenticationT ype = "Forms") The

Dim id As System.Web.Security.FormsIdentity = HttpContext.Current.User.Identit
Dim myTicket As System.Web.Security.FormsAuthenticationTicket = id.Ticke

Dim userData As String = myTicket.UserDat
Dim myRoles As String() = Split(userData, ","
HttpContext.Current.User = New System.Security.Principal.GenericPrincipal(id, myRoles
End I
End I

what am I supposed to do to let the user go directly to the page specified by the url where the designated page can query the parameter from the url ?

thanks for hel
Nov 18 '05 #1
6 2218
Hi,

From your description, you're using FormsAuthentication in your asp.net web
application and the web pages are layouted as frame based. top , left and
right. Currently, you will send a mail which contains a hyperlink point to
the
web application's certain page. However, you found everytime the user click
the link, he'll be reidirect to the default page in the web application
rather than the hyperlink's href url, yes?

As for the problem, I'm still wondering some points:
1. Since you put the url in a hyperlink in the email's body. Does the
problem remains if we put the link in a normal html page or type the url in
the browser's address bar directly to visit the page?

2. What's the page's position in the web application? Is it in the main
frame or a certain sub frame ? What does the default page? the default
document set in the IIS virutal directory? Based on my understanding , if
the problem occur in the FormsAuthentication, the user should be redirect
to the "Login" page rather than default page. What's your login page set in
the web.config's <forms > element?

3. Are you sure that when the problem occur, the user still has the
authentication cookie existing at clientside? If you manually type the url
of a protected page( deny="?") , can you visit it or be redirected to login
page?

In addition, there are many form threads on the similiar prolbems in this
newsgroup, you can search them in the google's "group" section. Maybe they
will also provide some clues.

If you have any questions or new findings, please feel free to post here.
Thanks.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx

Nov 18 '05 #2
I try to read the url in Default.aspx (frameset page) in order to see if the request has the parameter supplied by the link from the e-mail, by using
Request.ServerVariables("URL") OR Request.Url.AbsoluteUri OR request.Url OR ....
but I always get the url for the default page
Nov 18 '05 #3
Hi,

Thanks for the response. I'm still so confused about the url you put in the
hyperlink in the email and your page's strucutre. Would you please provide
me the full url you used to link to the certain page you want. And also, I
think you can provide the main frame page's url and how it control its sub
frame(top, left, right) 's src, For example

Http://servername/appname/mainframe.aspx?leftsrc= ... & rightsrc=...

Thus, it'll be helpful us to do some further research, Thanks.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx

Nov 18 '05 #4
Hi
here is more detail about the pages

Default.aspx page
<frameset rows="105px,*"><frame name="top_" src="topPage.aspx" ><frameset cols="155,*" ><frame name="left_" src="leftPage.aspx" ><frame name="right_" src="rightPage.htm" ></frameset></frameset

rightPage.html is just a welcome page, that will be replaced by other page, once user click any link from topPage.aspx(top frame
there is nothing in the code behind of this Default.aspx page

from some page in the app, I send an e-mail to a user containing this link as
.... ..... .......
email.Body
"open page product from this link: <a href='http://servername/appName/pageProduct.aspx?id=123' target='right'>
.... ...... ......

pageProduct.aspx is supposed to be loaded in the right frame of Default.aspx.
pageProduct.aspx is forced to be loaded into a frame through this client script
if (top.location == self.location) {top.location.href="Default.aspx";

and then it extract the parameter passed through the url : .... Request.QueryString("id") ....

What happens is; when the user click the link, the browser load the app and the welcome page load instead of pageProduct.aspx in the right frame, after the browser load the app completly, if the user click again on the link, pageProduct.aspx load in the right frame this time
I want that when the link is clicked , IE open a new window ,the app load, and pageProduct load automatically instead of the welcome page, without a need to click the link agai

I tried to read the url from Default.aspx page like
Request.Url.AbsoluteUri
o
Request.ServerVariables("URL")
so I can load the appropriate page depending on the url, but I always get the following url
http://servername/appName/Default.aspx.

thank ou again for any hel


Nov 18 '05 #5
Hi,

Thanks very much for your response and the detailed description, I think
I've got the your problem from the your last reply.

In your email, you used the following hyperlink
<a href='http://servername/appName/pageProduct.aspx?id=123' target='right'>

to open the pageProcduct page in the "right" frame, also in the pageProduct
you use the
if (top.location == self.location) {top.location.href="Default.aspx";}
javascript to make sure the top frame is the default page, yes?

The problems is that when the user first time click the link, there is no
existing opened IE window, of course , there is no "right" frame, so it
can't find the "right" frame and then open a new browser window and locate
the pageProduct.aspx page in it. Then because of the if (top.location ==
self.location) {top.location.href="Default.aspx";} code, the browser will
replace the page in it with the default.aspx , that's why you see the
default page and the right frame is the "wecome page" by default.
And when you click the hyperlink again, since there is an existing opened
browser with default page in it and it can find a "right" frame in it, this
time the pageProduct.aspx page will be successfully located in the right
frame of the existing default page. Do you understand this?

As for how to resolve this, I think we have to put some code logic to set
the sub frame's location in the default.aspx page. We can provide a
querystring parameter for the default.aspx page to spcecify which url will
be loaded in the right frame , then in the default page we specify the src
of the left frame according to the querystring's value

for example, we request the default page as following
http://servername/appname/default.as...geProduct.aspx

in the default page, we change the template as below
<frameset rows="105px,*"><frame name="top_" src="topPage.aspx" ><frameset
cols="155,*" ><frame name="left_" src="leftPage.aspx" ><frame name="right_"
src="<%= contentUrl %>" ></frameset></frameset>

contentUrl is a page member and we can set it in the Page_Load

Page_Load......
{
this.contentUrl = "welcome.html";
string url = Request.QueryString["url"];
if(url != null)
{
this.contentUrl = url;
}

}

Thus, we can dynamically change the right frame's page via providing a
querystring and we can change the script
in pageProduct.aspx as below:

if (top.location == self.location)
{
top.location.href="Default.aspx?url=" + self.location;
}

How do you think of this? In fact, you can have a look at MSDN library's
page's url , such as

http://msdn.microsoft.com/library/de...us/vsdebug/htm
l/vxgrfaspnetdebuggingsystemrequirements.asp

You can find the msdn library's article page will be always located in a
sub frame in the default.asp and there is a
"url" querystring used to speicfy the main frame's location.

Above is some of my suggestions. Hope helps. Thanks.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx



Nov 18 '05 #6
Hi Steven
thank you very much for your support, you were a great help for me

thank you again.
Nov 18 '05 #7

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

Similar topics

4
by: paul dallaire | last post by:
HI! I want to execute a link witch is in JavaScript, How do we execute this in asp server side if possible? Basically I don't want anyone to see this link in the code view. this is the link...
0
by: Viktor Popov | last post by:
Hi, I'm trying to do the following: I use a repeater control in ASP.NET/C# because I would like to show the content of one DataSet which is filled from SELECT QUERY. In DataSource I have the...
14
by: Stingray | last post by:
I think this is more of a general IE/HTTP question but I didn't know where to post. If this is not the place for it, please point me to the right group. Thanks. Here's my question: I have an...
1
by: Viktor Popov | last post by:
Hi, I'm trying to do the following: I use a repeater control in ASP.NET/C# because I would like to show the content of one DataSet which is filled from SELECT QUERY. In DataSource I have the...
2
by: flyingxu | last post by:
Hi, I run into a cstring related link problem in VC7. My solution has 3 projects, one MFC exe, two MFC extersion DLL. the two MFC extersion DLL export functions which use CString as parameters....
8
by: Abraxas | last post by:
How can I call a web service from an URL link? And the webservice redirects the user to another HTML page after it has done some actions. The redirection is no problem with this code: ...
7
by: Kurda Yon | last post by:
Hi everybody, I cannot understand the following thinks. The last line of the fillowing code produces a message about mistake (not a valid MySQL- Link resource): $link = mysql_connect(...
11
by: Kurda Yon | last post by:
Hi, I got this warning: mysql_query(): 4 is not a valid MySQL-Link resource. The line which cause this warning is: mysql_query("insert into $tablename (id,priority) values('$id', '0.00')",...
0
by: prakashsakthivel | last post by:
Hi Members How to pass more than one parameters via DDE link. to excel from any .exe or from excel to .exe. I have done for one parameter through text box from vb.exe. How I can sent more...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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
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
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,...

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.