.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Melody Anderson
Eminent IT
Post New Web Links

hyperlink in Excel and login redirect

Posted By:      Posted Date: October 13, 2010    Points: 0   Category :ASP.Net

The user has a .xlsx with links pointing to a portal page witch require user logon.

First time (clicking on a link) the login.aspx?ReturnUrl=... is displayed, as expected. User logs in.

Second time, login.aspx?ReturnUrl=... displayed again, wrongly, bec user is already loged on.

It's seems, Excel calls the original link directly, server redirects (bec, excel is not loged in), than excel lunch the browser with new redirected url.

I can't simply redirect the user automatically, bec login.aspx is displayed also when the user has no permmissons.

What can I do?


View Complete Post

More Related Resource Links

After login redirect to a desired page

Hi,   Just a simple question. After I click login button, I want to page be redirected to display.aspx. How to set up it? Sorry for the silly question.

Authentication required, redirect to login page

Hi,I want authentication required for all webpages in a site. If i copy the url of any of the web page in the current site and paste it in the url address i should redirect to login page. If you have any solution please suggest it.

How to redirect incorrect login?

I have a Membership login.If the "login incorrect", the page is redirected to www.domain.com / LoginError.aspx,If the "login incorrect" the page is redirected to the previous web page history.back ()What do I do?Please Help.

how to redirect user to login page if session is null

