Web Forms :: Custom ResourceProvider With A Fallback For Standard .NET Localization Mechanism?
May 7, 2010
I wrote my own custom ResourceProvider in order to move localization management to DB instead using standard resx files.The provider works fine, but now (after having bought a third part components for UI) I need to implement a fallback to standard ASP.NET localization mechanism from my own provider since these controls has been already localized from the author and are packaged with resx files.So what I would like to do, is keep the actual mechanism for all the resources except for the resoucers related to this controls.I'm able to distinct when a resource is belong to external components, so what I need is how to invoke for this resource the standard location management.
I'm wondering if it is possibile to customize routing in a way that all requests are evaluated by a piece of code, redirected to the relevant controller if a match is found or passed to next rout in list if not found.
sample request: /my coolpage/another one
the code searches and determine that the right controller for this is Page, action is "list" and id is "123" and so redirects
another request: /products/list/5
code finds no match al passes it back to next route that knows how to handle it...
While going through MSDN I found that in button properties useSubmitBeheviour there is written that if useSubmitBeheviour is true then it cause the Button control to use the browser's submit mechanism and false then the ASP.NET page framework adds client-side script to the page to post the form to the server.
Button.UseSubmitBehavior property is used to gets or sets a value indicating whether the Button control uses the client browser's submit mechanism or the ASP.NET postback mechanism.
So, What is the difference between client browser's submit mechanism and the ASP.NET postback mechanism?
For each appSetting I use, I want to specify a value that will be returned if the specified key isn't found in the appSettings. I was about to create a class to manage this, but I'm thinking this functionality is probably already in the .NET Framework somewhere?
Is there a NameValueCollection/Hash/etc-type class in .NET that will let me specify a key and a fallback/default value -- and return either the key's value, or the specified value?
If there is, I could put the appSettings into an object of that type before calling into it (from various places).
my user will use form authentication against Active Directory or database. Theres no Windows Integrated Authentication there!!
What i want is when the user submit the authentication form, it will try to validate the user against Active Directory and if it fail, try with the database.
How can i do that? What i had in mind was to build a custom membership provider that will encapsulate the logic but im not sure how to start.
I have an aspx page with detailsview whose datasource is an objectdatasource. I have a dropdownbox, showing categories, which act as a filter. If the user selects a different value in the dropdown box, the data obtained through the objectdatasource will be changed, and the new set of data will be displayed on the detailsview. This dropdownbox, is being used as the ControlParameter in the objectdatasource, so whenever a new item is selected the detialsview is updated accordingly. Now I want to add another filter in the form of a textbox, when the user could type in the title and hit a button, which should get a filtered set of data from the database.
I am binding DataView data to GridView and using paging and sorting mechanism of the GridView.
In case of sorting, I define the sort expression based on user's selection and assign the same to DataView and then bind the same to GridView.
Issue:
Everytime I sort the DataView, I see different set of rows on the same page on GridView. The issue is, the column which is used in sorting has many rows with same values. So everytime I sort DataView using sort expression and bind it to GridView, it displays different sets of rows and sorts randomly.
What should I do to make sure that it always display same rows? I cant change the sorting expression as it is selected by the user. Or only way is to append sort expression containing unique key internally ?
I need the consistent set of rows as I am operating on rows selected by users and make them editable and allow user to udate values and display the same.
The database has been designed for a tradesman web site, i.e. Plumbers, Builders etc. The two main tables are tblCustomer and tblTrader which will stored data from two frontend web pages where the customer and trader can enter their personal details. After a customer enters their personal details (i.e. registers through the site) they will then be directed to a child page where they can progress to entering a specific job attached to a specific trade (i.e. Plumber) and trade type (i.e. Bathroom Installation), once a customer job has been entered I want these details to be emailed to all the trader_email addresses from tblTrader, from this email alert the traders will then enter the system and offer quotes to the customer through tblTraderQuote where the customer will then accept the best quote for them.
What I also want to implement is some sort of rating option that will allow the customer to rate their trader, either something like ebay's feedback or just a simple 1-5 rating option? How can I implement this into my database design or is this something that should be performed within the programming layer?
I am working towards porting a windows application to web. The windows application is quite rich w.r.t. the form controls, complex validations and user interactivity.Basic web forms are inadequate to meet these complexities. So I would like to know the best way to still have the richness on the web pages. I have some ideas and would like comments.
Use DHTML & Java Script to mimic complex controls. There are some macro controls available as part of jQueryUI that can be used and some other third party Java Script controls. I'd like suggestions if there is a recommended control library.Use RIA (preferably Silverlight) wherever rich controls are needed. I'd like to keep this as a last option because it mandates the Silverlight plug-in.What are other popular / preferred strategies?
To use separation of concern and to optimize the clearness of the controllers we decided to split each action of a controller into different controllers (FunctionalLocationEditController, FunctionalLocationCreateController and such).
Problem now is the Global.asax is currently a bit big for just a few pages registered in routes.
We would need to use an area type of mechanism but for business reason we are not ready to upgrade just yet to MVC2.
Basically, is there a way in MVC1 to map the Urls to something like <folder>/<controller>/<action> ?
My question so general, but I think the answer will be specific.
All I want to know is:
Is there a way or steps or mechanism to test the application (web application) in a professional way?
Many times when I finish developing and try my application, testing it with dummy data several times, and when I think every thing is okay and I think I have covered all possible scenarios, I find I forgot important issues, or others tell me they found problems in my application.
I wonder mapping mechanism from controllers to views. I can not understand how mapping can be possible If we just return value of View() method. Controller class's View() method call overloaded View method with null parameters. But how can be possible to mapping to views with none specified returning value of View() method ?
i am using dot net open id for implementing openid in my website i want to redirect user to any of the open id provider site for sign up just like that of stack overflow provides for myopenid how to achieve this
I'm developing a internal web app for a foreign friend.
Since many of the users don't speak english very well, I wanted to add local translation to the web.
It's been a while since I've used .net, and perhaps I'm getting a little bit rusty, but my Localized resources are not working for some reason.
I have a Default.aspx.resx in my App_GlobalResources folder and inside it a small resx file. It simply has one test string: "Button" with the value of "Botón", nothing complex there.
Then I have the test controls: <asp:Localize runat="server" ID="test" Text="Button" meta:resourcekey="Button" /> and <asp:Label ID="header1" runat="server" Text="Button" meta:resourcekey="Button" />
But this isn't updated. Things that I've tried:
1. Put UICulture in the Page Tag
2. Renamed the resource file to Default.aspx.es.resx
3. Put my browser in 'es-ES' locale
4. Tried to load the resources explicitly inside <%%>
I have mulitlanguage platform in place - need to have the HEADER LOGO.PNG on my site to change with my language-button function.My startingpoint is this from my Masterpage :
In short, I want to implement a search engine. I pass the search string as a http querystring and my database uses it as a filter in Select. The problem occurs when I enter some non-standard english letters. Let me elaborate: on Main.aspx page, when I click on "Search", a function calls "Main.apsx?search=something". The querystring is passed as a filter to the database which returns values depending on the filter. The database holds correct data at the moment.
After that, I dynamically modify some hyperlinks' url to something like this: hlink[i].NavigateUrl = "Detail.aspx?search=" + base.Request.QueryString["search"] + some integers;. I want users to be able to click on the link to get details on the result. If they click the link, since a new page is now opened, the database has to be refilled (from cache). The same function for filtering the main database is called with a querystring which should be the same as the search string, but somehow it isn't. It looks like something was lost in a conversion or something. If I use standard english letters, everything works fine. I noticed that prior clicking the link the query string had a value like /u0100d for the non-standard letter, but after clicking the link the value had changed to something like /u0ffff. It obviously isn't the same when typing something in the search box and hitting "search", and when putting this search string into NavigateUrl and clicking on it.
If I open a connection and don't close it after query execution completes, store it somewhere, and use it next time a request comes in, isn't it something similar to what .net does? Is it possible to maintain a pool of connections according to our requirements without depending on ADO.NET's internal mechanism? In case of ODBC, I read somewhere that connection pooling will have to be enabled from ODBC datasources and that it cannot be set from within .net. What if I open a few ODB connections, leave them open and use those whenever a request comes in and close all of them when I know that I dont need them anymore. How is it different from connection pooling?