Showing posts with label ASP.net Menu Control. Show all posts
Showing posts with label ASP.net Menu Control. Show all posts

Wednesday, December 1, 2010

Allow the user to enter new values in to the Dropdown controls like Combobox in web-HTML pages

Until this time, it was not easy enough to make a Dropdown accept new values too, from the user. It will always work based on the predefined list items only.

There is tiny add-on, built on JavaScript, that seems to solve this in a fairly easy way. With just few lines of JavaScript code, the plug-in was able to make the already existing Dropdown (input type set as Select) to look and work like a Combobox. There was no changes needed in the server code that processes the input from the user.

When compared to the jQuery AutoComplete control, this has minor disadvantages. I works only on dropdown controls, while jQuery control works based on multiple sources. But compared to AutoComplete control, this control makes the changes in the server control itself in such a way that there is absolute zero changes necessary in the server side and the changes will be up and running in few minutes.CSS attributes are also exposed so that the control UI can be changed as desired.

jQuery AutoComplete Control:
http://jqueryui.com/demos/autocomplete/

ComboDropdown Control:
http://combodropdown.info/samples.html

Thursday, February 18, 2010

ASP.net menu control does not render properly in Chrome and Safari

This was one major problem in the ASP.net website that I was working on. The control rendered properly in IE, Firefox and Opera EXCEPT Chrome and Safari. The initial guess was that there is something going wrong with my doctype settings and the CSS styles being applied.

A quick search over the net revealed that changing the Page.ClientTarget to "uplevel" will solve the issue; and it worked for few. But this didn't work for me.

Then there was a solution changing the web.config for adding browserCaps in the system.web section, which also failed for me.

Then, at last, there was solution adding .browser file to App_Browsers folder which worked for me.

Here are the steps.
1. Right click your project folder to add an ASP.net folder "App_Browsers".
2. Click "Add New" and create a browser file named Chrome.browser
3. Put the following code in that file after commenting the existing code.

<browsers>
<browser refID="safari1plus">
<controlAdapters>
<adapter controlType="System.Web.UI.WebControls.Menu" adapterType="" />
</controlAdapters>
</browser>
</browsers>

References:
http://www.google.com/support/forum/p/Chrome/thread?tid=7506cca26ec06af7&amp;hl=en
http://forums.asp.net/p/1369765/2860698.aspx#2860698
http://browsercompatibility.codeplex.com/