i have 2 page,1.login.aspx ---  2.welcome.aspxin my login.aspx im storing username into sesssion as below:Session["usernm"] = txtUsername.Text;in my welcome.aspx  pagein page_load event if (Session["usernm"]==null)        {            Response.Redirect("Login.aspx");        }----- here if i manulally paste the url ( http://localhost:4125/Loginado/welcome.aspx) it should go to  login.aspx for user credentialsbut its going directly to welcome.aspx  page.

Redirect to Login Page from Generic Handler

Hi,I have created a asp.net generic handler to use it in auto-complete text box. Here is my code to it /// <summary>     /// Summary description for $codebehindclassname$     /// </summary>     [WebService(Namespace = "http://tempuri.org/")]     [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]     public class ProductSearch : IHttpHandler, IReadOnlySessionState     {         public void ProcessRequest(HttpContext context)         {             String query = context.Request.QueryString["q"];             if (! string.IsNullOrEmpty(query))             {                 int sid =  Convert.ToInt32(HttpContext.Current.Session["ScenarioID"]);                 int evId =  Convert.ToInt32(HttpContext.Current.Session["EventID"]);                 var products = from p in Data.BO.Product.GetScenarioProducts(sid, evId, query) select new { id = p.ID, name = p.Name };                &nbs

Session time out alert box and redirect login page


Dear all,

Now I am using Form authentication for my website. 

It is something like that below. But if I left the website without using it for quite some time and when I used it back, it is redirected to the login page. 

The one I want to know is that it is because of session expire or cookies expire. And if it is session expired, I want to show the alert box and redirect to the login page. And one more thing is that if the user keeps on using the website, I want to extend the session expire time. If you do not mind, I want to have some references for this scenario. Thank you so much.


If myUser.IsValidUser(txtUserName.Text.Trim, txtPassword.Text.Trim) = True Then

Can I only create session on login and redirect to login from other apps if not using custom provide


I have created custom a MembershipProvider, SessionIDManager, and SessionStateStore since I need to use custom legacy sessions and logins.. When the Application is ran, it runs the GetSessionID in the SessionIDManager(which is correct)..

The problem then is if there is no session meaning the GetSessionID method returns null, it tries to create a new session using CreateSessionID.. I want it to redirect to the login application(another application)..

We only create and store session information for logged in users and the "session id numbers" come from a file that is pre-populated with "session id numbers"(I didnt design this and its out of my control).. So its not feasable to give everyone who visits the site one of the "session id" numbers..

I also need for users with an "invalid" session(when checked through Validate()) to be redirected to the login page..


Any help here would be great..

After Login , Redirect To Previous Page Instead Of Destination URL set


Hi .

I have developed an asp.net project with asp.net membership for login.

I have login control in a page and for that I have set the property destination URL to a particular page say defaultlogin.aspx.

It is also working fine, when I use to login from home page.

But if i navigate to different pages of my website say first to home page, contact us page, about us page etc. Then after that when I click on login page and key up the login information in the login control.

I use to redirect to the last page which I have visited the last. It is not redirecting to the destination page which I have set in the login control.

What's the problem here?

Plz help me with the above issue.

Thanx in advance.

Grid view: menu item of hyperlink to view attachment excel and pdf

Good day,

i am facing a problem to create a hyperlink to view the attachment pdf and excel in table from a menu item i created.

below is my coding, themnuItem.NavigateUrl is wrong, i hope anyone can help me. i attach the printscreen of my table and the menu item, however i fail to make the hyperlink from the view image to my attachment.

i had a css file to create the menu item



            Dim models_select As String = Cmn.ReplaceDBNull(Me.gridView1.DataKeys(e.Row.RowIndex).Values("MODEL_SELECT"), "")
            Dim mnuAction As Menu = CType(e.Row.FindControl("mnuAction"), Menu)
            Dim mnuRoot As MenuItem
            Dim mnuItem As MenuItem
            'Dim CCLID As String = Cmn.ReplaceDBNull(Me.gridView1.DataKeys(e.Row.RowIndex).Values("CCLID"), "")

            ' Insert root item
            mnuRoot = New MenuItem()
            mnuRoot.Text = models_select & " "
            mnuRoot.NavigateUrl = ""
            mnuRoot.Selectable = False

Redirect the output to excel


Currently  I have a ASP page that brings data from the database and display in a grid, something like this

     DataSet dsReport = sqlServer.GetReports ((txtbox1.Text), dropdownlist1.SelectedValue,dteDue);
            DataGrid1.DataSource = dsReport.Tables[0];


what i want is instead of data in a data grid display have it in a excel file  so I used

RenderExcel(dsReport.Tables[0], strFileName);

But instead of getting the data from the database in the excle file. I get the input asp page displayed in the excel. Pleae can anybody suggest what to do?


Thanks in advance







Ajax timeout redirect to login again



I have some problems whereby sometimes my application redirects to the login page if the users sessions timesout.

What I'm finding though is that pages that are ajaxified with update panels etc don't appear to redirect to the login correctly.

Meaning that my users come back and click a button and a horrible 'object not set to an instance of an object' error appears.

I was wondering if anyone has a fix for this - or if they recommend some javascript on the page to return the user to login (and therefore load session stuff).


Redirect To Excel


 I have something like this in my code


private void LoadData()
            string value = cboCarrierCode.SelectedValue;
            DateTime dteDue = new DateTime(int.Parse(Request.Form["txtYYYY"]),
            string strFileName = "nsl_";
            strFileName += (cboDealers.SelectedValue).ToString();
            strFileName += ".xls";
            DataSet dsReport = sqlServer.GetReportsForNewReportsPage

Login redirect to different pages



I'm new to this forum (was always a reader, not a poster). And I'll hope to learn alot here.

I have to admit, I'm a total newbie to the ASP programming language.

Now onto my problem: I want to make a login, which redirects to different pages bound to the username after the login

I already tried solutions offered on : http://forums.asp.net/t/1079990.aspx?PageIndex=1

So basically what I want is for example this:

I have 2 users: Timon & Bob

Timon logs in, Timon gets redirected to the page Timon.aspx

Bob logs in, Bob gets redirected to the page Bob.aspx

My loginform ID is called Login1, and its on the Default.aspx page, since I want users to login before viewing any content.

At the moment, I just login and it works (if I type wrong info it gives error etc), but when I login I just get redirected to Default.aspx again.

The code in my Default.aspx.cs at the moment is:

protected void Login1_LoggedIn(object sender, EventArgs e)
    if (Roles.IsUserInRole("Bob"))
    else if (Roles.IsUserInRole("Timon"))

FileUpload redirect to login page


FileUpload works OK on my local site. When I moved my web application to a web host server, I tested to upload a file with this application, It's OK to upload file to the server before login. But after login, the FileUpload kept redirecting to login page without uploading. Any help? Thanks!

how to redirect from login page?



I have three master pages in my projects. I would like to allocate each master page to each role(Admin, ValidUsers, nativeUsers). how can i do it plz any one explain me.

Redirect user to login page and back


How would I go about to solve this:

When the user clicks a button and the user has been inactive for too long (session is gone), then redirect the user to the login page and back to the current page after logging in?

Is there a built in solution to this or do I have to do it manually? If so, how?



how to redirect to particular page after login?



any body knows how to redirect to particular page in the url after login in C# ?


1) the home page is www.google.com/login.aspx it is login protected

2) in this application i have another page(post.aspx)  www.google.com/post.aspx?a=25&b=35;

the user try to enter the 2nd line of the link,  if the session is not valid it will automatically redirect to the first link, after enter the login id and pwd it should go directly to to the 2nd line of the link how?

expect the answer from masters.........



ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend