C# - Redirect To Url Based On User Data?

Sep 8, 2010

When someone logs on to my site. I want to direct them to their own home page. If the user has the id of 1. They would go to[URL] I already have the login and id setup. I am not sure how to incorporate it into the url.

View 2 Replies


Similar Messages:

How To Redirect Page Based On User

Jul 22, 2010

i created a web application which has a media player in between,but when i open the application on my ipad or ipod, the video doesnt play as the video player doesnt support ipod and ipad,,

i found out a way with which i can play it but how can i redirect the page based on the client side.

i would like to know a C# code to know what kind of browser the user is using.

View 2 Replies

Security :: Want To Redirect The User After The Log In Based On His Role?

Mar 17, 2011

i want to redirect the user after the log in based on his role. e.g. admin, userI already read the other threads.. I already used this:

[Code]....

And this:

[Code]....

I also tried the above codes on the Page_Load event.

View 7 Replies

Security :: Want To Redirect User Based On The Login ID?

Jan 26, 2010

i am using asp.net membership. when users arrive at my sight they can enter user name and password.

I then want to redirect them to a page called "MyAccountPage.aspx" which is unique to them. could someone post the c sharp code that I can use to capture the Unique Id of the user is it best to then pass this as a parameter to a control on the aspx page that displays data for that user. am I correct in thinking that I need a UserId column in my data table as well.

View 1 Replies

Web Forms :: Redirect A User Based On Column In Database?

Feb 15, 2011

I have an employee list in MSSQL. I have an online punch clock. In the DB there is a column called punch_clock. I would like to redirect a user to a different page if there is a 0 in this column. I have the code below so far. Not sure where to go from here.

[Code]....

View 5 Replies

Security :: How To Redirect Logged In User Based On Role

Nov 25, 2010

I want to know how can i redirect a user to a different page when he tries to access a page restricted to another role?

The scenario is as follows:

I have a folder "Gestao" that only allows users in role "Administrator"

[Code]....

If an anonymous user tries to access that folder he is redirected to the login page, but if a logged in user whose role is "friend" tries to access this folder he is also redirected to the login page. I want to redirect him to a page showing a message that he has no permission to access that page/area.

How can I do that? Should i have code on the Page_load event of the login page checking the user role and then redirect him to the correct page? Or is there some otherway to do this?

View 2 Replies

Security :: How To Redirect To Specific Page Based On User Roles

Sep 12, 2010

I am using Formsauthentication. My situation is as per below:

the login form has codebehind :

