Web Forms :: Session - URL Routing To Route User To His Profile Page

Jan 12, 2011

I am using URL Routing to route user to his profile page, which is a child page. Now the problem is that all the images, javascripts references are distorted when i user the url to reach that page whether logged in or not logged in (both the cases). But after reaching this page when i login from this page thru my modal popup login control, all the references seem to work fine. It is to be noted that i am still in that same page which i reached after url routing. So upon logging from here the whole page works and displays fine.

How come the references are automatically adjusted when i am logging in from this page and are not referenced when i log in from other page and route here or when i am logged out?

Global.asax code:

void Application_Start(object sender, EventArgs e)
{
RegisterRoutes(RouteTable.Routes);
}
public static void RegisterRoutes(RouteCollection routes)
{
routes.Add("UseridRoute", new Route
(
"profile/{user}",
new CustomRouteHandler("~/UserProfile.aspx")
));
}

View 2 Replies


Similar Messages:

Web Forms :: URL Routing - Route To Aspx Page To Handle Processing?

Aug 20, 2010

I am able to route my urls to an existing page. Here is how our scenario is currently working:

On Default.aspx, we have several links that link to pdf files on the server. The filenames of these files change dynamically which is why we need the url routing. When the user clicks on of the urls, the link is routed to the getFile.aspx page that has logic in it to determine which file to open.

Is there a way to have the getFile.aspx page to open in the same window as the default.aspx page?

Otherwise, I need for the getFile.aspx page to close after the intended processing is complete, and I've not been able to close it without getting the close window dialog box. I figure if it opens in the same browser window, I can redirect back to the default.aspx page when processing is finished.

View 1 Replies

Web Forms :: Session - URL Routing For Display User Profiles

Jan 15, 2011

I am using URL Routing for display user profiles. I am using master page and child pages. The profile page is a child page and the master page has a login status control. When I login (say user x) through the modal popup which is in the master page itself, i can browse the site with smoothly and reach the routed page. When I log out from the routed page using the login status i get redirected to my home page as required as my login status also is logged out. If i login from this homepage now with another username say y, i get logged in successfully.

The problem is that when I again use the routed to get to the routed page, I get the previous user x still logged in. When i come to homepage I see user y logged in. So I have two sessions working; one in the routed page, and other in the whole of the website.

View 16 Replies

Web Forms :: Wrong Route Gets Selected In URL Routing?

Feb 18, 2011

I am building an application in Asp.Net 4.0 (Web Forms). I have used the feature of Routing introduced in this version of Asp.Net (4.0).

I have a few routes declared in my global.asax file. My problem is as long as the number of parameters (placeholders) declared in the route are different the right route is selected. But the moment the number of parameters (placeholders) declared in the route are same there is a clash and the Routing engine selects the wrong route. The only way I found was to use a Constant with one of the clashing routes to distinguish between the two. But I am sure there is a way out of it; I also tried using Regular Expression but still it selects the wrong route.

[Code]....

The last two routes have the same number of parameters so I tried to separate the second last route by adding a regular expression, but in vain.

View 19 Replies

Web Forms :: When New User Register / Get Pre-designed Page From Where User Can Update Profile?

Apr 20, 2010

I am working on Social Networking Website. My problem is that

when new user will register he/she will get Pre-designed Profile page from where user can update profile.

View 5 Replies

Where To Use Route-name Of Routing In Mvc

May 19, 2010

i'm new to routing in aspnet mvc.. i have following code:

[code]....

when i enter "localhost/school" in addressbar, it is giving 404 error instead it should route to my "schoolIndex" action

i have given route-name as "School" where it is used ?

View 1 Replies

Web Forms :: Profile Service Error - Unable To Load User Profile In Iis?

Jan 3, 2011

I am using profile services to store some attributes of users registered in the website. Now I am making a display profile page for a user. The problem is that the profile loads easily when I am running the site from VS 2010, but it gives the following error when I run it from IIS7 on my local machine:

System.NullReferenceException: Object reference not set to an instance of an object.

Source Error:

[Code]....

[code]....

View 4 Replies

MVC :: MVC Routing Options A Single Route?

Jul 30, 2010

