asp.net mvc combobox with filter - asp.net

I have a little problem in my form for entering some data for my users and that is a lot's of dropdowns, and i saw an a example of a dropdownlist where i can actualy type in it like in textbox and i get the options which contains my entered string.
To be more cleared, example is this: http://www.obout.com/mvc-combobox/autocomplete/aspnet_filtering.aspx
I have been using jquery autocomplete but that is not what i want in this case.
Any ideas or advices are welcome!
[EDIT]
Answer would be: http://tpeczek.com/2010/05/jquery-autocomplete-in-aspnet-mvc.html
With little modifications ofcourse!

Related

how to get suggestions in textbox while typing text

I have text-box and grid-view is present in same asp.net page. while typing some text in text-box I want suggestions, if text is present in data grid-view.
Example: Google Suggest.
What will be the procedure to achieve this.
There are several ways to get this done.
Since you're using asp.net (if you're using webforms) you can use the ajax control toolkit which has a combobox control
http://www.asp.net/AjaxLibrary/AjaxControlToolkitSampleSite/ComboBox/ComboBox.aspx
Or you can go with jquery ui
http://jqueryui.com/autocomplete/
There are many other plugins and frameworks you can try, but these two are pretty basic.

ASP.NET dynamic controls data exchange in postback

Please excuse me for a probably low quality of this question, since I'm not a web dev, so I possibly don't now some obvious things and don't know what to Google for. I think problem must have some simple solution, but I'm struggling with it for two days now, so I feel myself pretty stupid :-).
I have a custom control which is a set of checkboxes which are added dynamically based on a property which is set in OnLoad event of a page. I have two such controls on a page and second control items should be based on items selected in first control.
The problem is, I can't figure out, how to catch on autopostback which boxes were selected in first control before second contol is constructed to pass this data to it?
Take a look at this.
http://forums.asp.net/t/1440174.aspx
Since your building them dynamically, they are not as easy to find as webforms would like to be, if you added them to the page and wired up events and such.
Your going to look at the Request.Forms list, and search thru it for any controls you want.
I believe checkboxes are like radio buttons, they only return if they are checked, which is good, cause you want to know which ones were checked.
I've used same solution as in the accepted answer for this question: Dynamically Change User Control in ASP.Net , just need to assign an unique id for each dynamically created CheckBox in custom control. Not as clean solution as I want but at least it works.
You can save the data in the ViewState, QueryString or as Session before moving to the next page and you can do modifications based on it.

ASP.NET Dyanic Input Rows

Ive got ASP.NET web application form where users enter details such as:
Subject Code
Subject Name
Subject Details ....etc
I would like the users to click on plus(+) or add button which creates new empty rows for users to fill above fields. They can enter up to x number of subjects.
Is there any easier way to achieve this?
Please note this is just one part of the form. The other part of form includes student details, comments etc. So ListView or GridView is not an option for me right now.
Thanks.
Regards,
I think ListView was a good choice here.
The ListView Control (Video).
ListView Web Server Control Overview.
However, refer to ASP.NET Data controls to get help in this issue.

collecting data from checkboxlist

Pretty basic question, I have a checkboxlist inside of a wizard control. I need to collect the value of all items that are checked, as well as whatever value is inside of a textbox if "other" is checked, to insert into my database during the Wizard.FinishButtonClick event. How do I do this? I need this in VB, please.
We cannot give you complete code to implement the task you want to implement, but can provide some starting point. Please go through the articles given below. Get back to us if you still have problems in implementing what you want after reading these.
Wizard control in .net
Asp.net and Vb.net wizard
Wizard control
I found all these in a simple google search.

asp.net 2.0: update formview with jquery

I'm struggling with an issue I just can find a solution for.
First of all, I can't use asp.net AJAX or anything else thant standard asp.net 2.0 as the server admin won't install anything else.
So here is, what I try to do. (For the curious, skip to the bold question below)
My page consists of several parts, each of which gets loaded by jquery.load(url). One of these page parts gets filled with an aspx that contains a form view. As I don't want to have postbacks, I switch to the EditTemplate of the form view by a simple click on a regular html button that submits a parameter indicating the aspx page to switch to edit mode, e.g.
Page_Load(...)
{
if(Request.Params["SwitchEditMode"]) SwitchEditMode();
}
This works perfectly! Now here the part where I'm stuck. The elements in the EditTemplate are based on a select from a database view and bound to the fields by <%# Bind("xx"). Then I have a html button (no asp control) that submits a parameter to the aspx page that tells it to invoke the DataSource update method. In the dataSource_updating method I look for the controls that contain the values I want to save. But these values are always the same, as when I switch to the edit view. No changes I make in the textboxes or dropdowns are preserved.
A long story short, the question how to save the values from EditTemplate back to the database with jquery?
Up to now I tried several approches, that didn't work out.
In the updating() method look for the controls by FindControl and set e.Command.Parameter["xyz"] = foundcontrol.SelectedValue;. The values are always the same as in the beginning.
Set <asp:parameter name="SampleValue" /> and in the EditTemplate <asp:TextBox Value='<%# Bind("SampleValue")#> The values are always null.
Set a hidden input field with the selected value via javascript. This doesn't work as the control within EditTemplate are only visible after the switch into edit mode
So maybe I'm totally wrong with my ideas, heading into a totally wrong direction and this can be accomplished much easier, but up to now I don't know how to achieve this. I could do it without ajax, but for the user experience I'd prefer the version with jquery.
For all that have read this far and not got confused :-), thanks for your effort!
Best regards,
Andreas
I would forget using a form view and just use a regular html form with regular input controls. Return an object from your web service that has all of your values and populate the controls with ajax and then subjmit with ajax. Either do fully asp.net or fully html/jquery with asmx back end. Otherwise it's just too confusing.
If you load both "modes" of the FormView into the same page using AJAX, you're probably getting duplicate field names. One of them contains the unchanged values which are being saved. How will ASP.NET know the difference? You only want to submit the ones from the EditTemplate, which will require a separate form (or some other hack).
Or perhaps your HTML submit button isn't giving ASP.NET what it needs to repopulate the controls. Are you using ViewState in the page with the FormView?
All in all, this sounds like a hairy combination of technologies... as you well know.

Resources