Asp.net MVC Show specific items in Gridview/table depending on textbox -
Is it possible to capture specific elements from a database through the unit structure and after clicking on the 'Find' button Can the page be displayed?
Assume that there is a text box and you have to enter a number. After entering a certain number, the column of a certain database table will be searched for that number and all instances will be returned (every match line), but instead of displaying each column in the table, only 3 or 4 columns will be displayed . Is this possible? I have tried to achieve some success.
In addition to this, with my old site, I had a gridview and clicked a mouseover / javascript event which was done with a mouseover / outside and click it in the table and / or MVC with Gridview. can go?
It's great about MVC, you can actually do anything. For your first question, seems like a simple Ajax.
& lt; Div id = "mygrid" & gt; & Lt; / Div & gt; & Lt;% (Ajax.BeginForm ("/ path / to / action /", blank, new Ajax option {InsertionMode = InsertionMode.Replace, UpdateTargetId = "mygrid"}))) {%> & Lt;% = Html.TextBox ("q")% & gt; & Lt; Input type = "submit" value = "search" /> & Lt;%}% & gt;
Note to UpdateTargetId, which points to the empty device, and will replace the content of my grid with the joining mode that is returned from "/ path / to / action /" . The verb method can only provide a partial view that includes the table columns that you want to show: -)
According to your second question, this can be accomplished with a little CSS and perhaps jQuery magic. : -)
$ ("# mygrid tr"). Click (function () {$ (this) .toggleClass ("highlighted");});
Comments
Post a Comment