I am building a forum based application and was wondering if I had to create a different route for each of the following scenarios: View Forums, View Topics, View Posts, Reply to Topic etc... Is there a single route that I can customize to catch all of these for the folllowing urls?

http://www.samplesite.com/forums

http://www.samplesite.com/forums/{forumID}

http://www.samplesite.com/forums/{forumID}/{topicID}

[code]...

Is there a custom route I can make to catch all of these instead of making a different route for each one?

View 1 Replies

Mvc Routing - Ignore Route With Extension In The Middle Of URL

Sep 6, 2010

i How can make the asp.net routing engine ignore routes with an extension of the type /pathtofile/filename.aspx/morepaths

I know this is hardly a real scenario but I need to know for another similar issue for an autogenerated url

View 1 Replies

.net MVC Routing - Preventing A Route To An XML File With A Constraint?

Feb 8, 2011

I'm attempting to find a way to preventing a user from accessing a specific xml file. I've tried doing...

route "SiteMap",
"SiteMap/siteMap.xml",
new { },
new { isLocal = new LocalHostRouteConstraint() });
[code]...

View 1 Replies

Web Forms :: Configuring URL To Redirect To User Profile Page

Nov 19, 2010

I have a web site [URL] which had users profiles and accounts, and each user has his own user account name, I want once the user enter the url then his account user name after that to redirect him to his account page

ex. a user account name is xxx once he go to url [URL] it will automatically redirect him to [URL]

can we do such thing using HttpModule?

View 3 Replies

User Controls :: Upload Image And Display On User Profile Page?

Jan 8, 2014

I am making a Human resource Management system in which i have to make  employee profiles, there is a page in which i am entering employee name and uploading a rofile picture and i want the next page to show that image on a left corner of every employee...after clicking on the submit button of the previous page !

View 1 Replies

MVC :: Routing Error On Default Route In Virtual Directory?

Feb 17, 2010

I have an application that I run in several places (demo, production, local, etc.) that all use different virtual directories for the placement of the MVC application.

I use StructureMap in this application, so I am overriding the ControllerFactory to use StructureMap to build controllers (when the passed controller instance is not null).

My problem is that the controller instance being passed to the controller factory IS null, which is fine if said route didn't exist, but it does... specifically, it should be my DEFAULT ROOT route.

Basically if I host the app at [URL], everything works fine except when I have a '/' on the end of the URL (meaning,[URL]... the latter works fine, while the former gives me the error). It looks like when that slash is there, the routing engine is deciding that it should be looking for a controller named MvcController, which doesn't exist, and which then passes the null controller instance to the ControllerFactory, resulting in the following error:

The controller for path '/Mvc/' could not be found or it does not implement IController.
My Default route is the standard default route. Removing all other routes has no effect. My default controller is HomeController.

View 3 Replies

Security :: Creating A Profile For A New User Is Updating Other Profile

Feb 4, 2010

I am logged in as user1, and while creating a user in which I have additional information which would store first and last name into the profile database. I have the following code

[Code]....

But because I just have profile like that, it is updating the profile of user1 not the new user i just created

[Code]....

View 5 Replies

Page.Profile Not Saving After User Created In A CreateUserWizard?

Dec 9, 2010

I Have the following code which fires OnCreatedUser and doesn't throw any errors. Profile.Title is getting set to the correct value when inspected after the assignment.

public void CreateUserForm_CreatedUser(object sender, EventArgs e)
{
var ddlTitle = (DropDownList)CreateUserWizardStep1.ContentTemplateContainer.FindControl("Title");

[code]...

View 1 Replies

Web Forms :: Create A Profile In Which The User Can Create And Edit His Profile?

Jun 25, 2010

I got the followig task.Create a website (Profile.aspx) in which the User can create and edit his profile.Well, I know how to write in a database, but how do I get the UserName oder the UserID to make a PrimaryKey?If the user is logged in a session will be started. In this session is the UserName but I don't know how to read out the UserName with ASP.NET to make an PrimaryKey. If I would try to read out the UserName with C# I must save it in an variable and give it somehow to my form.

asp:sqldatasource id="SqlDataSource1" runat="server"
connectionstring="<%$
ConnectionStrings:MyConnectionString %>"[code]....

View 4 Replies

MVC Custom Routing Long Custom Route Not Clicking In Head?

Jun 5, 2010

I have spent several hours today reading up on doing Custom Routing in ASP.NET MVC. I can understand how to do any type of custom route if it expands from or is similar/smaller than the Default Route. However, I am trying figure out how to do a route similar to:

/Language/{LanguageID}/Question/{QuestionID}/

And what I would like, too, is similar to how SO works. Something like:

/Language/{LanguageID}/Arabic/Question/{QuestionID}/Some-Question-Title

Where "Arabic" and "Some-Question-Title" can be almost anything because what really matters is the ID's

A complete url example might be

[URL]

Am I going beyond what can be done with the extended URL past the language ID?

View 1 Replies

Web Forms :: How To Get User Profile Property Name For All User Programmatically

Aug 25, 2010

I have to find User Profile property name programatically, not for a particular user, I have to find all properties name for all users at a time(not to iterate one by one) to display in webparts as columns.

View 1 Replies

How To Change Session For Only One Route In Mvc

May 24, 2010

How to handle Application_BeginRequest using a custom filter in asp.net mvc?

I want to restore session only for one route (~/my-url).

It would be cool, if I could create a custom filter and handle that.

protected void Application_BeginRequest(object sender, EventArgs e)
{
var context = HttpContext.Current;
if (string.Equals("~/my-url",
context.Request.AppRelativeCurrentExecutionFilePath,
StringComparison.OrdinalIgnoreCase))
{
string sessionId = context.Request.Form["sessionId"];
if (sessionId != null)
{
HttpCookie cookie = context.Request.Cookies.Get("ASP.NET_SessionId");
if (cookie == null)
{
cookie = new HttpCookie("ASP.NET_SessionId");
}
cookie.Value = sessionId;
context.Request.Cookies.Set(cookie);
}
}

View 1 Replies

User Controls :: Display User Profile Image Of Logged In User?

May 7, 2015

I would like users to upload a profile picture when they register, and to then show that picture in a picture box control when they are logged in based  on that specific user.

View 1 Replies

Web Forms :: Displaying User's Profile To Another User

Jan 26, 2011

I'm using .NET 3.5 and C#.

I am not using the .NET Profile Provider.

View 1 Replies

User Controls :: Automatically Reset User Session Without Showing Any Message When Using Master Page

May 7, 2015

URL.... Still there will be need of url in ajax method if i put javascript in site.master.cs . As what i have understood from  that mysite.master.cs will be like this :

protected void Page_Load(object sender, EventArgs e) {
try {
if (Session["Prefix"].ToString().Trim() == "sys_admin") {
UserNameMasterLabel.Text = Session["UserName"].ToString().Trim() + " (ADMIN)";

[code]....

And site.master will be like this :

And I have to put next method in DailyLog.aspx page ? like this

System.Web.Services.WebMethod(EnableSession = true)]
public static int RefreshSession() {
HttpContext.Current.Session["Name"] = "BSD";
Configuration config = WebConfigurationManager.OpenWebConfiguration("~/Web.Config");
SessionStateSection section = (SessionStateSection)config.GetSection("system.web/sessionState");
int timeout = (int)section.Timeout.TotalMinutes * 1000 * 60;
return timeout;
}

But I have several pages in my website , by doing the above story will it work for Builder.aspx ? or any other page rather than dailylog.aspx ?

View 1 Replies

Web Forms :: Disable A Page Depending On A User Session?

Jun 30, 2010

I have a page that I need to disable, or re-direct to another page if a different type of user logs in.

The application has this page for one type of user but another type of user is not allowed access it.

How would you do this type of thing?

View 3 Replies

Web Forms :: Implement A Simple Login Page With User Session Management

Jul 23, 2012

I want to maintain user session in my project...the problem i am facing is when any user login is nt maintained.

View 1 Replies

Web Forms :: How To Get User Profile Info

Apr 8, 2010

i have an admin page that displays membership info, like email, usename, lastactivity....., i need to add the telephone number from profiling.

i use this to get current but i dont need current i need it for the user whos ID is i a query string

[code]....

View 1 Replies







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