CN108182236A - A kind of web page drop-down list implementation method of unified disposition data source - Google Patents
A kind of web page drop-down list implementation method of unified disposition data source Download PDFInfo
- Publication number
- CN108182236A CN108182236A CN201711447196.9A CN201711447196A CN108182236A CN 108182236 A CN108182236 A CN 108182236A CN 201711447196 A CN201711447196 A CN 201711447196A CN 108182236 A CN108182236 A CN 108182236A
- Authority
- CN
- China
- Prior art keywords
- drop
- data source
- down list
- methods
- dropdownlist
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Withdrawn
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/95—Retrieval from the web
- G06F16/958—Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/30—Creation or generation of source code
- G06F8/36—Software reuse
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Software Systems (AREA)
- General Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Databases & Information Systems (AREA)
- Data Mining & Analysis (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The present invention relates to web technology development fields, and in particular to a kind of web page drop-down list implementation method of unified disposition data source.Method of the present invention is to provide the data source of drop-down list by realizing unified method, and be fabricated to template, can be by calling specified template generation drop-down list in the page after to attribute setup data source key.The problem of present invention solves in web page and each will read data generation respectively using the place of drop-down list, and code cannot be multiplexed;It can be used for the realization of web page drop-down list.
Description
Technical field
The present invention relates to web technology development fields, and in particular to a kind of web page drop-down row of unified disposition data source
Table implementation method.
Background technology
Many places are needed using drop-down list in current web exploitation, are read in the corresponding server-side of the page
Then data create drop-down list and are shown on the page.Even if the different pages uses same drop-down list, the page exists respectively
Server-side repeats the code that write-read takes data creation drop-down list;Also result in that the small efficiency of exploitation is low, and code cannot be multiplexed in this way.
Because the code for reading data is dispersed in the different pages of modules, it is also inconvenient that management is got up, and easily error is so as to read
The data of mistake.
Invention content
Present invention solves the technical problem that it is to provide a kind of web page drop-down list realization side of unified disposition data source
Method solves the problems, such as that being dispersed in the modules difference page originally reads data creation drop-down list.
The present invention solve above-mentioned technical problem technical solution be:
The method is that the data source of drop-down list is fabricated to template, then gives attribute setup data source key;Lead to again
It crosses and specified template generation drop-down list is called in the page.
The method specifically includes following steps:
Step 1: realizing GetSourceItems methods, corresponding list of data items is returned to according to data source key;
Step 2: extending the DropDownList methods of HtmlHelper in MVC, pass through calling
GetSourceItems methods read data source, and the data creation that then basis obtains simultaneously returns to select elements;
Step 3: writing DropDownList templates, above-mentioned DropDownList methods are called, in a template generation drop-down
List;
Step 4: the property value for needing to generate drop-down list is given to set data source key by note form in model class;
Step 5: Html.EditorFor methods are called in the page and are specified using DropDownList templates, generation
Drop-down list.
Beneficial effects of the present invention:To after attribute setup data source key in model class, then unified method Rigen according to
Data source key reads data, realizes that different page invocations generates same drop-down list, data are all consistent, and reach several
It is configured according to source is unified.The generation of drop-down list is fabricated to template, by the specified template generation drop-down list of calling, realizes and writes
Less code realizes same function, also achieves the multiplexing of code.Unified configuration data can be realized using this form
Source is in the purpose of web page generation drop-down list.
Description of the drawings
The present invention is further described below in conjunction with the accompanying drawings:
Fig. 1 is the flow chart of the present invention.
Specific embodiment
As shown in Figure 1, the present invention uses following steps:
Step 1: realizing GetSourceItems methods, corresponding list of data items is returned to according to data source key;
Step 2: the DropDownList methods of HtmlHelper in MVC are extended, by calling GetSourceItems side
Method reads data source, and the data creation that then basis obtains simultaneously returns to select elements;
Step 3: writing DropDownList templates, the DropDownList methods write above are called, are generated in a template
Drop-down list;
Step 4: the property value for needing to generate drop-down list is given to set data source key by note form in model class;
[DropdownList("NewsType")]
public int NewsType{get;set;}
Step 5: Html.EditorFor methods are called in the page and are specified using DropDownList templates, generation
Drop-down list.
@Html.EditorFor (m=>m.NewsType,"DropDownList").
Claims (2)
1. a kind of web page drop-down list implementation method of unified disposition data source, it is characterised in that:The method is by under
The data source of list is drawn to be fabricated to template, then gives attribute setup data source key;Again by the way that specified template is called to give birth in the page
Into drop-down list.
2. according to the method described in claim 1, it is characterized in that:The method specifically includes following steps:
Step 1: realizing GetSourceItems methods, corresponding list of data items is returned to according to data source key;
Step 2: the DropDownList methods of HtmlHelper in MVC are extended, by the way that GetSourceItems methods is called to read
Data source is taken, the data creation that then basis obtains simultaneously returns to select elements;
Step 3: writing DropDownList templates, above-mentioned DropDownList methods are called, in a template generation drop-down row
Table;
Step 4: the property value for needing to generate drop-down list is given to set data source key by note form in model class;
Step 5: Html.EditorFor methods are called in the page and are specified using DropDownList templates, generation drop-down
List.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201711447196.9A CN108182236A (en) | 2017-12-27 | 2017-12-27 | A kind of web page drop-down list implementation method of unified disposition data source |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201711447196.9A CN108182236A (en) | 2017-12-27 | 2017-12-27 | A kind of web page drop-down list implementation method of unified disposition data source |
Publications (1)
Publication Number | Publication Date |
---|---|
CN108182236A true CN108182236A (en) | 2018-06-19 |
Family
ID=62547941
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201711447196.9A Withdrawn CN108182236A (en) | 2017-12-27 | 2017-12-27 | A kind of web page drop-down list implementation method of unified disposition data source |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108182236A (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109189379A (en) * | 2018-09-04 | 2019-01-11 | 百度在线网络技术(北京)有限公司 | code generating method and device |
CN109710253A (en) * | 2018-12-19 | 2019-05-03 | 国云科技股份有限公司 | A kind of web page radio button implementation method of disposition data source |
CN112949266A (en) * | 2019-12-11 | 2021-06-11 | 珠海金山办公软件有限公司 | Electronic form processing method, processing device, electronic equipment and storage medium |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20140006500A1 (en) * | 2012-06-29 | 2014-01-02 | Adobe Systems Incorporated | Interactive broadcasting between devices |
CN105549978A (en) * | 2015-12-17 | 2016-05-04 | 浪潮软件集团有限公司 | Configuration method for solving pull-down list parameters of web foreground page |
CN106844800A (en) * | 2015-12-03 | 2017-06-13 | 北京华大九天软件有限公司 | A kind of method that title is added for NoteText |
CN107315808A (en) * | 2017-06-27 | 2017-11-03 | 石化盈科信息技术有限责任公司 | A kind of Web query framework |
-
2017
- 2017-12-27 CN CN201711447196.9A patent/CN108182236A/en not_active Withdrawn
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20140006500A1 (en) * | 2012-06-29 | 2014-01-02 | Adobe Systems Incorporated | Interactive broadcasting between devices |
CN106844800A (en) * | 2015-12-03 | 2017-06-13 | 北京华大九天软件有限公司 | A kind of method that title is added for NoteText |
CN105549978A (en) * | 2015-12-17 | 2016-05-04 | 浪潮软件集团有限公司 | Configuration method for solving pull-down list parameters of web foreground page |
CN107315808A (en) * | 2017-06-27 | 2017-11-03 | 石化盈科信息技术有限责任公司 | A kind of Web query framework |
Non-Patent Citations (1)
Title |
---|
鱼不吐泡泡: "Html.DropDownListFor的用法总结", 《HTTPS://WWW.CNBLOGS.COM/SUNSHINEGROUND/P/4372538.HTML》 * |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109189379A (en) * | 2018-09-04 | 2019-01-11 | 百度在线网络技术(北京)有限公司 | code generating method and device |
CN109710253A (en) * | 2018-12-19 | 2019-05-03 | 国云科技股份有限公司 | A kind of web page radio button implementation method of disposition data source |
CN112949266A (en) * | 2019-12-11 | 2021-06-11 | 珠海金山办公软件有限公司 | Electronic form processing method, processing device, electronic equipment and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN104461484B (en) | The implementation method and device of front-end template | |
CN102201009B (en) | Form generating method and device | |
CN108182236A (en) | A kind of web page drop-down list implementation method of unified disposition data source | |
CN102591654B (en) | A kind of code generator based on SSH framework and method | |
CN105045775A (en) | Method and apparatus for generating Excel document in designated format | |
CN102609255B (en) | A kind of generation method of Spring IOC configuration file | |
CN109558575A (en) | Online Table edit method, apparatus, computer equipment and storage medium | |
CN103500087A (en) | Code generation method and device based on maven plug-in and freemarker template | |
CN102663103A (en) | Configurable method for automatically generating database and accessing data | |
CN103678575B (en) | By the method and system of the unified process of Middleware implementation several data database data | |
BR112015009764B1 (en) | Automated report generation method | |
CN102982010A (en) | Method and device for abstracting document structure | |
CN108153919A (en) | DBF data export platform and its deriving method | |
CN103927385A (en) | Unifying method and device of data model | |
CN104331284A (en) | Method and system for generating and displaying dynamic page | |
CN104346407B (en) | Form and the method and its device of XML file data interaction in data reporting system | |
CN108241902A (en) | A kind of Web projects and performance optimization method | |
CN102521551B (en) | Personalized IC (integrated circuit) card issuing device and method | |
CN104182228A (en) | Method and system for creating network applications | |
CN103440197B (en) | A kind of method automatically generating difference test report based on contrast test | |
CN104572744A (en) | Structured document generating method and device | |
CN100485687C (en) | Method and device for set-up disconnection data programmed model and its application | |
CN111708529B (en) | Method for generating form through dragging based on angular | |
CN103488468B (en) | The write method and system of portal website's page | |
CN110020414A (en) | A kind of electronic contract document creation method, system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
WW01 | Invention patent application withdrawn after publication |
Application publication date: 20180619 |
|
WW01 | Invention patent application withdrawn after publication |