I have added a new route to Global.asax in order for me to create some nice seo friendly URLs for some news items I am displaying
routes.MapRoute( "News", // Route name "{controller}/{action}/{id}/{title}", // URL with parameters new { controller = "News", action = "Story", id = "", title = "" } // Parameter defaults ); routes.MapRoute{"Default", // Route name "{controller}/{action}/{id}", // URL with parameters new { controller = "Home", action = "Index", id = "" } // Parameter defaults );
The problem I have is that when I now hit my home page I am getting [URL] displayed in my URL rather [URL] which is what I used to get. I think the news route is picking up everything. Has anyone any ideas on what constraint I could put on the news route above so that it only ever processes requests from the news route. I was thinking of doing a reg ex on the title and excluding anything with the '-' character in it but I coud not get that to work
Was looking at asp.net mvc complex routing for tree path as an example of how to define a custom route handler for my MVC app. Essentially, I want to give the end user ultimate flexibility in defining the URL for any given page, so I provide them with a field in the interface to specify their own custom URL.
My custom route handler is basically a wild-card handler. It will do a lookup and if it finds a match, map it accordingly. However, if no match is found, I want it to fall back and find the next rule that matches in the global.asax. Is that possible? Or do I essentially need to code the mappings that used to exist in my global.asax into my custom route handler?
I am attempting to implement a custom locale service in an MVC 2 webpage. I have an interface IResourceDictionary that provides a couple of methods for accessing resources by culture. This is because I want to avoid the static classes of .Net resources.The problem is accessing the chosen IResourceDictionary from the views. I have contemplated using the ViewDataDictionary given, creating a base controller from which all my controllers inherits that adds my IResourceDictionary to the ViewData before each action executes.
(ViewData["Resources"] as IResourceDictionary).GetEntry(params);
I guarantee the title of my thread does not explain what I am looking for, but I just can't think of a better way to word it. What I have right now is an application that the user can add, search, and update various orders in the System. I've been working on the front end page, and wanted to display a summary of all orders performed this month. Right now the Orders are represented as labels (based on data pulled from the database). What i'd like to do is replace these labels with hyperlinks. I was hoping that by doing that I could somehow write some code so that when an order is clicked that the user is taken directly to the search page and that order is displayed.
I thought Theme1 should be additional to BaseTheme with Theme1 has higher priority in case of conflict. But Theme1 seems to have replaced BaseTheme completely and nothing in BaseTheme shows on the Default.aspx page. If this is the right behaviol, how to add additional theme to a page?
I'm using the ASP.NET Membership system to add new users to my site. It's working fine. But I'd like to force the user to enter additional required information (on a different aspx page) before they can successfully complete the registration process. What is the easiest way to direct and force the user to complete a different page of fields (stored in SQL in columns located on the same table as the basic membership fields) as a condition of completing the registration process?
In searching different sites, I see additional properties and templates like Wizard Steps, Continue button, Finish button---but I'm not clear as to which of these (perhaps none of them?) will allow me to accomplish this goal.
Using VB.Net 3.5 framework, i have a site that is using a custom login form and custom error with custom error page in global.asax and web.config is set up for both the login form and custom error. All works fine: my users login and when they get an error, they get the custom error page. The pages also use querystrings when moving about the site in order to retrieve data from a data base using a customer name (this is not the login name) and order number. When an error occurs anywhere in the site, I'd like to pass the page name and its querystring parameters
(ex: page1.aspx?a=1&b=2) to the custom error as well as the user information so that all the user sees is the custom error page telling them the error and all details were sent to the admin. Currently, the custom error page has an email link so the user can send a message that includes the details which results in 2 emails being generated for an error: one from global.asax with the error info/stack trace and the one the user sends with the details.
In my mind, a graceful failure does not require input from the user, just an apology and assurance the problem has been fully reported and will be taken care of. So, can someone assist in getting the current user and page/querystring into the custom error code in global.asax?
The default asp membership provider only allows for one security question and answer. Does anyone know a work around to allow for more than one question and answer?
I have a web application that uses SAPI to do TTS. I run it on Windows Server 2003 that has MS Sam installed by default.I understand that there are a number of 3rd party companies that sell voices. For a commercial application, which of these companies offer licenses that don't charge a lot of money? Do they have API to easily integrate with a ASP.NET app?I really would like to add more voices to the application.
I am using VWD express 2005. I have a drop down list that filters a datagrid. I use select distinct to populate the DDL and the datagrid is filtered using
SELECT * FROM tbl3 WHERE (REP LIKE @rep + '%')
However I want to add an entry to the DDL that includes more than 1 value. If I add a new listitem to DDL with text = sales and value = c21 then query is ok but what I'm trying to do is is where value = c21,c22 A sort of group option? Am I going about this the wrong way? I tried value = c21,c22 then c21 or c22 then (c21,c22)
I am developing a website using ASP.NET MVC2. I have a page where i want to display search result. When user mouse over to any of the search result, a side pop should come up with additional details. I want similar to Bing Search results. If we do a search in Bing and mouse over to any search result, a small rectangle dialog comes up on the right side and when user mouse over to that small rectangle it shows the "Additional" information.
I have a contact form that has the standard email fields such as name, email, street address, city, state, and body. This is being done with System.Net.Mail. I understand how to use the body, to/from address, and subject. I don't understand how to include the street address, city, and state with the email though.
I want this additional information to be sent with the email some how so the recipient can have access to it. I assume this should be included with the body when the email is sent. I don't understand the best way to so this though.
I thought about appending the values of these fields to the body of the email. I don't know how to format this so it looks good though. The formatting I want to do is very basic. I would like each of these values to be on a separate line before or after the body of the email. I'm not interested in colors or anything too fancy. I prefer to send a plain text email, if possible, if these values can be included on their own line.
Can anyone provide an example or a link to an article on this? Do I have to use an html formatted email and create new lines with in the body for these fields?
Now I see that this renders both the checkbox input tag and a hidden input tag. The problem that I am having is when I try retrieve the value from the checkbox using the FormCollection:
FormValues["ReceiveRSVPNotifications"]
I get the value "true,false". When looking at the rendered out HTML I can see the following:
Hi. I have two chained CascadingDropDowns. Both are working fine. The thing is that in the underlying web methods which are supplying values for DropDwonList I need read one additional parameter. This parameter is needed for setting up the default item for dropdownlist.
I do not know how to pass that parameter or read it. I've read on the Internet about the ContextKey property. But I do not know how to acces it from the WebMethod.
I've tried to get to the session through HttpContext.Current.Session (hoping that I could extract some parameter from the session) but it seams that the Session is different for the WebPage and WebMethod.