protected void LoginButton_Click(object sender, EventArgs e)
{
TextBox uname = Login1.FindControl("UserName") as TextBox;
TextBox pass = Login1.FindControl("Password") as TextBox;
CheckBox rm = Login1.FindControl("RememberMe") as CheckBox;
Literal fail = Login1.FindControl("Literal1") as Literal;
if (Membership.ValidateUser(uname.Text, pass.Text))

[Code].....

Now the problem is that when I try to login with proper credentials it first redirects to default.aspx( there is no such page in my project), after login again with same credentials it properly redirects to the correct page. Why such problem arises? to fix this?

View 6 Replies

Security :: Redirect User Based On Role To Specific Web Page?

Apr 22, 2010

I'm not sure if this is possible or not, I'm using Roles to limit what pages a user can access based on there assigned Role. My question, is there anyway to redirect the user to a specific web page based on thier role after they login.

For example:

If Bob logs in with Role="Automotive", I want him to be redirected to Auto.aspx.If sue logs in with Role="Clothing", i want her to be redirected to cloths.aspx.

View 8 Replies

Redirect Based On IP Address?

Feb 2, 2010

I need to redirect some users based on their ip address to specific page else they would be redirected to another page my code is as below.

string myIP = HttpContext.Current.Request.UserHostAddress.ToString();

switch(myIP)

{ [code]....

View 2 Replies

How To Redirect Based On Selection Of DropDownList

Jul 26, 2010

I have a TextBox1 and a Search button in my application with this following code:
protected void Button1_Click(object sender, EventArgs e) {
Response.Redirect("~\searchpage.aspx?PatientNRIC=" + TextBox1.Text); }

Which means, if the user type ONLY IC NO:S1234567D, then when click it will show the patient detailview. So I now I'm doing almost the same thing but now I have a TextBox2 and a DropDownList1. Inside DropDownList1, I have "Name", "IC No", "Test_Date". So for an example, I type "S1234567D" in the textbox1, and I choose "IC No" in DropDownList1 it should redirect me to a page of the S1234567D's patient detailview. How could I do my code?

View 2 Replies

Security :: Redirect To Different Folders Based On Roles?

Jul 4, 2010

I have implemented membership and enable role based on. I have 2 roles "admin" and "super_admin" and once the user login, I want to redirect them to different folder based on their role. My guess is, the redirection need to be determined once the user clicked login on the login control and here is my code.

[Code]....

However, whenever the user login (regardless of admin or super_admin) the page keeps redirection to Anyone/Default.aspx.

View 5 Replies

Mobiles :: Platform Based Page Redirect?

May 26, 2010

This will be typical question to ask, but i havent found any right soultion to this. I need to redirect pages based on devices browsing, mostly focusing on iPad, iPhone, Blackberry. But i need server side code, for this; as javascript is disabled by default on Blackberries, so tring to avoid javascript. I have checked MVP Mobile Devices, but dont know how to implement in my sites.

View 17 Replies

C# - Performing A Response.Redirect From A Non-Web Based Project?

Jul 13, 2010

I have created a utility method that contains some try/catches in it. In those try/catches I need to redirect the customer using an HttpResponse redirect. I can't seem to figure out how to do this outside a web project. This utility class is referenced from my ASP.NET web project and so I'm just abstracting out some of the code into this utility class so I no longer have the request object.

I know I can use HttpWebRequest object for a lot of web related request tasks outside a web project, but could not seem to get any redirect method there to use after putting in a using System.Net; in my utility class.

View 4 Replies

Security :: Redirect To Specific Web Page Based On Roles?

Oct 26, 2010

Is there a tutorial on how to redirect user to a specific web page based on his/her role? For example, I have teacher role and student role. When the teachers login, it will redirect the teacher to the teacher web page and the students redirected to the student web page.

View 1 Replies

Web Forms :: Redirect Website Based On Selected Text?

Oct 18, 2010

how can i redirect to a different website if label1.text is "www.micro" and gridview selected row column(0) text is "soft.com"?

[Code]....

Neither did this

[Code]....

View 2 Replies

Populating A Website With Data Based On A User Selection?

Jun 29, 2010

Just wondering the best way to do something. I want to fill up fields on a website based on a selection from a list. For example, the user selects "Melbourne" from a list of Australian capital cities and the page will fill up with information from the database relating to Melbourne.

View 1 Replies

Security :: How To Show Data Based On User Name And Password

Apr 7, 2010

I would like to know how to show data based on user name and password?

Example:

User name: user1
Password: pass1

How to show information regarding the name user1 and pass1 (Students, teachers, etc...)?

[Code]....

View 6 Replies

SQL Server :: How To Insert Data Based On Gridview User Value On Row

Aug 24, 2010

I have three column comes from database table(Table1) and one column is for entering data for the user let us consider it look like this

ItemNo ItemName Qty uservalue

001 A 50 20
002 A 20 5
003 B 50
004 C 60 10
005 D 40
006 E 90 15

........

If its 300 row from database to gridview it will show 50 record with page navigation..What i need is i need to insert data in to database table which gridview row has user value..The output of the another table(Table2) will look like this after insert

ItemNo ItemName uservalue

001 A 20
002 A 5
004 C 10
006 E 15

View 8 Replies

AJAX :: Redirect To Another Page Based On Response From WebMethod Using JQuery

May 7, 2015

I have a webmethod named (abc), inside this webmethod code i want to redirect to another webform and i am using this code.

HttpContext.Current.Response.Redirect("../paypal_redirect.aspx",false);

But this code is not working. How to redirect to another page from webmethod.

View 1 Replies

Web Forms :: On Logout Redirect User To Login Page If User Clicks Back Button Of The Browser

Jul 9, 2010

after user loggs out if he clicks the browsers back button then users had to be redirected to login page

doenst matter how many time the user clicks on back button take him to login page

how to achieve this let me know

View 6 Replies

User Controls :: Confirm User To Save Changes Before Redirect To Another Page

May 7, 2015

How to confirm a user to save changes whenever user do changes in one page before he/she transfer to another page?

View 1 Replies

Web Forms :: Redirect To Page Based On The Number Or Index Entered In TextBox?

Jul 5, 2012

If I enter any number in a TextBox I want to open some .aspx page. I don't want to click on any button. How should I do this in asp.net?

View 1 Replies

Show User Specific Data From Database Based On LoginID Username?

Jan 21, 2011

I am attempting to convert an online game i have written in ASP into ASP.NET,, but I am failing at a very early and probably a very amateurish stage.

I am using a Sample ASPX project. There is an ASPNETDB database included, when i register my username is added to the DB along with a userID and various other fields. This is stored in a table called aspnet_Users.

The Login Control is stored in a Site.Master file

<div class="loginDisplay">
<asp:LoginView ID="HeadLoginView" runat="server" EnableViewState="false"
onviewchanged="HeadLoginView_ViewChanged">
<AnonymousTemplate>
[ <a href="~/Account/Login.aspx" ID="HeadLoginStatus" runat="server">Log In</a> ]
</AnonymousTemplate>
<LoggedInTemplate>
Welcome <span class="bold"><asp:LoginName ID="HeadLoginName" runat="server" /></span>!
[ <asp:LoginStatus ID="HeadLoginStatus" runat="server" LogoutAction="Redirect" LogoutText="Log Out" LogoutPageUrl="~/"/> ]
</LoggedInTemplate>
</asp:LoginView>

I have created a new table called tblClubs, which stores information such as ClubName, StadiumCapacity etc
I added a field called 'Owner' and this is directly related to the UserName field in the aspnet_Users table

What I am trying to solve is to show user specific information from the database, based on their LoginID.

i.e

My username is Laclerque and my club is called Racing Mongoose, the stadium capacity is 9500.. the information for each User needs to be different and just show the information that is relevant to them.

obviously in the longer term, there is going to be 100's of these associations required for the full game, but not until i can get my head around the basics of how to set this information. I tend to work better when i can see a working sample, and then adapt things to suit my needs.

View 1 Replies

Web Forms :: Data Generation In Grid Based Upon User Drop Down Selections?

Mar 10, 2011

I am an newbie to this technology. I had requirement kind of thing, like, I had 5 cascading drop downs, which I created by using ajax control tool kit drop-down extenders, and used web-service to update the cascading drop downs content.

In the same form I need to create a grid, so based upon selection of the user, the grid should change dynamically, like I would like to have some examples kind of things, lets say, I had Four cascading drop- downs, like 1) Vehicles, 2) Hotels 3)Games 4) Year

And those can be sub-categorized to

1) Vehicles ----- Three Wheelers, Two Wheelers, Four Wheelers
2) Hotels -------- Five Star Hotels, Luxurious Hotels, Restaurants, Bars, Pubs
3) Games ------- Play Stations, Video Games
4) Year ----------- Manufactured or established in that particular year

so, If the user selects vehicles, then we need to show all the information regarding vehicles, and if he selects hotels , we need to get the information of vehicles, and hotels( * note, I may not be able to give u the right example, once again i want remind you that these drop downs were cascading drop downs, based upon one selection, other works) and like wise if he selects year, we need to show information of all the things manufactured or established in that particular year and here year is not a cascading drop down, and all these information is maintained in a single database table

And currently I am using Microsoft Sql Server 2008 R2, Visual Studio 2008, Using c#, ( i would be happy, if anyone gives me a code kind of thing, not mandatory, only if possible)...

View 2 Replies

Data Controls :: Render Partial View Based On User Input In MVC

Jan 24, 2016

I want to know that how to render partial view based on where the user navigates. I mean to say if user navigates to Home/index it will load different partial view and if user navigates to Home/contact it will load different partial view on the _layout page. 

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved